Simplicity scratchpad · NVIDIA/hyperflare-inference #502

Raw Markdown for agents: https://autobot.eidonix.com/p/c05596ba-bae9-4ff4-afd8-ff19ba6e6768.md

#1 [high] [should fix] flare-cli/orbit/gpu.rs keeps a second device table — delete it

Files: flare-cli/src/orbit/gpu.rs:309-324 (fn platform), new arm 319-321; helios/src/core/naming.rs:17-20 doc comment, 25-27 GB206_DEVICES, 53-55 new branch.

Evidence from code:

Smaller version: delete platform() and write

fn revision(pci_device_id: u32, major: c_int, minor: c_int) -> String {
    naming::platform_from_pci(pci_device_id)
        .map(str::to_owned)
        .unwrap_or_else(|| capability_revision(major, minor))
}

(plus use flare_helios::core::naming;), deleting ~16 lines and the duplicated ids.

Caveat worth flagging: deleting the copy alone changes GA102 hosts from sm86 to ga102 while a core's requirement still comes from capability_revision (orbit/controller.rs:2294), and gb206 cores (compute capability 12.0 → gb202 at gpu.rs:227) can never satisfy a gb206 host today (plan.rs:693-696 compares strings exactly). Both are fixed by also taking the core's revision from the signed hardware identity, which is what #469 does.

#3 [high] [blocking] PLATFORMS + 1 breaks flare/src/catalog.rs:561-567 (flare suite red)

File: flare/src/catalog.rs:548-569, test published_build_match_uses_all_platform_branches (fixture 561-563, asserts 566-567). Not in the diff, but broken by this PR.

Mechanism: the test loops for target in PLATFORMS and, per target, applies a hardcoded four-branch fixture ga102-tp1, gb10-tp1, gb202, gb300-tp8, then asserts entry.build_target_match == Some(true). apply_refs (catalog.rs:304-329) sets build_target_match = Some(platforms.contains(target)). With "gb206" added to PLATFORMS (helios/src/core/naming.rs:15), target = "gb206" yields Some(false) and the assert panics.

Why it is not caught by the author's evidence: the PR description records only cargo test --manifest-path helios and --manifest-path flare-cli; flare/Cargo.toml was not run. AGENTS.md:309-320 lists cargo test --locked --release --manifest-path flare/Cargo.toml as a CI command in .github/workflows/native-serving.yml.

Same defect was a blocker in #469's review (flare/src/catalog.rs:561-563 hardcodes a four-platform fixture inside a loop over PLATFORMS), and #300 hand-edited this same list for ga102. The list is a second hand-maintained copy of PLATFORMS.

Fix (removes the copy instead of growing it):

let refs = serde_json::from_value(json!({"branches": PLATFORMS
    .map(|platform| json!({"name": format!("{platform}-tp1")}))})).unwrap();

inside the loop, then the asserts hold for every current and future platform and no PR has to edit this fixture again.

#5 [high] [should fix] Orbit cannot place a gb206 core even after this PR

Consequence of the second table (entry 1) and the core-side lookup:

#9 [high] Research summary

Reviewed PR #502 (gb206 platform support, 2 files, +18/−1) through the simplicity lens. Read the charter, AGENTS.md, docs/design-review.md, docs/cli-design.md, docs/core-format-design.md, docs/orbit.md, CONTRIBUTING, the repo-prose skill, all callers of PLATFORMS/platform_from_pci, and the two prior platform PRs (#300, #469).

Findings (all on the scratchpad, entries 1-8):

  1. Blocking — flare/src/catalog.rs:561-567 goes red. published_build_match_uses_all_platform_branches loops over PLATFORMS and, per target, asserts build_target_match == Some(true) against a hardcoded four-branch fixture (ga102-tp1, gb10-tp1, gb202, gb300-tp8). Adding gb206 to PLATFORMS (naming.rs:15) makes the gb206 iteration assert Some(false) == Some(true). This is .github/workflows/native-serving.yml:77 (not opened), and the PR's evidence runs only the helios and flare-cli manifests. Smaller version: build the fixture from PLATFORMS inside the loop, which deletes the second hand-maintained platform list (#300 and #469 both had to edit it).

  2. Should fix — the PR adds to a table the tree says must not be duplicated. flare-cli/src/orbit/gpu.rs:309-324 keeps a private device table, and the new arm at 319-321 duplicates all nine gb206 ids. naming.rs:17-20 says "do not duplicate the identifiers elsewhere", and flare/src/hardware.rs:18-21 already shows the smaller shape (delegate to platform_from_pci). The copy has drifted: one of five gb10 ids, an extra 0x2bbc, no ga102, no gb300. Fix: platform_from_pci(pci_device_id).map(str::to_owned).unwrap_or_else(|| capability_revision(major, minor)), deleting ~16 lines. This also removes the arm-for-arm duplicate of capability_revision (gpu.rs:301-306 vs 224-231).

  3. Should fix — the new test cannot fail on a wrong device id. naming.rs:203-209 loops over GB206_DEVICES and asserts the mapping of that same constant, so any typo in the nine ids passes; the untested-id limitation is real. Replacing it with a literal array equality plus one mapping call is two lines instead of seven and actually pins the ids (same point yatesdr made on #221). The three near-identical loops in that test can collapse to one.

  4. Should fix — Orbit still cannot place a gb206 core. describe takes the required revision from compute capability (controller.rs:2293-2295, (12,0)→gb202), and plan.rs:695 compares strings exactly, so a gb206-signed core fails with "is gb206, not gb202". The new flare-cli arm therefore only affects display and hub-revision inference; the description should say so or the two halves must land together (cf. #469).

  5. Nits — nine prose/help enumerations of the platform set still list four names (cli.rs:175, gpu.rs:38/222, plan.rs:38, three docs); recommend naming PLATFORMS once. Plus a missing space at naming.rs:15 and a missing semicolon at naming.rs:54. The PR description's "32 MB L2 cache" and the 128-bit bus/16 GB details are unused by any code path and unsupported by the stated evidence.

No CUDA/kernel code is touched. Nothing outside this lens was asserted as a finding.

#2 [medium] [nit] duplicated capability match inside orbit/gpu.rs revision()

flare-cli/src/orbit/gpu.rs:222-231 capability_revision and gpu.rs:301-306 (inside revision) are the same match: (12,1)→gb10, (12,0)→gb202, (10,3)→gb300, _ → sm{major}{minor}. Six duplicated lines; both are stale enumerations (gpu.rs:38, :222-223 doc comments still list gb10/gb202/gb300 only, so gb206 is missing there too, as are plan.rs:38 and flare-cli/src/cli.rs:175).

Fix: revision = platform(...).map(...).unwrap_or_else(|| capability_revision(major, minor)), keeping one match; then the doc comment can point at PLATFORMS instead of re-listing names.

#4 [medium] [should fix] GB206 test loop cannot fail on a wrong device id

helios/src/core/naming.rs:186-216 (pci_ids_select_the_platform_identifier). New loop 203-209 asserts platform_from_pci(device << 16 | 0x10de) == Some("gb206") for device in GB206_DEVICES, i.e. over the same constant the function reads.

Proves: the function reaches the GB206 branch and that no earlier table (GB10/GB300/GA102) shadows these ids. Does not prove: that the nine ids are the right ids — the actual claim, whose only source is pci.ids and which the description lists as untested for eight of them. A mistyped id (e.g. 0x2d06) passes the loop. Also negative cases: no gb206 id is asserted as not-gb202, and no None case covers a GB206-adjacent id that should stay unknown.

Smaller and stronger (the pattern yatesdr asked for in #221 and #469's review): assert the table itself once, then one mapping call.

assert_eq!(GB206_DEVICES, [0x2d04, 0x2d05, 0x2d18, 0x2d19, 0x2d30, 0x2d39, 0x2d58, 0x2d59, 0x2d79]);
assert_eq!(platform_from_pci(0x2d04_10de), Some("gb206"));

That is 2 lines instead of 7, and a wrong id now fails.

Related: the same file already carries three near-identical 7-line loops (GB202 196-202, GB206 203-209, GA102 210-216). One loop over [(GB202_DEVICES, "gb202"), (GB206_DEVICES, "gb206"), (GA102_DEVICES, "ga102")] replaces all three, so the next platform adds a tuple rather than another loop. Nit.

#6 [medium] [nit] nine hand-copied platform enumerations, all missing gb206

The platform set is written out in prose/help in nine places that still list four names (no gb206, and several also omit ga102 / sm{major}{minor}):

Each PR of this kind (#300 ga102, #469 gb203, this one gb206) has to find and edit all of them; #469 found them stale and fixed them, this one did not.

Smaller version: in these places name the source instead of copying the list ("detected platform from the shared PLATFORMS table", "one of naming::PLATFORMS"), keeping the enumeration only in helios/src/core/naming.rs:15 where the type makes a change a compile error. If the enumeration stays, add gb206 to all nine now.

Related format defects in the two changed files (nit): naming.rs:15 "gb202","gb206" missing the space after the comma (rustfmt: cargo fmt would fix; no fmt check runs in CI, .github/workflows/* only runs tests), and naming.rs:53-55 return Some("gb206") lacks the semicolon every sibling return in the function has.

#8 [medium] Rule citations for the report

Rules to cite in the report:

#10 [medium] [nit] description's hardware rationale is not used by any code path

PR #502's "why" and "claimed benefit" rest on GB206 having different cache sizes from GB202 (32 MB L2, 128-bit bus, up to 16 GB VRAM) and on "cleanly separating GB206 cores from gb202 cores".

Checked in code: no per-platform L2 size, bus width or VRAM figure is read anywhere. PLATFORMS (helios/src/core/naming.rs:15) is used only for name acceptance (naming.rs:77, :119; flare/src/hub.rs:2473, :2490, :2963, :3115; flare/src/catalog.rs:271-279, :320; flare-cli/src/distribution.rs:159, :720; heliopause/src/export/conversion.rs:402), and the device tables feed only platform_from_pci -> a label. Ladders and kernel selection are chosen by flags/recipe, not by platform name (ignition/preparation/ladders/README.md uses explicit --collective-ladder files).

So the only supported justification is the name itself: a GB206 host gets a gb206 revision rather than gb202, which keeps GB206 cores out of GB202 repositories. Prose fix per the repo-prose skill ("State the substantive fact … claims beyond the stated evidence"): drop the cache-size/bus/VRAM sentence or mark it as context that no code consumes, and state the crash/refusal being fixed (NVML unsupported-PCI-id errors in heliopause/src/export/capture.rs:2079-2085 and flare/src/hardware.rs:95-100) as the actual defect.

Also worth stating in the description: adding gb206 to PLATFORMS makes flare run ORG/MODEL on a GB206 host request a gb206 (then gb206-tp1) hub revision that no repository publishes yet — same merge-order caveat raised for #469.

#11 [medium] Checked and clean: no other code needs a gb206 arm

Verified in code while reviewing #502, no change needed:

Not verifiable without hardware/tests: whether the nine ids from pci.ids are the complete GB206 set (only 0x2d04 was exercised), and whether a gb206 hub revision will be published.

#7 [low] [aside] PLATFORMS widening changes the default hub request

Widening PLATFORMS also changes the default hub request on a GB206 host: flare run ORG/MODEL detects gb206 (flare/src/hardware.rs:18-21 via naming.rs:53-55) and flare/src/hub.rs:3104-3129 retries <revision>-tp1 on 404 (gb206-tp1) because the name starts with gb and is in PLATFORMS, then fails with a missing-revision error. Before this PR the same host failed earlier with "unsupported PCI ID … specify --revision" (hardware.rs:95-100). Same consequence #469's review raised as a should-fix (merge order / --revision gb202 override). Not my lens (scope/behaviour), recorded for the summary only.

Also: PLATFORMS is [&str; 5] (naming.rs:15), so every platform addition edits the length literal too; a &'static [&'static str] would remove that, at the cost of small *target edits in flare/src/catalog.rs:271-279 and :550-551. Not worth doing in this PR.