Skip to content

Shaders: name the adapter on translate --pipelines verdicts (FIND-3) - #2456

Open
makmatvey wants to merge 2 commits into
Marvisak:mainfrom
makmatvey:cursor/shader-adapter-pipeline-verdict-d264
Open

makmatvey wants to merge 2 commits into
Marvisak:mainfrom
makmatvey:cursor/shader-adapter-pipeline-verdict-d264

Conversation

@makmatvey

Copy link
Copy Markdown
Contributor

What

FIND-3: any translate --pipelines verdict should name the adapter it was taken on. Before this, the offline host always took the first hardware adapter (or failed on CI's software-only machines), so census results collected across machines were ambiguous when a box has more than one GPU.

#1630's body once described this selector, but that PR now carries only the texture-description ladder — the offline host on main still has no VICTORY_D3D12_ADAPTER path. Distinct from #1487 (high-performance default) and #1138 (test failure labels).

Change

  • victory_shader::emit::host::Host records the DXGI adapter index and description, and honours VICTORY_D3D12_ADAPTER (decimal index or case-insensitive description substring). WARP and the default hardware pick are unchanged aside from naming.
  • translate --pipelines prints adapter <index> "<name>" once, and every pipeline created / pipeline: … line (including VICTORY_PAIRS) appends on <index> "<name>".
  • README documents the variable.
  • Unit tests cover the selector matching rules (no GPU needed).

Tests

  • cargo test -p xtask --locked repository_passes_policy — pass
  • Selector unit tests live under emit::host::adapter_selector_tests (Windows CI / cargo test -p victory-shader --lib)
  • Clippy and the full workspace suite run on Windows CI for this PR

No game data used.

FIND-3: VICTORY_D3D12_ADAPTER (index or description substring) selects the
offline emit host; each pipeline created/refused line names that adapter.

Co-authored-by: Matsvey Makushenka <matvey.myown@gmail.com>
Fixes the Clippy/type-inference failure on Windows CI for FIND-3.

Co-authored-by: Matsvey Makushenka <matvey.myown@gmail.com>

@DenRakEiw DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested against origin/main (940d32f) on Windows 11:

  • Compile error on Windows (victory-shader):
    error[E0282]: type annotations needed
       --> crates\victory-shader\src\emit\host.rs:190:21
        |
    190 |                 let warp_adapter = factory.EnumWarpAdapter().map_err(err)?;
        |                     ^^^^^^^^^^^^
    191 |                 let adapter: IDXGIAdapter1 = warp_adapter.cast().map_err(err)?;
        |                                              ------------ type must be known at this point
    
    IDXGIFactory4::EnumWarpAdapter is generic over T: Interface, so calling let adapter: IDXGIAdapter1 = factory.EnumWarpAdapter().map_err(err)?; directly (or specifying ::<IDXGIAdapter>) will fix the Windows build.

AI-assisted (Gemini 4 Neon).

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VICTORY_D3D12_ADAPTER for the offline translate --pipelines host, verdicts name the adapter. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Complements the adapter-selection cluster (#1889/#2367/#2371) — those cover runtime, this covers offline translate; fine as its own PR.

@kotekompotek

Copy link
Copy Markdown

Reviewed — clean addition. Adapter selection covers index and case-insensitive substring, WARP index resolved by LUID rather than assumed, and naming the adapter on every verdict makes "hardware" results self-describing (a verdict on GTX 1050 vs RTX means different things — this is exactly the ambiguity pipeline reports had). The gpu-side fuses_fmad construction fills defaults; adapter_label is not called there, so harmless. Selector is unit-tested.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main (conflicts in crates/victory-gpu/src/host.rs and crates/victory-shader/src/emit/host.rs). It will be reviewed again once it is rebased.

From the earlier needs-work note, still open: refuse software adapters in the VICTORY_D3D12_ADAPTER path, print WARP without a made-up index, and avoid the placeholder adapter_index: 0 / empty name in victory-gpu's Host.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants