Recommendation: Changes Requested
The Round 1 blockers around repository-split hygiene, FLAREIMG\x01 backward compatibility, value-checked window-plan cache validation, and removing image_preparation dispatch from packing.rs are cleanly resolved, and the shared resize::Filter and patch_merge::bracketed_prompt refactors preserve existing profiles. However, the new Windowed packing path introduced a concrete contract mismatch between tensor_layout (per-graph graph.token_capacity / 64 + 2) and packing::windowed (hardcoded global patch_capacities.last() / 64 + 2) that breaks non-maximal Vision graphs bound to their declared capacity, and the new Vision graph inputs (vision_cu_window_seqlens, vision_reverse_index) plus ImageLayoutKind::Windowed = 11 require explicit project-owner confirmation under AGENTS.md:376-381. In addition, the diff carries 160 unrelated lines in docs/TODO.txt, a dead template patch fixture that triggers an unused Hugging Face download, and an active wire tag-11 collision with open PR #483.
Merge Risk
Level: Medium
- Vision packing hot path (
helios/src/frontend/images/packing.rs,helios/src/model/packing.rs):packing::windowedpadsvision_cu_window_seqlenstopatch_capacities.last() / 64 + 2whileInputs::newvalidates each Vision graph againstgraph.token_capacity / 64 + 2; any multi-capacityWindowedcore with per-capacity buffers fails atInputs::pack_visionon every non-maximal graph. - Shared image pipeline (
resize.rs,patch_merge.rs,record.rs,conditioned.rs): Touches every existing image profile's resampling wrapper, bracketed prompt expansion, and binary cache codec. Direct verification confirmsFilter::Cubic/Filter::Linear,bracketed_prompt, andFLAREIMG\x01decoding are behavior-preserving, with zero added locks/queues/shared mutable state and zero heap overhead on non-MuseGlimmer cache hits. - Wire & cross-PR compatibility (
runtime_core.proto,contract.rs): Additive enum/oneof tags (11) preserve existing cores and fail explicitly on older engines, butImagePreparationKind = 11andImageSettings.profile = 11collide with open PR #483 (Gemma4).
Walkthrough
- Wire protocol & contract enums (
helios/proto/runtime_core.proto:487,501,624-636,helios/src/model/contract.rs:69-70,helios/src/runtime_core/{describe,protobuf}.rs,ignition/preparation/runtime_core_pb2.py): AddsMUSE_GLIMMER_IMAGE_PREPARATION = 11,WINDOWED_IMAGE_LAYOUT = 11, andMuseGlimmerImageSettings(oneof tag11), regeneratesruntime_core_pb2.py(7.36.1), and adds wire round-trip tests. - Shared image helpers (
helios/src/frontend/images/resize.rs,patch_merge.rs): Replaces thelinear: boolparameter withenum Filter { Cubic, Linear, Lanczos }, adds antialiased Lanczos-3 resampling (resize::lanczos), and extractspatch_merge::bracketed_prompt. - Native Muse Glimmer processor (
helios/src/frontend/images/muse_glimmer.rs,mod.rs, six profile files): Implementssmart_resizeat factor 28 with CPython set-order tie breaking, Lanczos resize,[0.5; 3]normalization, 32×32 window-ordered(temporal, channel, y, x)patch packing, four-tap bilinear position weights/indices, and purewindow_plan(geometry); initializes empty window vectors in existingProcessedImagesliterals. - Windowed layout routing & staging (
helios/src/model/prompt.rs:56-58,helios/src/frontend/images/packing.rs:34,56,65,70-71,108,559-602): RoutesImageLayoutKind::Windowedtolayouts::bracketed::prepare_inputand keys all packing andtensor_layoutarms onImageLayoutKind::Windowedwithout readingimage_preparation. - Cache serialization & validation (
helios/src/frontend/images/record.rs,conditioned.rs): WritesFLAREIMG\x02with window vectors while continuing to decodeFLAREIMG\x01with empty zero-capacity window vectors and strict trailing-byte checks; validates cachedcu_window_seqlensandreverse_indexby exact value againstmuse_glimmer::window_planand removes the wildcard match arm invalid_processed. - Ignition validation & misc (
ignition/preparation/frontend.py:151-166,helios/tests/fixtures/templates/muse_glimmer_nvfp4/chat_template.patch.json,docs/TODO.txt:357-515): Adds the"muse_glimmer"config-validation arm inimage_settings, plus an unreferenced template patch file and 160 lines of unrelated repo-wide skip/ignored test entries indocs/TODO.txt.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure arithmetic, bounded binary decoding (
Reader::countchecks remaining length beforeVec::with_capacity, verified inrecord.rs:216-222andconditioned.rs:985-996), no unsafe code, no untrusted shell/network calls on serving paths. - [WARN] Charter & value fit: Core runtime scope is clean post-split, but two governance gates remain open: owner sign-off on the
GraphKind::Visionoperation contract extension (AGENTS.md:376-381) and a maintainer ruling on the #74 single-checkpoint exception (original-el8/Muse-Glimmer-30B-NVFP4only);docs/TODO.txt:357-515also violatesAGENTS.md:512-520. - [WARN] Related / duplicate / conflict check:
ImagePreparationKind = 11andImageSettings.profile = 11collide with open PR #483 (Gemma 4, no blockers at last review); alias collision with #192 moved tohyperflare-recipes#109(muse-glimmer-30b-w4a4). - [WARN] Tests & verification evidence: CPU Rust (
1,810passed) and Python (1,157passed) suites are reported clean, andmuse_glimmer.rs:359-563has strong offline parity tests, but the newpacking.rs:681test checks only max capacity (16384) and misses Blocker #1; the reported SM120 GPU run used earlier commit08b3134a8(base0a8c20f44), and no multi-capacityWindowedsubmission is tested end-to-end.
Blockers
-
packing::windowedpadsvision_cu_window_seqlensto global max capacity whiletensor_layoutbinds per-graph capacity (helios/src/frontend/images/packing.rs:70,563,581-583,helios/src/model/packing.rs:82-91,339-347,374-380).- Verified behavior & impact: At core load,
Inputs::new(helios/src/model/packing.rs:82-91) validates everyValueSource::ImageTensorbuffer againsttensor_layout(layout, &binding.tensor, graph.token_capacity). ForImageLayoutKind::Windowed,tensor_layout(helios/src/frontend/images/packing.rs:70) declares(Int32, patches / 64 + 2)— so a Vision graph captured attoken_capacity = 1024validly binds an 18-element (72 B)vision_cu_window_seqlensbuffer. At submission,scheduler/policy.rs:974,1086-1088legitimately picks the smallest fitting capacity (1024),Inputs::pack_vision(model/packing.rs:339-347) resolves that1024graph and callspacking::prepare(...)without passingstep.token_capacity, andpacking::windowed(packing.rs:563,581-583) unconditionally padscu_windowtopatch_capacities.last() / 64 + 2(e.g.16384 / 64 + 2 = 258i32s =1,032 B).Inputs::pack_vision(model/packing.rs:374-380) then deterministically rejects every non-maximal Vision graph withErr("image tensor exceeds prepared graph capacity"). Even if a recipe avoids this by sharing one max-capacity buffer across all Vision graphs,tensor_layoutandwindowedstill contradict each other on the contract extent. The unit test atpacking.rs:681missed this because it passed16384(patch_capacities.last()) totensor_layoutinstead of a non-maximal capacity (1024or4096) fromvec![1024, 4096, 16384]. - Fix: Thread the selected graph's capacity (
graph.tokens/step.token_capacityatmodel/packing.rs:339) intopacking::prepareandwindowed, checkgeometry.patches <= graph_capacity, and padcu_windowtograph_capacity / 64 + 2(since for any even grid withh * w = patches <= graph_capacity,ceil(h/32) * ceil(w/32) + 1 <= patches / 64 + 2 <= graph_capacity / 64 + 2, this never truncates). Alternatively, if smaller-capacity captured Vision graphs actually read the entire max-capacity buffer, updatetensor_layout/Inputs::newto validate againstpatch_capacities.last()rather thangraph.token_capacity. Add a test coveringprepare(andInputs::pack_visionortensor_layout) at a non-maximal capacity (e.g.,1024and4096invec![1024, 4096, 16384]), and re-verify a multimodal PNG request on a multi-capacity core after the fix.
- Verified behavior & impact: At core load,
-
Unapproved captured-graph operation contract change on
GraphKind::Vision(helios/src/frontend/images/packing.rs:70-71,597-598,helios/proto/runtime_core.proto:501,AGENTS.md:376-381).- Verified behavior & impact: Directly answering the author's question: while
vision_cu_window_seqlensandvision_reverse_indexreuseValueSource::ImageTensoron the existingGraphKind::Vision(ignition/preparation/contract.py:180-184),AGENTS.md:376-381anddocs/design-review.md:22-26state that "A new operation contract requires approval even if it reuses an existing graph kind or enum value" from project owner Luke Alonso (@lukealonso), and#566followed this process by requesting explicit sign-off (#535). AddingImageLayoutKind::Windowed = 11and two new Vision graph inputs changes whatGraphKind::Visionconsumes. - Fix: Obtain explicit sign-off from
@lukealonso(either approvingImageLayoutKind::Windowed = 11+vision_cu_window_seqlens/vision_reverse_index, or confirming thatImageLayoutKindextensions overValueSource::ImageTensorare exempt from the clause) before merge.
- Verified behavior & impact: Directly answering the author's question: while
Should Fix
-
Remove unrelated repo-wide test inventory from
docs/TODO.txt:357-515(+160 lines) and dead fixturehelios/tests/fixtures/templates/muse_glimmer_nvfp4/chat_template.patch.json(+13 lines).docs/TODO.txt:357-515adds ~80 mechanical entries listing every skipped Python test and#[ignore]Rust test across unrelated subsystems (CUDA scratch, Engram, GLM, DeepSeek, Qwen, Nemotron, Gemma 4), duplicating source#[ignore]strings and violatingAGENTS.md:512-520("Do not create development audit reports, receipts, provenance bundles, or hash inventories"; keepdocs/TODO.txtbrief and durable).helios/tests/fixtures/templates/muse_glimmer_nvfp4/chat_template.patch.jsonhas zero readers anywhere inhelios/tests/(helios/tests/support/templates.rs:8), yettests/frontend/prepare_templates.py:43globs*/*.patch.json(not opened) and will fetchoriginal-el8/Muse-Glimmer-30B-NVFP4:chat_template.jinjafrom Hugging Face on every template-preparation run.- Fix: Revert the
docs/TODO.txthunk and deletehelios/tests/fixtures/templates/muse_glimmer_nvfp4/chat_template.patch.jsonuntil a test consumes it.
-
Resolve the wire tag-11 collision with open PR #483 (
helios/proto/runtime_core.proto:487,624,helios/src/model/contract.rs:69).- Open PR #483 (Gemma 4 image preparation, no blockers at last review) claims
ImagePreparationKind = 11andImageSettings.profile = 11, colliding withMUSE_GLIMMER_IMAGE_PREPARATION = 11andImageSettings.muse_glimmer = 11(note: #483 reusesBracketed = 9and does not claimImageLayoutKind = 11). - Fix: Coordinate merge order with #483; whichever lands second must renumber its
ImagePreparationKindandImageSettings.profiletags to12and regenerateruntime_core_pb2.pybefore exporting cores.
- Open PR #483 (Gemma 4 image preparation, no blockers at last review) claims
-
Validate tokenizer token-ID agreement in
ignition/preparation/frontend.py:151-166and record a maintainer ruling on the #74 single-checkpoint exception.frontend.py:160assertsmodel["image_token_id"] == 200092andvideo_token_id == 200091, while lines164-166emit literal strings"<|patch|>","<|image_start|>","<|image_end|>"and literalmax_image_tokens=4096(instead ofimage["max_image_tokens"]) without checking that the checkpoint tokenizer encodes"<|patch|>"tomodel["image_token_id"](unlike_native_image_placeholderatfrontend.py:222-236). If a checkpoint tokenizer disagrees,bracketed_promptexpands to the tokenizer's ID whileVisionStateinjects onimage_token_id, silently failing to inject image features.- Fix: Verify the three envelope markers encode as single tokens in the checkpoint tokenizer and that
image_tokenmatchesmodel["image_token_id"](and readmax_image_tokens=image["max_image_tokens"]). Also confirm with a maintainer that the single-checkpoint exception under #74 is granted givennvidia/Muse-Glimmer-30B-NVFP4's incompatible mixed FP8/W4A16 layout.
Subtract / Simplify
- Drop fixed-value wire fields from
MuseGlimmerImageSettings(helios/proto/runtime_core.proto:627-636,helios/src/frontend/images/mod.rs:384-393,muse_glimmer.rs:27-63,runtime_core/{describe,protobuf}.rs,ignition/preparation/frontend.py:164-166):muse_glimmer::Processor::load(muse_glimmer.rs:39-40) rejects anypatch_size != 14ormerge_size != 2, whileWINDOW = 32andTABLE_SIDE = 32are already module constants (muse_glimmer.rs:20-22). Replacingpatch_sizeandmerge_sizewithconst PATCH: usize = 14; const MERGE: usize = 2;shrinks the wire message before tags freeze (max_image_tokens,image_mean,image_std, and the envelope token strings are the fields that can legitimately vary). - Merge identical match arms in
helios/src/model/prompt.rs:53-58: CollapseSome(ImageLayoutKind::Bracketed)andSome(ImageLayoutKind::Windowed)intoSome(ImageLayoutKind::Bracketed | ImageLayoutKind::Windowed) => crate::frontend::images::layouts::bracketed::prepare_input(frontend, processor, rendered, &images)?,. - Avoid push-then-clear in
ProcessedImages::append(helios/src/frontend/images/record.rs:27-40): Guard onif !images.cu_window_seqlens.is_empty()withlet window_offset = self.cu_window_seqlens.last().copied().unwrap_or(0);instead of pushing0, extending nothing, and clearing onlen() == 1.
Nits
helios/src/frontend/images/muse_glimmer.rs:565-570:native_pixels_match_canonical_transformers_processorsilently returns when../.venv/bin/pythonis absent; while this matches existingpatch_merge.rs:170-175, marking it#[ignore = "requires ../.venv/bin/python with transformers"]makes skipped runs explicit incargo testoutput.helios/src/frontend/images/conditioned.rs:215-221:valid_processedallocates a freshwindow_plan(&self.geometry)(~130 KiB at 16,384 patches) on everymaterialize_cachedhit for MuseGlimmer; becausematerialize_cachedruns on the backgroundImagePreparationthread (server/runtime.rs:1690-1728), this does not block the scheduler loop, though streaming/in-place comparison would eliminate the allocation.- PR description: Note that
FLAREIMG\x02cache compatibility is one-way forward (older Helios engines rejectFLAREIMG\x02records and cleanly recompute viamaterialize_cached).
Dropped on verification
- Correctness lens B2 (claim that
helios/src/server/config.rs:451proves the served core declared only one vision capacity): Dropped —server/config.rs:451is inside#[cfg(test)] mod tests::image_limits_follow_graph_and_feature_storage_capacities, not production core loading; the companion recipe's actual capacity catalog is outside this repository. - Correctness lens B3 (Major defect for not hardcoding a
Windowed <-> MuseGlimmerenum pairing check incontract.rs:554-558): Dropped —contract.rs:554-558intentionally validates only presence across all 11 existing layouts (ClassToken,Step,Radio,Qwen, etc.), and hardcoding an enum-pair allowlist would run counter toAGENTS.md:358-364's enum-independence rule (a load-time capability check onImageProcessorinserver/config.rswould be the orthogonal pattern if fail-fast is desired). - Correctness lens B6a (Major claim that
muse_glimmer.rshas no offline parity coverage becausenative_pixels_match_canonical_transformers_processorreturns early): Downgraded to Nit —muse_glimmer.rs:359-563contains five unconditional offline tests covering 40GEOMETRYcases, 20TIEScases, ragged-grid windowing, 9 exact Transformers interpolation-tap vectors, and 3 exact torchvision Lanczos byte arrays, and the early-return pattern matchespatch_merge.rs:170-175onmain. - Subtraction lens #3 (replacing
packing::windowed's body withlet mut staging = bracketed(...)): Dropped —packing::bracketedemits"vision_num_features"(packing.rs:492), whichImageLayoutKind::Windowedexplicitly omits (packing.rs:41-49,672-676,685), so callingbracketed()directly would breakpacking.rs:672-676. - Subtraction lens #5a–b (trimming
conditioned.rs:420-437coveredarray and:601-608width assertion): Dropped — replacing thecoveredarray withassert_eq!(settings.len(), 11)+ discarding the match would weaken coverage by failing to catch duplicate variants, and the author already declined trimming these carried test guards in Round 2. - Value Proposition / Discovery Dossier (missing
docs/api.mdsampling row): Dropped —docs/api.md:786-800documents recipes, and the Muse Glimmer recipe moved out of this repository intolocal-inference-lab/hyperflare-recipes#109. - Discovery Dossier (claims that tag-11 clash with #483 doubled to layout 11, that
runtime_core_pb2.pyused protoc 35.1, and thatresize.rs/patch_merge.rsrefactors were undeclared): Dropped as imprecise/stale — #483 does not claimImageLayoutKind = 11,ignition/preparation/runtime_core_pb2.py:5is generated with7.36.1, and the current PR description documents both shared refactors. - Subtraction lens #6b (asking for justification of
cpython_set_orderatmuse_glimmer.rs:277-314): Dropped — already documented inmuse_glimmer.rs:277-280and addressed by the author in Round 2 (SF4).