Conventions scratchpad · NVIDIA/hyperflare-inference #469

Raw Markdown for agents: https://autobot.eidonix.com/p/10c03669-559b-4385-88f1-3da25615561a.md

#1 [high] should fix: capability_revision is a second, now-disagreeing copy of the platform table; orbit cannot place a gb203 core on a gb203 GPU

LENS C (duplication). The PR removes the PCI table copy in flare-cli/src/orbit/gpu.rs (platform(), deleted) but leaves a second copy of the platform mapping in the same file, now inconsistent with it.

flare-cli/src/orbit/gpu.rs:222-231 (unchanged by the PR):

pub fn capability_revision(major: i32, minor: i32) -> String {
    match (major, minor) {
        (12, 1) => "gb10".into(),
        (12, 0) => "gb202".into(),
        (10, 3) => "gb300".into(),
        _ => format!("sm{major}{minor}"),
    }
}

Two consumers:

  1. flare-cli/src/orbit/gpu.rs:297-307 revision() — now consults platform_from_pci first, so a 0x2c31 GPU reports gb203.
  2. flare-cli/src/orbit/controller.rs:2294 describe() — revision: super::gpu::capability_revision(first.architecture[0], first.architecture[1]) builds CoreNeeds.revision from the core's recorded compute capability.

A core prepared on GB203 records architecture [12, 0] (GB203 is SM120, capability 12.0 — this is the PR's own stated premise, naming.rs:25-30 comment). So capability_revision(12, 0) = "gb202", while the agent reports the same GPU as gb203 (gpu.rs:209, 298). plan.rs:693-696 unfit() then rejects it: gpu.revision != revision -> "gpu 0 NVIDIA RTX PRO 4500 Blackwell is gb203, not gb202".

Consequence: flare orbit run still cannot place a gb203 core on a GB203 host. For a repository core, repository_revision (controller.rs:2210-2233) correctly picks gb203 from the GPU STATUS, downloads the core, and then placement rejects every GB203 GPU. The PR fixes flare run/flare download (which go through flare/src/hardware.rs:18-21 -> platform_from_pci) but leaves the orbit path on the capability table.

Precedent for the fix already exists in the same crate: flare-cli/src/distribution.rs:157-163 derives the platform from the signed identity and only accepts it when naming::PLATFORMS contains it:

let signed = core.identity()...;
let platform = if flare_helios::core::naming::PLATFORMS.contains(&signed.hardware.as_str()) {
    signed.hardware.clone()
} else { String::new() };

hardware_identity is the export platform string (heliopause/src/export/core.rs:4209 asserts hardware_identity == "gb202"; heliopause/src/export/conversion.rs:402 gates on naming::PLATFORMS).

Fix: at controller.rs:2294, take the revision from the core's signed hardware_identity when naming::PLATFORMS contains it, and fall back to capability_revision only for cores whose identity is an architecture label such as sm120. That also removes the last need for a capability->platform table, so capability_revision can be reduced to the fallback formatter.

What would settle it: a unit test on describe() with a core whose rank architecture is [12, 0] and a GpuStatus { revision: "gb203", .. }; with the current code plan::plan returns the mismatch error. No hardware is needed.

Note the PR description claims "The CLI and export resolve one PCI id the same way because there is one table." That holds for flare run/download and for export, not for orbit placement, which uses a third resolution path.

#2 [high] blocking: flare/src/catalog.rs test breaks; #300 set the precedent of updating the fixed branch fixture

LENS C (conventions + duplication).

flare/src/catalog.rs:548-569 (unchanged by this PR):

#[test]
fn published_build_match_uses_all_platform_branches() {
    for target in flare_helios::core::naming::PLATFORMS {
        for published in flare_helios::core::naming::PLATFORMS { ... }
        let refs = serde_json::from_value(json!({"branches": [
            {"name": "ga102-tp1"}, {"name": "gb10-tp1"}, {"name": "gb202"}, {"name": "gb300-tp8"}
        ]})).unwrap();
        let mut entry = CatalogEntry::default();
        let branches = apply_refs(&mut entry, refs, Some(target));
        assert_eq!(entry.build_target_match, Some(true));
        assert_eq!(branch_platform(select_revision(&branches, Some(target)).unwrap()), Some(target));
    }
}

With gb203 added to PLATFORMS (helios/src/core/naming.rs:15) the outer loop reaches target = "gb203". apply_refs (catalog.rs:304-329) computes platforms = {ga102, gb10, gb202, gb300} and build_target_match = Some(platforms.contains("gb203")) = Some(false), so the first assert fails. If it did not, select_revision (catalog.rs:292-303) finds no gb203 branch and falls through to branches.iter().next() = "ga102-tp1" (BTreeSet order), so the second assert would fail too.

Precedent: PR #300 ("Recognize GA102 (SM86) as a platform", merged 2026-11-15) changed flare/src/catalog.rs (+1 -1) precisely to add ga102 to this fixture; its description says "the catalog platform-branch test gains a ga102 branch" and lists flare/src/catalog.rs (modified, +1 -1) among 5 changed files. PR #221's review (yatesdr, 2026-11-18) also shows maintainers expect the platform tests to be updated with the platform.

Why it was missed: the PR's evidence runs only --manifest-path helios/Cargo.toml ... naming and --manifest-path flare-cli/Cargo.toml orbit::gpu; flare's own tests, where this test lives, were not run.

Fix: add {"name": "gb203-tp1"} (or "gb203") to the branch list in that test, as #300 did for ga102, and run cargo test --manifest-path flare/Cargo.toml catalog.

#5 [high] Research summary

Four findings, all in lens C (conventions and duplication), recorded in the scratchpad. The most important are two unresolved copies of the platform mapping that the PR's own premise says cannot remain distinct.

Blocking: an existing test in flare/ fails. flare/src/catalog.rs:548-569 published_build_match_uses_all_platform_branches loops over naming::PLATFORMS but hardcodes a four-branch fixture (ga102-tp1, gb10-tp1, gb202, gb300-tp8). With gb203 in PLATFORMS, the target = "gb203" iteration computes build_target_match = Some(false) and asserts Some(true). PR #300 set the precedent by changing this exact test (+1 -1) to add ga102. The PR's evidence ran only the helios naming tests and flare-cli orbit tests, not flare's.

Should fix: capability_revision is the third copy of the mapping and now disagrees with the one the PR fixed. The PR deletes the PCI table copy in flare-cli/src/orbit/gpu.rs but leaves capability_revision (gpu.rs:224-231) mapping (12,0) to gb202. controller.rs:2294 uses it to build CoreNeeds.revision from the core's recorded architecture; GB203 is SM120, i.e. capability 12.0, so a gb203 core is labelled gb202 while the agent reports the same GPU as gb203 (gpu.rs:209/298). plan.rs:695 then rejects every GB203 GPU. Orbit placement therefore still cannot run a gb203 core, though flare run/download and export are fixed. The in-repo precedent for the fix is distribution.rs:157-163, which takes the platform from the signed hardware_identity when PLATFORMS contains it. This makes the PR's claim that "the CLI and export resolve one PCI id the same way because there is one table" true of flare run/download only, not of orbit.

Two smaller items: the clap --revision help string at flare-cli/src/cli.rs:173 still lists ga102, gb10, gb202, gb300 without gb203 (#300 changed that same line for ga102), and the docs/cli-design.md:885-886 reflow left the word "selection" alone on a line. Nits: the new naming.rs test loops GB203_DEVICES although the #221 review explicitly asked for literal id assertions (partly covered by the literal assert at gpu.rs:340), and four orbit doc comments listing the platform set (gpu.rs:38, gpu.rs:222, plan.rs:38, controller.rs:236) were not updated while docs/orbit.md:321 was. Nothing was found that requires GPU hardware to settle; every finding is checkable with cargo test on flare, flare-cli and helios.

#3 [medium] should fix: the clap --revision help text was not updated, though #300 updated it for ga102

LENS C (conventions/drift).

flare-cli/src/cli.rs:173 (unchanged):

/// Hub revision; uses the model origin when cached, otherwise detects ga102, gb10, gb202, or gb300.

This is the clap --revision help text for HubOptions (cli.rs:171-175), rendered by flare download --help / flare run --help. It omits gb203, so the CLI's own help still tells an operator on an RTX PRO 4500 the card cannot be detected, while docs/cli-design.md:921 (which this PR does update) lists gb203.

Precedent: PR #300 ("Recognize GA102 (SM86) as a platform", merged 2026-11-15, commit 333b11ec) changed flare-cli/src/cli.rs (+1 -1) to add ga102 to this exact line. Adding a platform has meant updating it.

Also docs/cli-design.md:885-886 now reads "...gb203, and gb300. Automatic\nselection\nqueries the selected GPUs' PCI..." — the reflow left selection alone on a line, an orphan word the previous single-line sentence did not have.

Fix: add gb203 to the cli.rs:173 list; reflow the cli-design.md sentence so no word stands alone.

#6 [medium] Coverage map: per-file verdict through lens C

All five changed files were read in full context (not only the diff), with callers followed.

helios/src/core/naming.rs (+18 -1). Verdict: follows the established shape exactly — GB203_DEVICES: [u32; 1] mirrors GB300_DEVICES: [u32; 1] (naming.rs:40) and GA102_DEVICES (naming.rs:37) from PR #300; the contains check inserted ahead of the other tables matches the existing chain at naming.rs:47-59; PLATFORMS widened from [&str; 4] to [&str; 5] keeps the array-length-in-type idiom. Placing gb203 before gb10 alters no existing branch, since no id is in two tables. Only nit is the looped test (see the nit note).

flare-cli/src/orbit/gpu.rs (+2 -15). Verdict: the deleted platform() was the last private copy of the PCI table; flare/src/hardware.rs:18-21 already delegated to flare_helios::core::naming::platform_from_pci with the comment "Single mapping table shared with core export naming", and heliopause/src/export/capture.rs:2079 calls it directly. So the two-line replacement at gpu.rs:298 follows the crate's own precedent for how a consumer reaches this function, and the deletion is genuine deduplication rather than churn. The PR's claim that the copy had drifted is verifiable: the deleted arms listed only 0x2e12 of the five GB10_DEVICES, and listed 0x2bbc, which GB202_DEVICES does not contain. What the file left behind is the finding in the high-importance note.

docs/cli-design.md, docs/core-format-design.md, docs/orbit.md. Verdict: the three list updates are correct and complete for the platform sets they describe; core-format-design.md:754 and cli-design.md:921 now agree with PLATFORMS. Only defect is the reflow at cli-design.md:885-886 (medium note).

Cross-check of the PR's "no other device changes label" claim: verified. 0x2bbc now reaches gb202 through the capability fallback (12.0), which flare-cli/src/orbit/gpu.rs:347 already tests with revision(0x2c0010de, 12, 0) == "gb202"; the four previously missing GB10 ids now resolve through the shared table to gb10, which is the direction the PR discloses. No finding.

Tests the PR ran cover helios naming and flare-cli orbit only; flare's and heliopause's suites were not run, which is how the blocking catalog regression survived.

#7 [medium] Lens C verdict and the two statements the report should lead with

Lens C (conventions and duplication) overall: the change is built the right way — it reuses the existing table, mirrors the existing per-die table idiom, and removes a real duplicate rather than adding a mechanism. The defects are all "the same idea still copied in one more place", which is exactly this lens: the PR consolidated the PCI table but did not finish consolidating the platform mapping, and it did not propagate the platform name to the places that enumerate platforms.

Report order and one-line summaries:

  1. blocking — flare/src/catalog.rs:548-569: published_build_match_uses_all_platform_branches fails for target = gb203 because its branch fixture is hardcoded to four platforms; fix is the +1 line #300 made for ga102.
  2. should fix — flare-cli/src/orbit/gpu.rs:224-231 + flare-cli/src/orbit/controller.rs:2294: capability_revision still maps (12,0) to gb202, so orbit labels a gb203 core gb202 and plan.rs:695 refuses every GB203 GPU; fix follows flare-cli/src/distribution.rs:157-163 (signed hardware_identity gated on PLATFORMS).
  3. should fix — flare-cli/src/cli.rs:173: --revision help omits gb203 (#300 changed this line for ga102); plus the orphan word at docs/cli-design.md:885-886.
  4. nit — helios/src/core/naming.rs:206-212 loops the table where the #221 review asked for literal ids (partly covered by the literal assert at flare-cli/src/orbit/gpu.rs:340); four orbit doc comments (gpu.rs:38, gpu.rs:222, plan.rs:38, controller.rs:236) still list the platform set without gb203 while docs/orbit.md:321 was updated.

Nothing in this lens needs GPU hardware to settle; each finding is reproducible with cargo test on flare, flare-cli, and helios.

#4 [low] nit: looped table test despite the #221 request for literal ids; and four stale platform lists in comments

LENS C (conventions).

  1. helios/src/core/naming.rs:206-212 (new):
for device in GB203_DEVICES {
    assert_eq!(
        platform_from_pci(device << 16 | 0x10de),
        Some("gb203"),
        "{device:#06x}"
    );
}

This is the pattern the PR describes as established ("as it already did for the other tables"). But a maintainer asked for the opposite on the matching table: review of PR #221 (yatesdr, 2026-11-18, CHANGES_REQUESTED), item 2: "Test the IDs themselves. The test loops over GB300_DEVICES, so it still passes if 0x31c2 is removed from the table. Assert 0x31c2 and 0x31c3 literally."

Mitigating: flare-cli/src/orbit/gpu.rs:340 does assert revision(0x2c3110de, 12, 0) literally, so the identifier is pinned somewhere. Severity nit.

  1. Doc comments listing the platform set, left stale, all in files this PR touches:

Fix: add gb203 (and ga102) to the four lists, or point them at naming::PLATFORMS.