Skip to content

fix(gc-ratchet): recover main baseline and surface scheduled failures - #9837

Closed
proggeramlug wants to merge 3 commits into
PerryTS:mainfrom
proggeramlug:codex/fix-9829-gc-ratchet
Closed

fix(gc-ratchet): recover main baseline and surface scheduled failures#9837
proggeramlug wants to merge 3 commits into
PerryTS:mainfrom
proggeramlug:codex/fix-9829-gc-ratchet

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Main's shared-CI GC ratchet had 43 baseline breaches and an inert receiver-store probe. This restores the gate with a live probe, a selective baseline receipt, and scheduled-failure reporting, without a version bump.

Changes

The recovery record and accompanying JSON contain the per-cell receipt, raw samples, hashes, and evidence grades. Eight fresh historical builds confirm adjacent-commit effects from #8657, #8806, #8900, and #9373. The September 1 attribution is corrected from #9359 to #9373. Remaining window-level explanations are explicitly marked bracketed, following the issue's completed classification; they are not presented as isolated bisections.

The original quiet-host RSS/timing values remain intact. The resized workload needs a separate capture on that original host before using the pinned_host timing profile. The public Node/Bun baseline is unchanged.

Related issue

Fixes #9829.
Fixes #9834.
Includes the probe repair proposed in #9833. Implements the GC-ratchet portion of #9830; monitoring the other workflows remains separate.

Test plan

Development and testing ran over SSH on the requested Linux x86-64 host.

  • Fresh release build of perry, perry-runtime-static, and perry-stdlib-static together, with codegen-units=16 and LTO disabled.
  • Pre-fix measurement matches all 126 deterministic medians from macOS CI run 33989581881 and reproduces its 43 regression rows.
  • Both independent seven-repeat repaired measurements pass check --profile shared_ci --allow-platform-mismatch; every probe matches Node 26.5.1. The platform override is local only; CI retains its strict platform check.
  • Protected probe 10 passes with from-space protection and depth 64. Removing its allocating RHS restores the zero-collection signature.
  • Retention classification reports zero conservative-stack excess on all 14 probes.
  • python3 -m unittest discover -s tests -p 'test*gc_ratchet.py': 115 passed.
  • Artifact validation, GC gate wiring check and its 18-case self-test, Rust file-size check, and git diff --check pass.
  • Audit confirms exactly the 46 receipt-bound distributions changed. The production issue parser recovers all 43 rows from the actual failed CI log.

Checklist

  • No workspace version, CLAUDE.md, CHANGELOG.md, or public baseline changes.
  • Conventional commit prefixes and a changelog fragment.
  • Read CONTRIBUTING.md; affected harness and workflow behavior covered by tests.

Summary by CodeRabbit

  • New Features

    • Failed main-branch GC ratchet runs now create or update a single tracking issue with regression details and evidence.
    • Successful recovery runs automatically add a recovery update and close the incident.
  • Bug Fixes

    • Repaired an allocation benchmark so it reliably exercises garbage collection.
    • Improved measurement consistency for rounded timing values and JSON round trips.
    • Excluded one nondeterministic capacity metric from gating while retaining related performance checks.
  • Documentation

    • Added recovery records, measurement rationale, and updated GC ratchet baseline documentation.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: db6a3796-5aab-4d0e-98f8-ecdf98c0748a

📥 Commits

Reviewing files that changed from the base of the PR and between bcce8de and 1c2db4d.

📒 Files selected for processing (13)
  • .github/workflows/gc-ratchet.yml
  • .github/workflows/test.yml
  • benchmarks/gc_ratchet/README.md
  • benchmarks/gc_ratchet/baseline/gc-ratchet-v1.json
  • benchmarks/gc_ratchet/evidence/9829-recovery.json
  • benchmarks/gc_ratchet/evidence/9829-recovery.md
  • benchmarks/gc_ratchet/gc_ratchet.py
  • benchmarks/gc_ratchet/probes/10_store_receiver_across_alloc.ts
  • benchmarks/gc_ratchet/tolerances.json
  • changelog.d/9837-gc-ratchet-recovery.md
  • scripts/report_gc_ratchet.py
  • tests/test_gc_ratchet.py
  • tests/test_report_gc_ratchet.py

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The GC ratchet recovery updates probe measurements, accepted baseline data, validation for rounded distributions, and evidence for nondeterministic capacity. It also adds serialized incident reporting for eligible main-branch workflow runs and expands test discovery and coverage.

Changes

GC ratchet recovery

Layer / File(s) Summary
Measurement recovery and baseline update
.github/workflows/gc-ratchet.yml, benchmarks/gc_ratchet/..., changelog.d/9837-gc-ratchet-recovery.md
Probe 10 uses a larger allocating workload. Probe 13 keeps heap_total_bytes informational after 21 runs with variable reserved capacity. The baseline records 46 accepted deterministic deltas and their provenance.
Distribution consistency and ratchet validation
benchmarks/gc_ratchet/gc_ratchet.py, tests/test_gc_ratchet.py
Distribution statistics and persisted samples use the same cleaned values. Tests cover JSON round trips, non-finite samples, selective receipts, and preservation of other probe gates.
Main-run incident reporting
scripts/report_gc_ratchet.py, .github/workflows/gc-ratchet.yml, .github/workflows/test.yml, tests/test_report_gc_ratchet.py
Eligible scheduled and main-branch dispatch runs create or update one marked issue on failure and close it after recovery. The reporter parses regression rows, prevents stale reopenings, serializes writes, and is covered by offline lifecycle and workflow tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 1c2db

The probe exclusion is backed by applicable same-binary evidence, and no merge-blocking issue remains.

Sequence Diagram(s)

sequenceDiagram
  participant MainWorkflow
  participant GCRatchetGate
  participant report_gc_ratchet
  participant GitHubIssues
  MainWorkflow->>GCRatchetGate: run GC ratchet checks
  GCRatchetGate-->>MainWorkflow: success or failure result
  MainWorkflow->>report_gc_ratchet: pass run ID and result
  report_gc_ratchet->>GitHubIssues: read run, jobs, logs, and issue state
  report_gc_ratchet->>GitHubIssues: create or update failure issue
  report_gc_ratchet->>GitHubIssues: close issue after a newer successful run
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 5 files. (7 skipped: 7… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes: recovery of the GC ratchet baseline and reporting of scheduled failures.
Description check ✅ Passed The description includes the required Summary, Changes, Related issue, Test plan, and Checklist sections. It provides detailed scope, validation results, issue references, and confirms that version an…
Linked Issues check ✅ Passed The changes satisfy the coding objectives in [#9829] and [#9834]. They repair the inert probe, restore the GC ratchet with evidence-backed selective updates, preserve gating and tolerance bands, make …
Out of Scope Changes check ✅ Passed The code, workflow, documentation, evidence, baseline, and test changes directly support the linked GC-ratchet recovery and artifact-validation objectives. The probe repair is explicitly identified as…
Full details: Docstring Coverage

Explanation

Docstring coverage is 9.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 5 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main via merge train #9867. The gc_runtime_root_holders.json conflicts were resolved with a structural JSON merge (union by (file,name), pins recomputed from the tree) rather than a text union. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant