Skip to content

bench agent builds a job's bitstream before its approval, so the approved run only loads and reads (Closes #8792) - #8797

Merged
gHashTag merged 1 commit into
masterfrom
hot/bench-prebuild-8792
Oct 10, 2026
Merged

gHashTag merged 1 commit into
masterfrom
hot/bench-prebuild-8792

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Hot reload H7 of #8737, epic #8095.

What

  • The rule: specs/verified/bench_agent.t27 gains job_prebuild() and PREBUILDS_PER_POLL.
    • t27c bench-agent builds a job the owner opened, but has not yet approved, with t27c silicon --skip-hardware.
    • That returns before the hardware section, so the cable is never touched.
    • It stores the bitstream in the reuse cache (bitstream_reuse.t27), whose key holds only build inputs: Verilog, XDC, tools, seed, recipe. There is no nonce and no board in it.
    • After /bench approve, the run reads REUSE and spends its time on the board alone.
  • Before this PR, the board waited for yosys and nextpnr first: about 30 s for ternary_link and 400-550 s for gft_signed_mac, measured 2026-10-11 on this Mac.
  • Guards, each a named test:
    • only the owner's jobs;
    • never a job asking for non-volatile memory;
    • never twice;
    • nothing while the agent is paused;
    • at most one prebuild per poll, after the approved runs.
  • "Twice" is keyed on the job's build fields (spec, top, seed), not its text. The Queen rewrote bench job: ternary_link, seed 11, built before approval (first hot run, #8792) #8794's body between two polls, and my first, body-keyed marker built the same job again. That was found in this PR's own test and fixed here.
  • Glue: 12 lines in run_bench_agent. The budget is paid for by deleting scripts/gen_w328.py, a one-shot wave-328 generator that only an old plan file mentions.
  • Generated code: bench_agent.rs is regenerated. It also gains REUSE, which comes from the import closure; the committed file was stale.

Tested

On #8794 (ternary_link, seed 11, open, not approved):

step result
t27c bench-agent --once, pass 1 #8794: refuse, then prebuilt specs/fpga/ternary_link.t27 for its approval (no cable touched): exit Some(0)
pass 2 #8794: refuse only; the marker holds (2 s)
t27c silicon specs/fpga/ternary_link.t27 --top fpga/verilog/ternary_link_jtag.v --skip-hardware --pnr-seed 11 bitstream REUSED, 7 s
an openFPGALoader process at any point during the three steps none (polled every 0.5 s)
t27c test-report specs/verified/bench_agent.t27 7 tests, 0 failed, 0 vacuous

Local gates: gitleaks clean, only-t27 gate 0, foreign-line budget 0, tri seals drift clean.

Not done

#8794 runs on the board only after the owner's /bench approve. Agents on this account never post that word.

🤖 Generated with Claude Code

…oved run only loads and reads (Closes #8792)

Hot reload H7 of #8737. specs/verified/bench_agent.t27 job_prebuild()
lets `t27c bench-agent` build a job the owner opened, but has not
approved yet, with `t27c silicon --skip-hardware`. That returns before
the hardware section, so the cable is not touched, and stores the
bitstream in the reuse cache, whose key holds only build inputs (no
nonce, no board). After `/bench approve` the run reads REUSE and spends
its time on the board alone, instead of 30 s (ternary_link) to 400-550 s
(gft_signed_mac) of yosys and nextpnr first.

Only the owner's jobs, never one asking for non-volatile memory, never
twice, nothing while paused, and one per poll after the approved runs.
"Twice" is keyed on the job's build fields, not its text: the Queen
rewrote #8794's body between two polls, and a body-keyed marker built it
again.

Tested on #8794 (ternary_link, seed 11, not approved): pass 1 prebuilt
it, pass 2 skipped it, no openFPGALoader process ran, and `t27c silicon
... --skip-hardware` then read "bitstream REUSED". Spec 7/7 tests, 0
vacuous. Paid for by deleting scripts/gen_w328.py, a one-shot wave-328
generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) October 10, 2026 20:49
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-10 20:49:13 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=465abf513dc2 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 8882127 into master Oct 10, 2026
28 of 33 checks passed
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.

2 participants