Repository navigation
Conversation
284km
left a comment
There was a problem hiding this comment.
Reviewed current head c888465 against current main f0f372e, including the benchmark, event/location fixture, generated source and scanner callers. No new actionable code defect found. Frozen binary delimiters preserve the searched byte values, and the new fixture exercises reused parser state and the 64 KiB window boundary well.
Independent focused validation on macOS arm64:
- All 14 corpus files directly requiring Psych/YAML match clean Ruby 4.0.10 on the evaluator and VM: 28/28 exact stdout comparisons, all exit 0.
- Current-base and head parser sources, each loaded into the generated Ruby implementation, match the reference on corpus 1072 and 1160: 4/4 comparisons.
- Regenerating m_psych_lib.mere produces an identical file; diff whitespace checks pass.
- Native tests reuse the existing ordinary O2 candidate binary (SHA-256 3f3cdd2d50dc5a24708073a3a531db96cf205eebb81fb3e0b9ae4749d3c9bedd). Before reuse I verified all 1,829 recorded source/dependency input hashes against the fetched head and dependency files, checked native source inventory coverage, and verified the binary hash again after testing. This was not a fresh build or a native build of current main.
This is a functional review, not memory acceptance. I have not independently rerun the full benchmark, whole upstream files, Linux checks or full suites. The documented tight-GC evaluator RSS increase and incomplete full-fixture tight-GC comparison still leave the stated no-peak-RSS-increase requirement unmet; the completed ordinary-GC diagnostics do not close it. Keeping this draft is appropriate. Hosted CI remains unfinished, including executing Linux jobs and queued macOS jobs. No merge attempted.
284km
left a comment
There was a problem hiding this comment.
Follow-up review of head dcc5dc2 against current main 3c58e04. No new actionable code finding. The six PR-specific files, including the production parser and generated source, are byte-identical to the previously reviewed c888465 head; the new commit integrates main through b5c4249. Main advanced during this review; its subsequent changes leave all Psych generator/library inputs unchanged. The binary delimiters retain the same ASCII search bytes, and the regression fixture usefully covers event locations, reused parser state and the 64 KiB boundary.
Independent focused checks on macOS arm64:
- All 14 corpus files directly requiring Psych/YAML match clean Ruby 4.0.10 with both the current-base and current-head parser loaded into the generated Ruby implementation: 28/28 exact stdout comparisons, all exit 0.
- Regenerating m_psych_lib.mere is byte-identical; git diff --check passes. Neither fetched tree contains AGENTS.md or CLAUDE.md.
These are Ruby-source checks. No native evaluator/VM binary was built or executed in this follow-up, and this is not resource acceptance. I did not rerun the full suites, upstream whole-file comparisons or memory benchmark. The description reports completed ordinary-GC full-fixture medians (evaluator RSS +1.987%, VM -6.741%) and one completed tight-GC pair per engine; the remaining tight-GC pairs and their medians are still pending. Those measurements concern main f0f372e and local candidate 1782ce9d, not the newly integrated head reviewed here. The historical scaled results do not replace this acceptance work.
Keeping this draft is appropriate. Hosted PR CI remains unfinished. The recorded build-linux corpus-step failure on earlier main b5c4249 remains under an active all-merge hold; the latest main run 46559447762 is pending and exposed no jobs at inspection. Neither the new main SHA nor a pending run clears that failure or supplies missing coverage. No merge attempted.
284km
left a comment
There was a problem hiding this comment.
Follow-up review of 8b2bd7cd2818115c57fdbc241d817035cd068adc against freshly fetched main 3c58e0494d2b28b3f7e1aa1211e7bd3dc678ec5e (prospective integration tree 6dc933210217959997f656019ee599be99399174). No new actionable code defect found. The production parser and embedded source are byte-identical to the previously reviewed dcc5dc2f; this update adds the measurement runner, results and notes.
The completed full-fixture record closes the earlier missing-median evidence, but does not meet memory acceptance. Independently recomputing the recorded medians confirms VM peak footprint 755.720 → 802.939 MiB (+47.219 MiB, +6.248%), instructions +4.159% and process wall time +1.545%. VM median maximum RSS decreases 3.133%; that distinct counter does not remove the footprint increase. The description appropriately retains the adverse result and draft status. A scanner-only solution still needs evidence satisfying the stated resource requirement.
Independent checks performed:
- Read all changed files, parser callers, existing reviews/discussion and the current-main integration diff. No tracked AGENTS.md or CLAUDE.md exists on fetched base/head.
- Verified all 12 recorded samples: serial alternating order, successful exit/no timeout, identical reference stdout, raw resource-report fields and every reported median. Verified the recorded parser/embedded-source hashes against their exact Git revisions and the benchmark harness hash against the committed file.
- Regenerated the full original 65,536-record input with seed 1 under Ruby 4.0.10: SHA-256 matches the committed measurement. A new reference unsafe_load run produces exactly the recorded full-fixture stdout/checksums.
- All 14 Psych/YAML corpus programs match clean Ruby 4.0.10 with both current-main and head parsers loaded into the generated Ruby implementation: 28/28 stdout/exit comparisons pass. Regenerating m_psych_lib.mere is byte-identical; whitespace checks pass. The new Python runner parses successfully.
The recorded resource runs concern main b5c4249a and candidate dcc5dc2f, built with Mere 9dec2ff6; current CI pins 72bb0d09. Those results remain tied to their recorded sources/compiler, rather than establishing current-main integration acceptance. I did not rebuild or execute a native evaluator/VM binary, rerun the 12 long resource samples, or repeat whole upstream suites in this follow-up. Hosted Linux/core and several macOS jobs remain running/queued. The resource requirement and recorded global merge holds remain open, and the PR is a draft. No merge attempted. This is a COMMENT review on the authenticated user's own PR.
|
Follow-up to the review of 8b2bd7cd. Clarified the provenance limitation in the PR body and in commit ec2d606: the resource samples apply to main b5c4249 / candidate runtime dcc5dc2 with Mere 9dec2ff6. The CI workflow at reviewed head 8b2bd7c defaults to Mere 72bb0d09, so these samples do not establish memory acceptance for that compiler or a newer main integration. The notes heading now names the measured baseline explicitly. I rechecked all 12 recorded samples and independently recomputed every median; they agree with the record. The VM median peak-footprint increase remains +47.219 MiB (+6.248%), despite lower median peak RSS. There is still no validated scanner-only fix for that increase, and the PR remains draft. This follow-up changes documentation only; the production code and raw measurement JSON are unchanged, and no new native/resource run is claimed. The CI run for the reviewed 8b2bd7cd head has since completed successfully, including build-linux, build-macos, corpus, and all eight CRuby shards; the evaluator-versus-VM comparison job was skipped. This is functional CI evidence for that head, not memory acceptance or evidence for a newer integration. |
284km
left a comment
There was a problem hiding this comment.
Follow-up review of ec2d60635192c3575b071b5c8233da5f4c0ff77b against freshly fetched main 3c58e0494d2b28b3f7e1aa1211e7bd3dc678ec5e. No new actionable finding. The only tracked change since reviewed head 8b2bd7cd is the measurement-scope clarification in the notes; production code, benchmark tools and raw measurement JSON are unchanged. The PR-body response and notes now clearly tie the results to main b5c4249a, candidate dcc5dc2f and Mere 9dec2ff6, and distinguish that compiler from the CI default 72bb0d09. This addresses the provenance concern in the previous review.
Independent focused validation in a fresh temporary clone:
- Recomputed every recorded median across all 12 completed samples; results agree. Verified the recorded parser/embedded-source hashes against their exact Git revisions and the harness hash against the committed file.
- All 14 Psych/YAML corpus programs match clean Ruby 4.0.10 with each of current-main and head generated Ruby implementations: 28/28 exact stdout/exit comparisons pass. These are Ruby-source checks, not executions of the native evaluator or VM.
- Regenerating the embedded Psych source is byte-identical on both revisions; Python runner syntax and diff whitespace checks pass. Neither revision contains tracked AGENTS.md or CLAUDE.md.
The resource issue remains open: recorded VM median peak footprint rises 755.720 → 802.939 MiB (+47.219 MiB, +6.248%), despite lower median maximum RSS. The clarification correctly avoids claiming memory acceptance for a newer compiler or main integration. No new native build, resource run or whole upstream suite was performed in this follow-up. Keeping the PR draft remains appropriate.
The previous reviewed head's core CI run 46586407118 completed with 26 successful jobs and the evaluator-versus-VM job skipped. Current-head CI run 47033171778 and several gem workflows remain in progress; downstream coverage is unfinished. I inspected all 27 jobs of latest main CI run 46559447762: 25 succeeded, one skipped, and the recorded Wasm failure remains. Existing global merge holds are preserved. No merge attempted. COMMENT on the authenticated user's own PR.
|
The review correctly distinguishes peak footprint from maximum RSS. The completed full-fixture record still shows VM median peak footprint +47.219 MiB (+6.248%), instructions +4.159% and wall time +1.545%; the lower RSS counter does not satisfy the no-increase requirement. I am retaining the adverse results and draft status. There is no validated scanner-only correction in this update. The earlier resource samples remain tied to b5c4249/dcc5dc2f and Mere 9dec2ff6; they are not current-main/current-compiler acceptance. A replacement needs the same full fixture, alternating completed samples on both engines and the stated memory requirement, using the applicable pinned compiler. No GC-policy change, relaxed bound, or new resource pass is claimed in response to this review. |
Use frozen binary delimiter constants when searching Psych's binary source windows, avoiding repeated UTF-8 compatibility scans. Parser locations, scalar resolution, AST, and visitor behavior are preserved.
Full-fixture tight-GC measurement, 2026-12-01: main
b5c4249aversus candidatedcc5dc2f. The candidate merges that main commit with a merge commit; the merge was pushed normally, without rebasing or force-pushing. This measurement does not depend on a pending Rails-2 memory fix.All 12 runs complete, exit 0, and match Ruby 4.0.10's full-fixture output/checksums. The input contains the original 65,536 citations records, rendered before measurement from the committed Rails fixture. Both engines use
MERE_RUBY_GC_TIGHT=1, seed 1, and the same ordinary O2 compiler/dependency pins (Mere9dec2ff6, mgz661a01d8). Evaluator runs leaveMERE_RUBY_VMunset; VM runs set it to 1.Measurement scope: these resource results apply to main
b5c4249a, candidate runtimedcc5dc2f, and Mere9dec2ff6. The CI workflow at reviewed record head8b2bd7cddefaults to Mere72bb0d09. The recorded results do not establish memory acceptance for that compiler or for a newer main integration. This review follow-up performs no new native/resource measurement; the recorded VM footprint regression remains open.Per engine, the serial order is main, candidate, main, candidate, main, candidate. The timeout is 7,200 seconds per run on both revisions; no run reaches it. No other heavy workload was launched alongside this comparison. No Rails cold run or whole unit suite was launched.
Every entry below is the median of three completed per-process measurements from
/usr/bin/time -l. Wall time, instructions, peak memory footprint, and maximum RSS cover startup, load, and validation; fixture rendering is excluded. The footprint column uses the tool'speak memory footprintcounter. The RSS column uses its separatemaximum resident set sizecounter. Neither is an instantaneous RSS sample.b5c4249adcc5dc2fb5c4249adcc5dc2fAssessment: the VM candidate is worse on median peak footprint by 47.219 MiB (+6.248%). Evaluator median peak footprint decreases 1.234 MiB (-0.177%). VM median peak RSS decreases 23.984 MiB (-3.133%), so that RSS decrease does not remove the footprint regression. VM wall time increases 1.545% and retired instructions increase 4.159%; evaluator wall time decreases 1.671% and instructions decrease 7.734%.
I do not currently have a validated scanner-only fix that removes the VM footprint increase while retaining this optimization. The parser already clears its source/window/token references after parsing, and the private-tree/cache experiments previously reported in PR #413 did not establish a fix on both engines. Those experiments are not part of this patch. The increase remains in this candidate; no GC/arena-policy change was added. The PR remains draft. This table supplies the requested full-fixture evidence; it is not a no-increase acceptance claim.
Observed process peaks vary substantially. The three footprint peaks are retained here as well as in the raw record:
Historical 8,192-record tight-GC results, main
9d1c0f32versus the original scanner candidate, seed 1, three alternating pairs per engine: instructions are medians; peak RSS is the maximum of three. Wall times and the distinctpeak memory footprintcounter were not retained in that saved record, so they are not reconstructed or substituted with load-time diagnostics from another revision.The historical 8,192-record evaluator RSS increase is 6.250 MiB; VM RSS decreases 3.203 MiB. These older scaled figures do not replace the full-fixture comparison above.
The integration's scanner corpus case
1160matches Ruby 4.0.10 on main/candidate and evaluator/VM (four comparisons). The runner also completed its 128-record check with 12 serial samples across both revisions and engines before the full measurement. Binary, parser-source, embedded-source, fixture, benchmark, and compiler hashes were verified after measurement. The raw record includes all 12 stdout/resource reports and recomputable medians: measurement JSON.Reproduce using
bench/psych_citations_measure.pywith--main MAIN_TREE --candidate CANDIDATE_TREE --input FULL_INPUT.yml --reference-output REFERENCE.stdout --output NEW_RESULTS_DIR --count 65536 --seed 1 --timeout 7200. Prepare the fixture and reference output usingbench/psych_citations.rbunder the pinned reference Ruby before starting the runner. Both trees must have ordinary O2 builds. Platform: macOS 26.7.3 arm64, Apple clang 21.0.0.The follow-up record commit
8b2bd7cdadds only the runner, measurement JSON, and notes; the measured production runtime is the mergedcc5dc2f.Historical measurements and validation before b5c4249 (superseded baselines and status)
The protocols, queued-run status, and acceptance statements below predate the completed measurement above.
Current-main full-fixture ordinary-GC results are complete (not the historical scaled results below): main f0f372e versus locally integrated candidate 1782ce9d, 65,536 records, three alternating pairs per engine, --seed=1, 600-second / 2-GiB bounds on both sides. All 12 samples finish with reference checksums. Peak RSS is per-process maximum from /usr/bin/time -l; the comparison statistic is the median of three peaks.
Tight-GC full-fixture sampling has completed its first alternating pair on both engines, with the bound raised equally to 3,600 seconds per sample. All four samples exit 0 and match the reference checksum. These are individual samples, not medians of three.
The remaining two tight-GC pairs are queued: free disk space fell to approximately 7.2 GiB, below the shared 10-GiB admission guard. The guard is unchanged; no other session's files or processes are touched. The controllers retain completed samples and will acquire slots individually when storage/admission permits. This PR remains draft; the ordinary-GC evaluator median increased and the full tight-GC median is not yet available.
Current-main local validation is complete:
sh run_corpus.sh --both1043/1043,MERE_RUBY_VM=1 sh run_corpus.sh --both1043/1043, andMERE_RUBY_VM=1 sh tools/iseq/vm_corpus.sh -j 21043 VM / 0 fallback / 0 FAIL. All source gates and record_hygiene pass; the five unchanged original Psych files below pass on reference, main evaluator/VM and candidate evaluator/VM (25 individual file runs). Candidate binary SHA-256:a76af466421e084194baf6df8d864b7457c2a2c0a0ba9bdd7303f74a63847230. Runtime inputs and binary hashes remain frozen. The production parser change is unchanged; no forbidden GC/arena/slab/policy code is modified. The current-main integration and completed record will be pushed together after measurements. The older results below remain explicitly historical.Use frozen binary delimiter constants when searching Psych's binary source windows. The old UTF-8 delimiter made String#index repeatedly check encoding compatibility across windows up to 64 KiB long. This preserves parser locations, scalar resolution, AST and visitor behavior. The embedded Psych source is regenerated; no GC/arena policy changes are included.
Draft: full-fixture acceptance is being remeasured under the owner-updated protocol. Rails-2 is paused and has no imminent memory fix; this PR is not waiting for it. Local candidate 1782ce9d merges current main f0f372e. Both engines use the original 65,536-record fixture, fixed seed 1, and three alternating main/candidate pairs per GC mode. Report the median of three per-process peak RSS measurements. Ordinary-GC bounds are 600 seconds per sample; tight-GC bounds are raised equally to 3,600 seconds per sample on both sides. The 2 GiB family-RSS bound is unchanged. A tight pair that hits its bound is completed on both sides and reported as incomplete, without a completed-run median. Each sample acquires/releases a machine-wide heavy slot; the total Codex cap stays at two.
Out of scope: Mere arena/compact/pinning/shed code; mere-ruby iv_slab/ocls and #392; collection thresholds/lower bounds, conservative scanning and GC_TIGHT behavior. None is changed. The current-main integration and completed record will be pushed together after local checks. The figures below are historical diagnostics, not the new acceptance results; the 8,192-record comparison alone does not decide acceptance.
Initial macOS sample on base 1cfbafe found enc_all7 under enc_pair_guard / enc_compat2_k during scanner searches. On 8,192 citations, parsing took 17.38 s and tree conversion 2.74 s on evaluator (VM: 17.00 s / 2.73 s). Separate scalar-resolution and direct Hash/String-building controls rule those out as the dominant parser cost. All final matched measurements below use main 9d1c0f3, ordinary O2, pinned Mere 9dec2ff6 and mgz 661a01d8. These are macOS measurements, not Linux results.
The benchmark commits the exact Rails 8.1.4.1 citations ERB fixture, revision 3f290b759c8e2ffe7c257951b1255740751355e4. It renders all 65,536 records under the reference outside the counted process and verifies every loaded row. Scaled 1,024/8,192-record inputs are identified separately. No full unit-test or Rails component suite was run.
Corpus 1160 covers event locations, UTF-8/CRLF, comments/tabs, properties/flow syntax, reused Parser state, scanner-window boundaries and citations. Eleven relevant fixtures match on both engines and both revisions (44 comparisons); the new cases also match clean ruby 4.0.10 through
tools/ref_ruby.sh.Five unchanged CRuby files, reference versus main evaluator/VM and candidate evaluator/VM (25 individual file runs, each file run separately):
Candidate binary SHA-256
3f3cdd2d50dc5a24708073a3a531db96cf205eebb81fb3e0b9ae4749d3c9bedd; source/dependency hashes are verified before and after validation. Evaluator runs leave MERE_RUBY_VM unset.sh run_corpus.sh --both: 1040/1040 PASS, index on/off.MERE_RUBY_VM=1 sh run_corpus.sh --both: 1040/1040 PASS, index on/off.MERE_RUBY_VM=1 sh tools/iseq/vm_corpus.sh -j 2: 1040 on the VM, 0 fallback, 0 FAIL.Native costs: MERE_RUBY_GC_TIGHT=1, --seed=1, three alternating main/candidate pairs per workload and engine, 36 samples. Instructions/load time are medians; RSS is the maximum of three, MiB. unsafe_load uses 8,192 records; scalar/build use 1,024.
The full original 65,536-record fixture, ordinary GC, seed 1, one diagnostic pair per engine, unchanged 2 GiB / 600 s bounds. Every run completes with the reference checksum. These ordinary-GC runs are speed diagnostics, not tight-GC peak-RSS acceptance.
The 8,192-record tight-GC evaluator maximum is about 6.25 MiB higher; the VM maximum is lower. Full-fixture ordinary-GC RSS is higher on both engines in this current-main diagnostic. Ordinary same-binary peaks vary, so one pair cannot establish the magnitude, but it does not establish the requested memory acceptance either.
The earlier full-fixture tight-GC comparison (base 08a452e, same parser change, seed 1) reaches the original 600 s bound on both main and candidate. Candidate/main observed peaks are 289,648 / 322,752 KiB before timeout; neither run completes its checksum or instruction report, so neither is a full-fixture memory pass. Bounds are not raised and incomplete runs are not counted as passing.
Functional validation is complete; memory acceptance, exact-head review and hosted CI remain. Reproduce with
bench/psych_citations.rb unsafe_load INPUT.yml 8192 --seed=1, or count 65536 for the original fixture; prepare inputs under ruby 4.0.10 using the benchmark's prepare mode.Additional private-tree lifetime diagnostic (library-only benchmark shim, no production changes): three alternating main/current/prototype runs per engine, GC_TIGHT=1 and seed 1, 8,192 records. The prototype clears completed AST child lists during conversion; all 18 checksums pass. Peak RSS in MiB, main / current candidate / prototype:
This does not meet the requirement on both engines and is not included. A production version would additionally need ownership guards and public-AST/callback compatibility tests. Memory acceptance remains open; no GC/arena policy work has been started.
Native String ASCII-cache diagnostics (kept outside this PR): matched fresh ordinary O2 builds against main f0f372e, same compiler/mgz pins, original parser source, 8,192 records, GC_TIGHT=1 and seed 1, three alternating pairs per engine for each variant. The first uses the existing receiver-ASCII helper for every compatibility check; the second uses it only when a cache entry already exists and otherwise takes the original path, so its new path creates no cache entries. Neither changes GC/arena code. All 24 checksums match the reference; both reduce instructions by about 18%. Reported peak RSS (maximum of three), MiB:
Neither alternative establishes the requested no-peak-RSS-increase acceptance, so neither is included. These are checksum/resource diagnostics, not semantic/gate/full-corpus acceptance for a replacement implementation. The production implementation stays unchanged and draft while the authorized full-fixture remeasurement runs. No GC/arena policy changes have been started.