Case file: PR #675 — fix(ignition): forward recipe b12x_environment to multi-host peer ranks
Key findings
- The same bug already has an open fix by the area's maintainer, and #675 does not mention it. Open PR #668 ("fix(ignition): reconcile divergent multi-host selections, propagate peer b12x env and kernel cache…", lukealonso, opened 2026-12-01 22:26) states the identical defect — "HostRendezvous.prepare did not transmit those settings and serve_peer never applied them. As a result, peers prepared with different b12x behavior from rank zero—directly contributing to declaration divergence on GLM-5.3" — over the same three files (
ignition/preparation/host_ranks.py,ignition/cli/serve.py,tests/preparation/test_host_ranks.py) plusaot.py(not opened)/collectives.py(not opened), closing issue #651. The two are not stacked: they are semantic duplicates carried on different channels and will collide textually in the same functions (HostRendezvous.__init__,_admit,knock,join). - The description cites no problem source. No issue, PR or measurement is referenced, even though the defect was filed as #651 and independently measured on hardware in nepenth's 2026-12-02 comment on #668 (2× GB10, GLM-5.3 TP2: missing
B12X_W4A16_A4_PREFILL=1on rank 1 → rank 1 prepared BF16-activation W4A16 prefill, +33 % cold prefill, 18.4 s vs 12.6 s at 32 k). The repo's AGENTS.md:165-169 requires an unrelated-to-issue PR to address "a demonstrated defect" — it is demonstrated, but only inside #668/#651, not here. - One description claim is inaccurate. "Reordered
jointo computesource_identity()and completeknock(...)before callingenvironment.apply" —source_identity()was already beforeknockon main; the only real reorder isenvironment.applymoving after the knock (serve.py:548-555 vs main serve.py:545). - Validation is weaker than the sibling fix in a way that matters for a documented invariant.
_validate_b12x_environment(host_ranks.py:193-205) acceptsB12X_COMPILE_CACHE_DIR, whichenvironment.py:47sets to the localkernel_cache/b12xand which :51 lets a recipe override; #668 explicitly rejects that key. Latent today ("no recipe sets that var"), but it is the one place a peer's local cache path could be redirected to rank zero's path. - No validation of any kind yet. 0 comments, 0 reviews, no labels, no flop-autobot intake/review (unlike #668, which got both within ~20 min), no CI checks on head 92b977d; the "195 passed" result is self-reported and was not reproduced in this case file. First-time contributor (Reederey87) who filed the closely related issue #676 the same morning from the exact 2×DGX-Spark GLM-5.3 TP2 setup — so the hardware evidence exists but is absent from this PR.
- Peers still inherit rank zero's absolute
config.kernel_cachethrough the pickled configuration (host_ranks.py:486, rank_group.py:110), untouched here; #668 fixes it. So partial parity only: +3 more lines.
The change (what it does, and where it diverges from the description)
Size: +194 / −11 across 3 files at head 92b977d, base main, merge base 1fbcc3c9 (#667, merged 2026-12-01).
Mechanics, verified by reading at pr/675:
ignition/preparation/host_ranks.py:193-205— new_validate_b12x_environment: coerces todict, raisesValueError("b12x settings name B12X_ variables with string values")on non-mapping or on any name that is not astrstarting withB12X_, or value that is notstr. Slightly stricter on the name type thanRecipe.__post_init__(ignition/declaration.py:251-253, which would raiseAttributeErroron a non-str name).host_ranks.py:219-229—HostRendezvous.__init__(..., b12x_environment=()), validated at :223 beforesocket.create_serverat :229, so a bad mapping is rejected before the listening socket binds.host_ranks.py:290-292— the control-channel admission reply gains"b12x_environment": self.b12x_environment. Additive JSON key;PROTOCOLstays 5 (host_ranks.py:41).host_ranks.py:609-623—knockreturns a 3-tuple(control, executor, b12x_environment); it validatesreply.get("b12x_environment", {})before opening the executor connection, and closes the control socket on rejection (:618-620), so no executor socket is ever opened for a malformed reply.ignition/cli/serve.py:193-197(_export_hosts) and:416-420(debug_serve) passb12x_environment=model.recipe.b12x_environment.plan.recipeis the sameRecipeobject asmodel.recipe(ignition/planning.py:543,595; serve.py only doesreplace(plan, hub_cache=…)), so both sides use identical settings. Rank zero's own apply remainsenvironment.apply(configuration, local, plan.recipe.b12x_environment)at serve.py:211 / :438.serve.py:530-560—joinnow runsHost.discover→source_identity()→knock→environment.apply(configuration, (gpu,), b12x_environment)insidetry/except BaseExceptionclosing both sockets →serve_peer.- Why that reaches b12x:
environment.apply(ignition/cli/environment.py:36-74) setsTORCH_CUSTOM_PYTHONPATH,CUDA_VISIBLE_DEVICES,HF_HUB_CACHE,B12X_COMPILE_CACHE_DIR,FLASHINFER_WORKSPACE_BASE,TRITON_CACHE_DIR,TORCHINDUCTOR_CACHE_DIR, then spreads**dict(b12x)(recipe values win, :51), thenruntime_patches.apply(), which imports torch and callsworkers.register_hooks()(ignition/runtime_patches/init.py:106-119) — theb12x.preparationimport path the description names. tests/preparation/test_host_ranks.py:334-476— five tests (one parametrized ×3): forwarding to every peer over real loopback TCP; pre-bind rejection; malformed-reply rejection with control-socket close and no executor;joinapplies the received variable beforeruntime_patches.apply()andserve_peer()(assertsevents == [("runtime_patches","1"),("serve_peer","1")]);joincloses both sockets whenenvironment.applyraises.
Not said in the description:
knock()changes from a 2-tuple to a 3-tuple (host_ranks.py:623) — an undocumented breaking signature change for out-of-tree callers (ignition is a library per AGENTS.md:6). All in-repo call sites were checked: serve.py:548 updated, tests/preparation/test_host_ranks.py:28 helper is tuple-agnostic, tests at :399. No other production caller.serve_peer(host_ranks.py:626-773) itself does not receive or apply the env; it relies entirely onjoinhaving set the process environment first. Any other caller ofserve_peergets no protection.- No docs updated (nothing in the diff under
docs/).
The why
- Independent corroboration that the defect is real: #668 (open) diagnoses it in the same words; #651 (open issue, hiroshi-ya, 2026-12-01) is the multi-host GLM-5.3 export failure (1321 differing kernel selections, non-converging retries) that #668 attributes partly to this asymmetry; nepenth's 2026-12-02 03:04 comment on #668 is the only hardware measurement of the consequence (+33 % cold prefill at 32 k;
--reuse-weightslayout mismatch, device-57; propagation restored 49 s re-exports). - No standalone issue exists for "recipe
B12X_*settings are not forwarded toignition joinpeers" — search_items for it returns nothing. #675 therefore cites no defect. - Feature provenance:
Recipe.b12x_environmentcame in with commit9a719611"Declare Kimi K3's b12x settings in its recipe" (Martin Vit, 2026-10-17), which also touchedignition/cli/serve.py; it survives on main as ignition/declaration.py:205-207,231 ("b12x reads them only from its environment, so Ignition sets them for the preparing process") and is applied at serve.py:211/438 and bench.py:205 (not opened). #237 (merged, voipmonitor) notes the b12x deps "select" kernels, i.e. these settings are behaviour-changing, not cosmetic.
Related work
- #668 (open, lukealonso, COLLABORATOR; labels area:preparation, area:rocenante, bug, performance, priority:P2, triage:review; +423/−44, 8 files; closes #651) — same bug, different channel: it sends a dedicated
"b12x-environment"control message fromHostRendezvous.preparebefore the assignment object is unpickled (so import-time reads see it), also embeds it inassignment, hasserve_peervalidate and apply it toos.environ, and additionally accepts a peerkernel_cachefromjoinand remapsconfig.kernel_cache; wiring frommodel.recipe.b12x_environmentat serve.py:197,420. Its validation (host_ranks.py:201-239) rejects non-B12X_keys,B12X_COMPILE_CACHE_DIR, and non-string values. Merge both and you get two channels for one datum plus conflicts in the same functions — a choice has to be made; they are not stacked. - #651 (open issue) / #631 (closed issue) — the multi-host selection-divergence reports the bug belongs to; #675 cites neither.
- #667 (merged
1fbcc3c9, Luke Alonso, 2026-12-01, "Harden Orbit payload integrity, multi-deployment TP seams, GB10 page-cache release, Unix flock drop, and multi-host peer exports") — #675's merge base and the last change to host_ranks.py; #668's review notes merge overlap with it there. - #648 (merged
555db719) — maderuntime_patches.apply()pull inb12x.preparationviaworkers.register_hooks(); #675 depends on that shape, is not undone by it. - #647 (merged
f2ca2c41) — the multi-host tuning/reconcile machinery behind #631/#651, i.e. the context where the asymmetry bites. - #676 (open issue, same author, opened 10:51 the same day) — scheduler prefill-chunk ITL on GLM-5.3 TP2 / 2×DGX Spark, with a receipts repo and prototype patch; names
B12X_W4A16_A4_PREFILL=1in its export config. - Textual-conflict neighbours on
host_ranks.py, different behaviour: #394 (voipmonitor, rank export workspace), #671 (kbenkhaled, memory budgets for ≤16 GiB integrated devices); onserve.py: #475, #560, #533. #597 touches ForwardCache keying inaot.py(not opened) (overlaps #668, not #675). - Checked and set aside: #395 (CUDAGraph.reset, incidental host_ranks.py mention), #581 (USE_NODE_PRIORITY exports), #310, #584, #512, #623, #624, #628, #640, #670.
helios/src/execution/rendezvous.rs:25,155,174-221is a separate Rust binary-framed serving rendezvous (ADMITTED byte) — #675 changes only the Python JSON control channel, so no Helios change/rebuild is required.
Recent activity
1fbcc3c9(#667) is the last commit on host_ranks.py and #675's merge base; no default-branch commit since the branch point has touched any of the three changed files, so the branch is current against main and the only real conflict is open #668.f2ca2c41(#647, 2026-11-30) introduced the tuning/reconcile flow around #651; #675 is a small orthogonal piece of the same multi-host-correctness story.555db719(#648, 2026-11-30) is what routesruntime_patches.apply()intob12x.preparation.f377dc85(#543) and9a719611(Kimi b12x in recipe) last touched theb12xlines ofserve.pybefore this PR.- Direction of travel: the autobot review of #668 endorsed having a boundary validation before
os.environupdates (its subtractions 3 and 4 were dropped for that reason), which is an argument that_validate_b12x_environmentbelongs — but as one shared implementation, not two.
People
- Author: Reederey87 — GitHub association FIRST_TIME_CONTRIBUTOR; besides #675 the only item in 180 days is issue #676 (same day, 10:51). Head commit
92b977dis authored by "Artem Matskevych" (consistent with a solo contributor). No repository standing yet, but the author demonstrably runs the target workflow (2× DGX Spark, GLM-5.3 TP2, b12x) and writes evidence-rich reports elsewhere — which makes the absence of any hardware number or issue link in #675 a contrast, not an inability. Discord: "no username provided". - Area ownership (last 180 days): ignition/preparation — Luke Alonso 161, Martin Vit 52, Eugene Rakhmatulin 36; ignition/cli — Luke Alonso 83, Martin Vit 25, jasonc 14; tests/preparation — Luke Alonso 207, Martin Vit 34, jasonc 23. Luke Alonso authored #667 (merge base) and the overlapping #668, so he is both the natural reviewer and the person whose in-flight work conflicts.
- Rendezvous lineage: jasonc (
858f72d8"Serve GLM from ranks on separate DGX Sparks through a rank-zero rendezvous", 2026-10-12;b754f645per-host rank export), extended by yatesdr (#369 RoCE GID per host, #198 peer failure reporting) and 0z5a (#198). - Engagement so far on #675: none.
Community
- #675: read_item shows Discussion (0) — no comments, no reviews, no inline comments, no labels, no reactions, no reviewers requested; opened and last updated at 2026-12-02 10:50. No flare-autobot intake or review, whereas #668 got a case file at 22:28 and a full Changes-Requested review at 22:47 the evening before.
- The community interest that exists lives on the sibling: nepenth's "Strong +1 from hardware testing on 2× GB10 (SM121) multi-host TP2 with GLM-5.3-Flash-FP4-Local (v0.5.0)" comment on #668. A reviewer of #675 would want exactly that data and cannot find it from #675.
Project fit
- Lines up with the documented design rule at docs/cli-design.md:46-51: "No environment variables. Flare reads none … Variables that underlying libraries read are set by Flare from its own configuration, and b12x's from the recipe's declared settings, before those libraries are imported." Rank zero already obeys it (serve.py:211/438); the PR brings peers into line. It also fits charter lines 21-22 (prepare supported model recipes with Ignition; single-host and cross-node serving) and adds no per-model branch (charter line 12).
- Does not line up with the documentation practice: docs/cli-design.md:69 and docs/multi-host.md:330-400 document
export --ranks+joinbut never mention that recipeB12X_*settings had to be exported manually per peer host — the documented workflow silently omitted the requirement this PR removes, and the PR does not record that it is now handled. #668's autobot review raised exactly this nit ("Consider a short note that rank zero now propagates recipe.b12x_environment and each peer uses its own local kernel_cache"). - Tension to note:
environment.py:47setsB12X_COMPILE_CACHE_DIR = kernel_cache/"b12x"and :51 lets the recipe map override it; #675's validator permits that key (host_ranks.py:202), #668's rejects it. And charter line 42 (check every supported multi-host setup) is only partially served, since peers still inherit rank zero's absoluteconfig.kernel_cache(host_ranks.py:486, rank_group.py:110) and no live multi-host CUDA run was done on this commit.
Claims and evidence
| Claim | Backing |
|---|---|
"195 passed, 0 failed" on pytest tests/cli tests/preparation/test_host_ranks.py tests/preparation/test_checkpoint_source.py (not opened), Linux aarch64 |
Self-reported only. "CI on the head commit: no checks"; the repo's only Python workflow is .github/workflows/python-cpu.yml (not opened) (pytest tests/ -q, ubuntu-24.04, CUDA_VISIBLE_DEVICES=""), which did not run for this PR. Not reproduced here (read-only research). The number is plausible in shape (tests/cli ≈136 per #668, test_host_ranks 44 pre-existing + 7 new, plus test_checkpoint_source). |
Peers receive and apply recipe B12X_* before b12x import |
Verified by reading the wire path (host_ranks.py:291-292 → :609-623 → serve.py:548-555 → environment.py:36-74 → runtime_patches/init.py:106-119). Tests exercise it over real loopback TCP. |
Ordering of environment.apply before runtime_patches.apply() |
Asserted via monkeypatched ignition.runtime_patches.apply (test_host_ranks.py:405-451), so it proves ordering inside environment.apply, not that the real b12x.preparation import observes the variable. No test exercises the real chain. |
| "Matching rank zero's ordering" | Holds for the peer prepare: rank zero applies at serve.py:211/:438 before prepare; peers at :551 before serve_peer (:556), whose import torch.distributed happens inside at host_ranks.py:667 and whose real b12x work starts at :683/:686 — no early-import hazard. Host.discover (planning.py:56-91) imports NVML/driver, not torch, and source_identity() deliberately avoids importing flashinfer (source_identity.py:38), so moving them ahead of environment.apply is safe. |
"Reordered to compute source_identity() … before knock" |
Inaccurate — already true on main (main serve.py:546-548). Only environment.apply moved. |
| "Live multi-host CUDA export not re-executed" | Honestly disclosed, consistent with AGENTS.md:302 (FLARE_RUN_TP_CUDA_TESTS=1 gates GPU tests). Nothing hidden. |
| Unclaimed: kernel_cache parity | Not addressed. #668 fixes it; #675 leaves rank zero's absolute path flowing through the pickled config. |
Reach
- Operators of
ignition export --ranks N+ignition joinand multi-hostignition debug-serve --ranks N(docs/multi-host.md:330-400) — previously had to exportB12X_*by hand on every peer; now the recipe is authoritative, with no new CLI flag or config key (verified: no CLI/config change in the diff). - Configuration/defaults: none changed for single-host;
Recipe.b12x_environmentunchanged in shape (declaration.py:231) and is a staticRecipefield, not aRecipeParameter, soserve.pycan read it beforeplan(…). - Compatibility: additive control-channel JSON key,
PROTOCOLunchanged at 5. Old peer against new rank zero still silently prepares without the recipe env (oldknockignores the key), so mixed-version pairs gain nothing — though mixed checkouts are independently rejected bysource_identity(source_identity.py:94-95; reject at host_ranks.py:286-287). Anyone already exporting the variables manually is unaffected (recipe values are spread over the env dict, environment.py:51). - API:
knock()→ 3-tuple (host_ranks.py:623) is a breaking change for out-of-tree library consumers; in-repo call sites are all consistent. - Deployment/dependencies: no new dependency; peers must run the same checkout anyway (source identity), so no rollout ordering problem. Helios/Rust untouched.
- Docs: none updated; the multi-host guide is silent both about the old manual requirement and the new automatic behaviour.
Process
Open, description marks it ready for review; base main, head 92b977d; +194/−11, 3 files; opened and last updated 2026-12-02 10:50; no labels, no reviews, no discussion, no CI checks on head; mergeable against current main (no intervening commits on the changed files). Repo hooks that apply: CONTRIBUTING.md:9,19 requires DCO sign-off (whether 92b977d carries a Signed-off-by trailer could not be verified in this case file); AGENTS.md:165-169 requires a demonstrated defect or maintainer request (satisfied in substance via #651/#668, not cited); AGENTS.md:294-306 documents the CPU command used and requires unrun tests to be declared (the CUDA path was). The only merge conflict risk is with open #668, marginally #394/#671/#475/#560/#533.
Open questions / not found
- Why the PR cites neither #651 nor #668 — unknown; no discussion on #675 to explain.
- Whether #675 or #668 is intended to land: #668 is the maintainer's, is hardware-verified, has labels and a review, and covers
kernel_cachetoo; #675 is smaller (+194/−11 vs +423/−44) and applies the env earlier (beforeserve_peer, not inside it). No stated preference anywhere. - Whether
92b977dis DCO-signed — could not be verified here. - Whether
B12X_COMPILE_CACHE_DIRis actually absent from every recipe today (taken from #668's review, not re-verified across all recipes). - No live multi-host CUDA evidence for #675 at all; nothing found measuring the fix on real hardware.
- No documentation, roadmap entry or charter line that specifically mandates peer env propagation beyond cli-design.md:46-51.