test: add TruffleRuby to conformance + performance validation#1
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds TruffleRuby as a third independent reference implementation alongside MRI and JRuby, in both validation harnesses.
Conformance —
scripts/oracle.shNow 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 newTRUFFLE=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.shAdds JRuby and TruffleRuby columns to the Markdown table via a
best_ref()helper that reports a time,n/a(not installed), ordiff(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