Skip to content

ci: batch node-frontier gate green pass (resolve-once-run-many, ~114s off the step) - #4614

Merged
briansrls merged 5 commits into
mainfrom
session/bold-ferret-385
Jun 10, 2026
Merged

briansrls merged 5 commits into
mainfrom
session/bold-ferret-385

Conversation

@briansrls

@briansrls briansrls commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

What

The v4 affected-set node-frontier CI gate (scripts/v4-affected-set-node-frontier-gate.sh, the single longest step in the CI run — ~253s on the arm64 runner, the wall-clock critical path) runs 15 Bool witnesses (9 node-frontier + 6 affected-testgen). Its green pass re-resolved the entire src/v4 module closure once per witness, even though all witnesses in each sub-gate share one --entry and differ only in --function.

Measured on this machine: one affected-testgen witness via gunbc run = 13.2s; all six via the new batch = 13.4s. The resolve is the whole cost; witness eval is essentially free.

How

  • New hand-written claim_batch bin (src/v2/stage0/src/bin/claim_batch.rs, + Cargo [[bin]]): resolves one shared --entry closure once, runs all --functions against it, prints per-function PASS/FAIL, fail-closed exit (1 on any red / non-Bool / runtime error / resolve failure).
  • New pub helpers in cli_run.rs (resolve_entry_graph, run_claim, ClaimOutcome): alternate orchestration over the same resolve/run primitives the gunbc run --claim-run path uses — not a second copy of the resolve logic. handle_run_with_options (the critical-path single-run path) is untouched.
  • Gate script: green pass batches by shared entry (node-frontier 9→1 resolve, affected-testgen 6→1). The perturb pass is unchanged — still one mutated resolve per row (each row mutates a different function), so the red-under-perturb discrimination contract is byte-identical.

Why a separate bin, not gunbc run --functions

The natural CLI form would enlarge cemented Rust string-literals inside emit_main_rs (src/v2/05_emit_rust.dag) — the emit stage, load-bearing per SELF_HOSTING.md. A separate hand-written bin (like the existing regen_stage0) delivers the same win and touches no pipeline stage, no generated main.rs, and has no stage0-freshness impact.

Validation (local)

  • claim_batch smoke: 3 witnesses in one ~5.8s resolve, all PASS; bad function → exit 1.
  • Full gate --perturb-check: green 15/15 PASS via batch, all 15 perturb rows still go red, exit 0.
  • cargo fmt --all --check clean; cargo clippy ... --bin claim_batch -D warnings clean.

Green savings ≈ 114s on the step (node-frontier ~48s + affected-testgen ~66s). The lens gate is intentionally untouched (its rows have distinct entries — no shared resolve to amortize; it is being split into a parallel job separately in #4612).

🤖 Generated with Claude Code

Brian Searls and others added 2 commits June 10, 2026 02:12
The v4 affected-set node-frontier CI gate runs 15 Bool witnesses (9
node-frontier + 6 affected-testgen) whose green pass re-resolved the
entire src/v4 module closure once per witness. The witnesses in each
sub-gate all share one --entry, so the resolve was pure redundancy:
measured one affected-testgen witness via `gunbc run` = 13.2s; all six
via batch = 13.4s — the resolve is the whole cost, the witness eval is
free.

Add a hand-written `claim_batch` bin (like regen_stage0) that resolves
one shared --entry closure once and runs all --functions against it,
reusing the same resolve/run primitives the `gunbc run --claim-run` path
uses (new pub cli_run::resolve_entry_graph / run_claim / ClaimOutcome).
Deliberately a separate bin, NOT a `gunbc run --functions` flag, so the
capability touches no load-bearing emit stage (the CLI is cemented Rust
inside 05_emit_rust.dag).

Gate script: green pass now batches by shared entry (9->1 and 6->1
resolves). The perturb pass is UNCHANGED — still one mutated resolve per
row, since each row mutates a different function — so the
red-under-perturb discrimination contract is identical.

Validated locally: full gate --perturb-check green (15/15 PASS via
batch, all 15 perturb rows still red, exit 0). Green savings ~114s on
the step (node-frontier ~48s + affected-testgen ~66s).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@briansrls briansrls changed the title ci ci: batch node-frontier gate green pass (resolve-once-run-many, ~114s off the step) Jun 10, 2026
@briansrls
briansrls marked this pull request as ready for review June 10, 2026 02:22
…espace)

The node-frontier gate (v4_lens_ci) now needs both gunbc and the new
claim_batch binary. The job previously cached only target/release/gunbc
under the shared 'gunbc-bin-' key (also used by ci_floor / ci_floor_emit,
which build gunbc only). On an exact-key cache hit the build step is
skipped, so v4_lens_ci could restore a gunbc-only cache and run the gate
with claim_batch absent -> gate fails its binary existence check.

Fix: give v4_lens_ci its own cache namespace ('gunbc-lens-bin-') whose
path includes both binaries. Both are produced by the same
`cargo build -p v2-compiler --release`, so they stay in sync and are
restored together. The distinct prefix also avoids restoring the
gunbc-only caches saved under 'gunbc-bin-'.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 4d4d5f7a · Trigger: schedule
  • Thinking: 244s wall

BLOCKING (1)

Root Cause

  • .github/workflows/ci.yml binary cache/build condition is keyed to gunbc alone → cache target/release/claim_batch too or make the build step run unless both required binaries exist.

⚠️ The batching shape looks reasonable, but the CI binary availability path needs to be closed.

@briansrls

Copy link
Copy Markdown
Contributor Author

Violations (could not place on specific lines):

  • scripts/v4-affected-set-node-frontier-gate.sh:39 BLOCKING: P3 fail-closed: this makes claim_batch mandatory, but the workflow cache/build gate still restores only target/release/gunbc and skips the build on a gunbc cache hit, so this witness gate can fail before running.

Brian Searls and others added 2 commits June 10, 2026 02:34
…_lens_gate

Merging main (#4612) split the old combined v4_lens job into v4_lens_gate
(lens witnesses, gunbc only) and v4_lens_ci (node-frontier witnesses, needs
claim_batch). My earlier cache fix (53bf3d4) auto-merged onto the v4_lens_gate
half by text match, leaving the actual node-frontier job on the gunbc-only
'gunbc-bin-' cache — so it still skipped the build on a cache hit and ran the
gate with claim_batch absent.

Move the gunbc-lens-bin- namespace + claim_batch path onto v4_lens_ci (the
node-frontier gate, scripts/v4-affected-set-node-frontier-gate.sh) and restore
v4_lens_gate to the shared gunbc-only cache it needs.

Validated locally: built both binaries and ran the node-frontier gate with
--perturb-check against merged src/v4 -> exit 0 (all witnesses green, all
perturb rows red).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed the BLOCKING finding (claim_batch availability in CI) — fix pushed, not a reply-only.

Root cause was exactly as flagged: v4_lens_ci cached only target/release/gunbc under the shared gunbc-bin- key and skipped the build on a cache hit, so the node-frontier gate could run with claim_batch absent.

Fix (commits 53bf3d4 → fb14417 merge → 95eb9c7): v4_lens_ci now caches both binaries under a distinct gunbc-lens-bin- namespace (they're produced by the same cargo build -p v2-compiler --release, so they stay in sync and are restored together; the distinct prefix avoids ever restoring a gunbc-only cache). A merge of current main (#4612 split the old job into v4_lens_gate + v4_lens_ci) initially landed the fix on the wrong half by text-match; 95eb9c7 moves it onto the actual node-frontier job and restores v4_lens_gate to its gunbc-only cache.

Validated locally: built both binaries and ran scripts/v4-affected-set-node-frontier-gate.sh --perturb-check against merged src/v4 → exit 0 (all witnesses green, all perturb rows red).

— sent from bold-ferret-385

@briansrls
briansrls merged commit 138b89e into main Jun 10, 2026
11 checks passed
@briansrls
briansrls deleted the session/bold-ferret-385 branch June 10, 2026 03:02
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