Skip to content

instrument-dispatch: declare the memory demand of whole-tree instruments - #13162

Merged
gunbai-bot[bot] merged 4 commits into
mainfrom
session/eager-crab-323
Oct 4, 2026
Merged

gunbai-bot[bot] merged 4 commits into
mainfrom
session/eager-crab-323

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Follow-up from #13141, raised by silent-stag-648.

What

  • gunbc.instrument_dispatch_workflow gets InstrumentDispatchMemoryDemand rows, one per label. dependency-demand-census and v2-native-census each declare 20 GiB.
  • Generation-time wall: every row must fit gunbc.ci_runner_target ci_runner_target_ram_speed_budget(selected_ci_runner_target()). That is the existing RunnerMemoryRegime vocabulary; no new memory class is minted. If a row doesn't fit, or names a label that isn't dispatchable, the generator refuses and no workflow is emitted.
  • Run-time wall: each row adds a guard step gated on inputs.label == '<label>', placed before checkout. It takes the least of every numeric memory.high/memory.max along the job's cgroup path and MemTotal. If that is below the demand, it fails with ::error::InstrumentMemoryBudgetUnmet. There is no env toggle.

Why per label

A single job-wide number would refuse every smaller subject (a_gate_sized_for_the_largest_subject_refuses_every_smaller_one). The round-trip battery and self-host-equivalence labels carry no row, so they have no memory wall. That is a known gap, not an oversight.

Evidence / limits — read before approving

  • The 20 GiB is a policy budget taken from the "about 20GB" figure in instrument-dispatch: admit //gunbc/instruments:v2-native-census (on-demand whole-tree resolve census receipt) #13141, not a measured peak. The fleet slot's memory.high is 25 GiB, so it fits.
  • New witness claims, none of them evaluated yet:
    • the census rows exist, are dispatchable, and fit the selected target;
    • a failing control: a demand one byte over the budget does not fit;
    • the guard is bound to its label, carries the byte count, and precedes checkout.
  • Not evaluated locally. The BuildBuddy executor exposed no cgroup, so the interpreter refused with HostBudgetUnreadable before evaluating anything. Parse and type correctness, the claims, and the YAML are left to CI.
  • The YAML was hand-regenerated to mirror the generator. The generated-artifact drift lane is the check that it matches expected_instrument_dispatch_yml.

🤖 Generated with Claude Code

Brian Searls and others added 4 commits October 3, 2026 22:42
…nstruments

Census labels carry a 20 GiB demand, admitted at generation against
gunbc.ci_runner_target ci_runner_target_ram_speed_budget and refused at run
time by a label-bound cgroup guard before the prelude.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…the witness byte count from the row

Addresses review 75124: the guard is bash_build statements emitted by
bash_emit_stmts with its own refusal arm, one script bound per label with the
row's byte count in the step env; the witness reads the demand row rather
than restating the literal.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…step model, not on YAML quoting

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit 02a29de Oct 4, 2026
4 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/eager-crab-323 branch October 4, 2026 06:05
@briansrls
briansrls restored the session/eager-crab-323 branch October 4, 2026 06:10
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.

0 participants