Shaders: name the adapter on translate --pipelines verdicts (FIND-3) #2454
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2456"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by makmatvey on 2026-11-25T13:51:56Z.
FIND-3:
VICTORY_D3D12_ADAPTER(index or description substring) selects theoffline emit host; each pipeline created/refused line names that adapter.
Rebased onto
63bcca4, and merged with upstream's WARP workUpstream added a shared WARP device, a
WARP_LOCKand awarpfield to thesame code this PR rewrites. Rather than choose one side, the two are merged:
second time, so the lock covers one
create_device, not two enumerationsthat have to agree.
d58745e("annotate EnumWarpAdapter as IDXGIAdapter") is dropped as obsolete:its one-line type annotation fixed the PR's own
warp_adapter_indexhelper,which this merge removes. The surviving code binds
EnumWarpAdapterdirectlyto
IDXGIAdapter1and compiles on both clippy passes.The triage items, and what closed them
Refuse software adapters in the
VICTORY_D3D12_ADAPTERpath.selected_adapternow rejects an adapter carrying
DXGI_ADAPTER_FLAG_SOFTWARErather thanhonouring it, with an error saying so. The checks behind this path are
hardware-only, and a software device answers them wrongly in a way that reads
as a pass.
No fabricated index.
adapter_indexisOption<u32>;adapter_labelomits the index when there is none instead of printing
0, and says"an unenumerated adapter"when it has neither. Invictory-gpu, theplaceholder
adapter_index: 0/ empty name is gone: that call site is nowHost::from_device(device.clone()), which upstream had already introduced, sothis PR no longer touches
victory-gpu/src/host.rsat all.Print WARP without a made-up index — verified on the hardware, not read off
the code. Probed through
Host::newon an RTX 3060:The software adapter is a real entry in
EnumAdapters1here (index 1, flaggedsoftware), so the label names what the device actually runs on. Where DXGI does
not list it the label reports no adapter rather than inventing one.
A defect found while verifying, and its regression test
The default path constructed its device and never asked that device which
adapter it landed on, so a verdict from a normal run reported no adapter at all
while the selector path reported a real one. Fixed by resolving through the
device in that branch too.
the_default_device_names_its_adapterguards it. Reverted fix, test kept:Restored fix, it passes. Also fixed here: LUIDs are compared by field, not as
structs, since
LUIDcarries padding DXGI does not promise to zero.Verification on this machine
cargo build --workspace --lockedcargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo xtask policycargo test -p victory-shader --lib(skip the #2571 crash)cargo test -p victory-gpu --libThe 3 + 2 failures are the pre-existing hardware-only ones in #2571 and #3178,
identical to the same suites on
63bcca4with nothing applied. None is causedby this change.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T13:54:27Z.
Review: COMMENTED
Tested against
origin/main(940d32f) on Windows 11:victory-shader):IDXGIFactory4::EnumWarpAdapteris generic overT: Interface, so callinglet adapter: IDXGIAdapter1 = factory.EnumWarpAdapter().map_err(err)?;directly (or specifying::<IDXGIAdapter>) will fix the Windows build.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:26Z.
Review: COMMENTED
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.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:24:21Z.
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_fmadconstruction fills defaults;adapter_labelis not called there, so harmless. Selector is unit-tested.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:55:28Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/host.rsandcrates/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_ADAPTERpath, print WARP without a made-up index, and avoid the placeholderadapter_index: 0/ empty name invictory-gpu'sHost.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T00:05:12Z.
Review: APPROVED
LGTM — verified
rustfmt,cargo xtask policy,cargo clippy(--all-targetsand--all-featuresacrossvictory-shaderandvictory),victorytests (18 passed), andemit::host::on both hardware and WARP (6 passed on each, includingthe_default_device_names_its_adapterandadapter_selector_tests).The
VICTORY_D3D12_ADAPTERmatching, software-adapter rejection, LUID-baseddescribe_adapter/Host::from_deviceidentification, andtranslate --pipelines/VICTORY_PAIRSverdict formatting are all solid and clean.A few minor non-blocking notes:
translate.rs:176, 222, 641, worker threads build their ownHostwhile formatting verdicts with the preflightpipeline_adapterlabel (unlikeVICTORY_PAIRS, which uses theHostit builds).host.rs:156, 306,describe_adapterandselected_adaptercallGetDesc1a second time after already obtaining the descriptor.host.rs:263, 291,selected_adaptertreats anyEnumAdapters1error as end-of-enumeration while aborting early ifGetDesc1fails on an earlier adapter.README.md:215could optionally note that an emptyVICTORY_D3D12_ADAPTER=""errors rather than falling back, thatVICTORY_WARP=1takes precedence over it, and that it also applies toVICTORY_PAIRS.Pull request closed