Skip to content

test: add TruffleRuby to conformance + performance validation#1

Merged
tannevaled merged 1 commit into
mainfrom
truffleruby-validation
Jun 26, 2026
Merged

test: add TruffleRuby to conformance + performance validation#1
tannevaled merged 1 commit into
mainfrom
truffleruby-validation

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Adds TruffleRuby as a third independent reference implementation alongside MRI and JRuby, in both validation harnesses.

Conformance — scripts/oracle.sh

Now a 4-way differential oracle: rbgo vs MRI vs JRuby vs TruffleRuby. The per-reference comparison is factored into diff_one() so every reference (including the new TRUFFLE=truffleruby) is checked uniformly, and a divergence names each implementation it disagrees with. References that aren't installed are skipped (not failed), as before.

Performance — bench/run.sh

Adds JRuby and TruffleRuby columns to the Markdown table via a best_ref() helper that reports a time, n/a (not installed), or diff (output diverges from MRI). The harness previously timed only MRI(+YJIT).

Both harnesses gracefully skip any reference that isn't present, so the validation runs with whichever implementations are installed.

🤖 Generated with Claude Code

Add TruffleRuby as a third independent reference implementation alongside MRI
and JRuby:

- scripts/oracle.sh: now a 4-way differential oracle (rbgo vs MRI vs JRuby vs
  TruffleRuby). Factor the per-reference comparison into diff_one() so each
  reference (incl. the new TRUFFLE=truffleruby) is checked uniformly and a
  divergence names every implementation it disagrees with. Absent references are
  still skipped, not failed.
- bench/run.sh: add JRuby and TruffleRuby columns to the performance table via a
  best_ref() helper that reports a time, 'n/a' (not installed) or 'diff'
  (output diverges from MRI). The harness previously timed only MRI(+YJIT).

Both gracefully skip a reference that is not installed, so the validation runs
with whichever implementations are present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled tannevaled merged commit dc2865a into main Jun 26, 2026
9 checks passed
@tannevaled tannevaled deleted the truffleruby-validation branch June 26, 2026 05:25
tannevaled added a commit that referenced this pull request Jun 30, 2026
Brings in the set-algebra perf merge (#87) and re-pins go-ruby-json to
its squash-merged main pseudo-version after lib PR #1 landed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tannevaled added a commit that referenced this pull request Jul 1, 2026
* json: single-pass parse/generate via go-ruby-json streaming API

Close the JSON.parse (~3.9x) / JSON.generate (~3.7x) gap vs MRI 4.0.5.

The binding previously converted the whole document twice each way: parse
built a go-ruby-json `any` tree that fromJSON then walked to build the rbgo
object graph; generate built an intermediate json value tree that the library
then walked. Both are now one pass over the new streaming API:

- jsonParse drives json.ParseInto with an objBuilder that materialises the
  rbgo object graph directly (no intermediate tree), interning small integers
  (object.IntValue) and pre-sizing each Hash/Array to its parsed width
  (new object.NewHashCap).
- jsonGenerate / jsonPrettyGenerate push the rbgo graph straight into the
  library's json.Encoder via an objSource, with no intermediate json tree.

Output stays byte-identical to MRI 4.0.5 (verified end-to-end: key order,
floats, escaping, unicode/surrogates, bignums, -0.0, duplicate keys,
generate vs pretty_generate, symbolize_names). Re-pins go-ruby-json to the
streaming-API release.

Measured rbgo-vs-MRI 4.0.5 (M4 Max, best-of-8), ratio before -> after:
  small object  parse 3.73x -> 2.67x   generate 4.10x -> 2.50x
  1k-array      parse 6.10x -> 3.90x   generate 4.85x -> 2.19x
  deep nested   parse 4.80x -> 4.82x   generate 4.24x -> 1.63x
  big strings   parse 18.6x -> 5.0x    generate 15.7x -> 4.0x

100% coverage on every file touched; gofmt/vet clean; CGO=0 builds on all
six 64-bit arches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Merge main into perf/json-fastpath; re-pin go-ruby-json to merged main

Brings in the set-algebra perf merge (#87) and re-pins go-ruby-json to
its squash-merged main pseudo-version after lib PR #1 landed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
tannevaled added a commit that referenced this pull request Jul 2, 2026
lib PR #1 (Schema inflection helpers) merged; move rbgo off the branch
pseudo-version to the merged-main pseudo-version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant