Repository navigation
The Method-copy check compares the second half with the first - #394
Conversation
…st's, the median of three runs, against 1.3
284km
left a comment
There was a problem hiding this comment.
Reviewed head 0a02e142 (tool + record only; ci.yml and its invocation are unchanged).
The change is sound and I have no Critical/Major/Minor findings.
- The new metric (peak of batches 21–30 over peak of batches 6–15, median of three) removes exactly the two things the samples in the body show were moving the old ratio: the climb of the first ~8 batches and the position of the highest saw tooth. The old "max over all batches / batch 0" could not separate those from growth.
- Failure handling stays strict: any run that exits non-zero, hits the outer RSS/wall limit, or is incomplete leaves
medianasNone, so the side is unhealthy. A fast leak that reachesRSS_KBtherefore still fails. - The negative control is the right evidence that the bound is not vacuous:
--leak-every 10(≈3.3 MB/batch) fails at 1.339 and--leak-every 5(≈5.4 MB/batch) at 1.462, against 1.035 without a leak.
Suggestions (non-blocking):
- The margin at
--leak-every 10is thin (1.339 vs 1.3). The body already states the 5.4 MB/batch row as the size that reliably fails; it may be worth saying the same in the docstring, so a later reader does not read "3 MB a batch must fail" as a guarantee. - The no-leak row shows mere still growing about 1.1–1.2 MB per batch while ruby is flat. It stays under the bound, but it looks like a small real per-batch retention rather than noise; worth a line in the loop record as something to look at later, together with the VM numbers.
- Worst case is now 6 ×
WALL(600 s) per job instead of 2 ×. Normal runs are 25 s, so this only matters when something hangs; fine as is, just noting it.
… with no leak and the worst time are in the record
284km
left a comment
There was a problem hiding this comment.
Reviewed exact head c20b0c2 against current main/base 856e61b, the earlier review and the current consumers. The updated explanation appropriately distinguishes the observed negative-control margin and possible residual retention. The new driver fails closed for truncated observations, missing completion markers, nonzero exits, resource-limit events and a zero first-window peak. However, two Major/P2 integration regressions remain: existing result consumers cannot read the new JSON, and diagnostic consumers import a workload that no longer satisfies their locked-input contracts (inline).
Independent validation used the actual base/head driver main functions with controlled supervisor transcripts, not real memory measurements. A healthy base transcript is accepted by the current compiler-comparison consumer; a healthy head result instead raises KeyError for samples_kb/post_gc_peak_to_initial and has incompatible bounds. Six head rejection controls (growth above 1.3, truncation, nonzero exit, resource limit, missing marker, zero denominator) all exit 1. The supervisor calls retain the original 600-second/2-GiB outer limits. The imported program's hash and diagnostic-prefix checks match on main and fail on head. No interpreter build or actual Linux/macOS RSS/negative-control rerun is claimed.
Hosted compiler-comparison and build/test jobs are still running or queued. No merge: the two integration issues and recorded hold_all_merges/new_failure_review_required remain. This metric change does not establish a runtime memory repair or clear historical original-check failures. COMMENT because the authenticated account owns the PR.
| ratios = [run['second_half_peak_to_first'] for run in runs if run['ok']] | ||
| median = statistics.median(ratios) if len(ratios) == RUNS else None | ||
| healthy = median is not None and median <= GROWTH | ||
| result['sides'][side] = dict(runs=runs, median=median, healthy=healthy, |
There was a problem hiding this comment.
[Major / P2] Migrate the existing result consumers with this schema change. tools/cache_compiler_compare.py::collect still prints each side's post_gc_peak_to_initial immediately after invoking this driver. The new result has only runs, median, healthy and binary_sha256, so even a successful measurement now aborts that collector with KeyError: 'post_gc_peak_to_initial', before its core-case comparisons. This PR directly triggers the Cache compiler RSS comparison workflow, whose matrix runs that collector. Its assessor also expects top-level samples_kb/execution and the old bounds object. I reproduced a healthy head driver result with controlled supervisor transcripts: its exit is 0, but the actual consumer raises KeyError; the equivalent current-main result is accepted. Preserve a versioned legacy measurement for the locked comparison, or migrate the collector and assessors together without relabeling historical 2x evidence as the new metric. iclass_resource_replay.py also reads the removed field; audit the other consumers.
| collect.call | ||
| sample.call(0) | ||
| 20.times do |batch| | ||
| BATCHES.times do |batch| |
There was a problem hiding this comment.
[Major / P2] Keep the locked diagnostic workload separate from the new gate workload. PROGRAM is imported by rss_native_probe.py and method_copy_retention.py, rather than being private to this driver. The former requires its SHA-256 to equal the original PROGRAM_SHA and still requires exactly 21 RSS samples; the latter refuses to run unless PROGRAM.count('20.times do |batch|') == 1. With this changed 30-batch program, the hash check fails and the prefix count is zero, so those existing diagnostic entry points reject the workload before collecting their evidence. Both contracts match on current main and fail on this head. Keep an explicit unchanged legacy program for the fixed-input diagnostic/replay tools, or deliberately update their contracts and provenance alongside the new program; changing only this exporter leaves the tools unusable.
…ls that import or read them
284km
left a comment
There was a problem hiding this comment.
Re-reviewed c20b0c23..38dfc632 against the two automated Majors.
- Result consumers: fixed.
--legacyruns the unchanged 20-batchPROGRAMand writes the old result shape (samples_kb,execution,post_gc_peak_to_initial, oldbounds), judged against 2.0 as on main.cache_compiler_compare.collectpasses--legacy.iclass_resource_replaypasses it only when the root's driver has it, so older roots keep working. The halves result keeps its own fields, so no 2.0-era value is relabelled as the new metric. - Importers of
PROGRAM: fixed.PROGRAMis byte-identical to main's program (the author reports the SHA-256 matchingrss_native_probe's pin, and20.times do |batch|appears exactly once). The new gate workload isHALVES_PROGRAM. --legacywith--leak-everyis refused, which is right.
Minor nit, non-blocking: detecting --legacy support by substring in the driver's text works, but would also match a comment mentioning the flag. Asking --help or checking for the add_argument('--legacy' line would be stricter.
No blocking findings from me. Please add the Cache compiler RSS comparison run's result to the PR when it finishes. The merge waits for the automated reviewer on this head and for #373.
284km
left a comment
There was a problem hiding this comment.
Follow-up on exact head 38dfc63 against current main 856e61b. Both earlier Major/P2 integration findings are fixed in code: PROGRAM is byte-identical to main and retains the pinned diagnostic hash and 20-batch prefix; the comparison collector explicitly requests --legacy, and the resource replay selects it for drivers that support it. Legacy results retain their original schema and 2.0 bound, separately from the new halves metric. No new actionable issue found in this update. I have not resolved anyone's review threads.
Independent validation: cache-compiler comparison 16/16, iclass resource replay 18/18, clone-RSS heap 7/7, native RSS probe 12/12, page RSS probe 12 passed/3 skipped. Thirteen controlled driver cases cover healthy results, growth rejection, truncated/missing-marker transcripts, nonzero exits and resource limits in both modes, plus zero-denominator rejection in the new mode. The actual comparison consumer accepts a healthy legacy result, and supervisor calls retain 600 seconds/2 GiB. These are transcript/compatibility checks, not fresh interpreter or RSS measurements. The legacy zero-initial-sample path still raises the same TypeError as main; this predates the PR and does not establish a new regression.
Actual Linux/macOS RSS and negative-control acceptance, and hosted compiler comparisons, remain separate evidence requirements. No merge: the recorded hold_all_merges/new_failure_review_required is active. This test-metric change does not clear historical runtime memory failures.
|
The Cache compiler RSS comparison workflow on 38dfc63: run 46095681058, success. Both subjects'
On c20b0c2, before the legacy mode, the same jobs stopped with KeyError 🤖 Generated with Claude Code |
tools/method_copy_memory_check.pymakes 1,000 classes in each batch, gives each of them 20 Method copies, lets them go, collects, and samples RSS. It held max(every batch) / batch 0 to 2.0, core_assertions.rb's leak bound.On Linux in CI that ratio varied from 1.61 to 2.14 with no leak:
Why it varied
Every sample of five runs on Linux (arm64, in docker, main 491cc5c), in MB. All ten runs had the same shape:
MERE_RUBY_GC_TIGHT=1did not steady it. It lowered batch 0 from 95 MB to 80 MB, and the ratio rose to 1.97 to 2.07. The program draws no random numbers, so there is no seed to fix.The change
--leak-every Nkeeps every Nth class in a global Array. It is a negative control: the check must fail with it. It does not run in CI.One run of the check, both sides, takes 25 s on Linux, where it took about 6.
Numbers
Linux (arm64, docker), main 491cc5c, the check itself:
--leak-every 10--leak-every 5So a leak of 3.2 MB a batch fails it, close to the limit. One of 5.3 MB fails it with room to spare.
The growth with no leak (1.1 MB a batch, batch 1 to batch 30) is the climb of the first batches, not a slope. The second half's peak stays at the first half's.
Before the change, with the same program over 30 batches and no leak, three runs on each engine gave the ratio of halves:
The VM
CI runs this check on the evaluator only, and it still does.
On the VM the new ratio was 0.95 to 1.03 with no leak, and 1.33 to 1.49 with a leak. Its earlier five runs over 20 batches gave a ratio of halves (16-20 / 6-10) of 1.02 to 1.26.
The VM's Method copies, left for later. The VM's RSS over these batches is below the evaluator's, but it saws further. By the old ratio it is over 2.0 on main as well: 2.13 to 2.42 over five runs. Nothing here says that it leaks. Its ratio of halves over 30 batches is about 1.0. But one run of five reached 175 MB at batch 16 from 148 at batch 13. Looking at that is not part of this change.
Checked
--leak-every 5and--leak-every 10exit 1. No leak exits 0.The record is
loop/2026-11-28-method-copy-check-halves.md..github/workflowsis not touched.🤖 Generated with Claude Code