Repository navigation
placement, gpu-gates: derive independent node budgets from the census - #330
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: No behavior failure or proven quality defect survives review.
Non-blocking
⚠ Exercise the census clause itself: gate_qwen38_nodes.rs:1417 calls only census_specs.
Replacing the call in census_plan at line 553 with local specs leaves this test green. The one-card clause then compares machines against those substituted specs.
Exercise census_plan with fixture inputs and assert the remote connection error.
Checked
Duplicates: 7 new functions checked by grep; none duplicated. The moved NoKv and exposed APIs reuse existing definitions. Dryer reported 0 pairs; gpu-gates was checked manually.
Complexity: crapper flagged census_plan, 8 → 26. Existing orchestration gained census and budget validation branches; budget construction reuses NodeBudget.
Silent failure: 2 new sites followed. NotUnified is an expected rejection; a discarded fixture-channel send cannot produce a successful test because join and receive are checked.
Tests: static mutation review. Dropping the routed-only filter or adding KV breaks the budget oracle; copying the local spec or summing loopback pools breaks the fixture assertions. Skipping the remote read inside census_specs fails its test on a working card; bypassing its caller remains uncovered as above. Updated remote fixtures preserve zero-KV planning.
Gates: no threshold, band, tolerance or gate removed or relaxed; no PIN change required.
Adversarial checks: distinct remote UUID/free readings, discrete cards, missing census, missing budgets and integrated specs without a free reading reach checks or named errors. No token-dependent hot path or unsafe block changed.
Escape catalog: no C1–C4 pattern matched. No ledger lessons apply.
Notes
Static review only; runtime tests were not rerun. The PR leaves lint and affected-gate results pending. Its card-run evidence omits the fixture model file path.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen38_nodes.rs, crates/gpu-gates/src/generate.rs, crates/gpu/src/host/node.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
Refs #127.
What and why
This is the placement half of the engine step in
docs/contrib/dgx-spark.md9.2 and answer 20 in its section 11, the step after #321. The node gate (gate_qwen38_nodes) now builds one independent card machine per node from the census and derives each node'sNodeBudgetfrom that machine. Until now the budget code for a remote node existed only as copies inside thenodes_scaletests, and no gate checked that a census reading reached a node's own plan.Release notes: internal: the node gate plans each node from its own census reading, and
plan_node_tiersand the remote budget builder become public so that the engine load can use them next; the load itself is unchanged.What changes:
plan_node_tiersloses its test-only condition, so the gate binary can call it.NodeBudget::routedbuilds a remote node's budget:routed_onlymodel, zero KV, the remote's own machine. It reusesrouted_only,plan_routedandNodeBudget::of.NodeBudget::nodeis a read-only accessor that the existing node-identity check now uses.nodes_scalefixtures had six copies of the remote budget branch. They now call one test helper,budget_on, which callsNodeBudget::routed. The independent oracle keeps its own full-model or routed-only choice, so the tests still compare the builder with a separate path. The three-node testcensus_budgets_keep_each_node_and_stage_termsgives each node a different UUID and free reading and checks its machine, pool and budget.gate_qwen38_nodes, a new census clause builds the independent machines from the census. Node 0'sNodeBudgetandTermscome from its full-model plan, and each remote's budget comes fromNodeBudget::routed. The clause checks each machine's UUID, free reading and pool against its census spec, and checks that each budget names its own node. On a discrete card it keeps the existing loopback path, and a unified-node input on one must be refused withNotUnified.census_specsis the one function that reads the remote census and the local stage spec.census_plancalls only it, and a test calls it against a closed port, so a gate that stops reading the remote census fails.generate.rsdocuments that a loopback tier address shares this host's physical pool. The existing loopback test now goes throughPlace::on_nodeswith a fake census server that reports a different UUID and free reading for the remote, and checks that the remote's free bytes are not added to the stage pool.docs/contrib/dgx-spark.md9.2 and section 10 say what is done and what is left.What this PR does not do
docs/contrib/dgx-spark.md9.2 says so.machine_for_expertsconstants; section 10 lists this too.Code shape
NodeBudget::routed. The six copies innodes_scalecallbudget_on. The remote census read has one owner,census_specs, and the gate uses the existingnode_cardreader.accepts::routed_rule.plan_node_tiersandNodeBudget::routedin the gate,NodeBudget::nodein the gate and the node planner.cargo fmtis clean:cargo fmt --all -- --checkreturns 0. The lint result is in the table below.Duplication found or removed (
path:line), or "none": the remote budget branch copied in thenodes_scalefixtures is nowNodeBudget::routed(crates/placement/src/placement/nodes.rs:216) behindbudget_on(crates/placement/src/placement/nodes_scale.rs:237). The independent oracle in those tests is left as a separate path on purpose.What I ran
The head is
18661cad. The base isd0e8a8e1. Most rows below ran at667b7f3a, which differs from the head only in the census fixture's thread ingenerate.rs(it now starts throughthreads::helper::spawn_helper); at the head,cargo fmt --all -- --check,tools/check-arch.shandgenerate::testsran again and passed. Unit tests and fmt ran on an RTX 5090 host, and the fixture gate and the placement gate ran on one DGX Spark. Base logs say which commit they ran on.cargo fmt --all -- --checkcargo test -p bloomery-placement -p bloomery-levers, thencargo test -p bloomery-model arch::qwen35moe::placetest result: ok. 40 passed; 0 failedfor levers,test result: ok. 134 passed; 0 failedfor placement, andtest result: ok. 22 passed; 0 failedfor the Qwen placement testsBLOOMERY_BOX_LOCAL=1 BLOOMERY_TIER=fixture just gate-gpu-qwen38-nodesPASSED: gate_qwen38_nodes,clauses: 8 ran, 0 left to the real tier, with 6 unit tests passed. The fixture run uses one card and loopback, so it is not a real-model run and not a two-machine runjust gate-placement6 passed, 5 failed. The based0e8a8e1ends the same way, with the same fivehw_placement_*tests failing on the missing DeepSeek-V4.1 first shard, so this gate is not shown to passcensus_specsmutation and after the twogenerate.rsmutations. The run on the earlier source stays green, rc 0LC_ALL=C just contrib-check --tier t0DONE tier=t0 total=84 red=2. One red step ischeck-arch, which the base does not have:crates/gpu-gates/src/generate.rs: 1 spawn(s), not in tools/spawn-allow.txt (use threads::helper::spawn_helper). It was the fake census server's thread in the new test; the head starts it throughspawn_helperandtools/check-arch.shpasses there. The other red step ischeck-recipes, which the base shows too (DONE tier=t0 total=84 red=1): a--v41-queueself-test fails there, and the base fails the same wayjust mac-static)just affectedgates againstd0e8a8e1, with the base run beside themjust canon-checkandptx-scangate-gpu-qwen38-nodesagainst the real Qwen3.8 modelFAIL-first mutations. The first three apply to the head's production code, the fourth to the earlier source:
census_specs, the remote census read is replaced by the local stage specno local census replaces the remotePlace::on_nodes, the remote census is read but the stored spec is the stage'sspecs[1] == remote_speccheckcensus_specs,census_planstops reading the remote census (not a head mutation)census_specsand its closed-port test closeWhat I ran into
None of this blocks the PR.
contrib-check --tier t0also showscheck-recipesred on both the head and the base, andjust gate-placementends the same way on both, so the branch adds no red step there.The loopback clause cannot tell a real remote census from a copy of the local one on a single Spark. A test that fakes the census server, the closed-port test and the mutations above cover the code paths, and a two-machine run would cover the rest. That run is not part of this PR.
The node plans in the clause use the generic workstation card constants. The program's
machine_for_expertsconstants differ, and section 10 lists the difference as work left.An earlier version of the new three-node test compared a budget's pool with the raw free reading and failed.
Plan::pool_needadds the CUDA context cost back to the free reading, so the test now compares against that owner.Hardware (if the change is for a machine)
Unit tests and fmt ran on an RTX 5090 (
NVIDIA GeForce RTX 5090, 595.99.02, 12.0innvidia-smi). The fixture gate and the placement gate ran on one DGX Spark (NVIDIA GB10, 595.84, 12.1). These are pass and fail results, not timings.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.