Repository navigation
Conversation
fuzeofficlal
left a comment
There was a problem hiding this comment.
Several issues to address on 2b9e580b:
-
Merge conflict & Clippy failure in
crates/victory-gpu/src/host.rs:- The branch currently conflicts with
origin/mainathost.rs:198(wheremainqueriesD3D12_FEATURE_D3D12_OPTIONS2fordepth_bounds_supported); please rebase and preserve that query on the created device. - The nested
if dred_on() { if let Ok(dred) = ... }(host.rs:176-182) will tripclippy::collapsible_ifunder CI's-D warnings(collapse withif dred_on() && let Ok(dred) = ...).
- The branch currently conflicts with
-
No inbox fallback once
State::Loadedis cached (crates/victory-gpu/src/agility.rs:244-252,host.rs:187-196):- Once
CreateDeviceFactorysucceeds,agility::create_devicepropagatesfactory.CreateDevice(...)?with no fallback to inboxD3D12CreateDevice. If the selectedD3D12Core.dllfails to create a device on the host driver or WARP adapter,host()cachesNonefor the lifetime of the process and disables GPU execution even when inbox D3D12 would succeed.
- Once
-
Process-wide state mutation & ANSI/UTF-8 path mismatch (
agility.rs:141-150,agility.rs:191-193):- Calling
factory.ApplyToGlobalState()mutates process-wide D3D12 state (affecting independentD3D12CreateDevicecallers likevictory-shader/src/emit/host.rs:110and preventing clean fallback to inboxD3D12CreateDevice). Keeping device creation scoped to the factory avoids leaking optional SDK state globally. format_sdk_pathpasses UTF-8 bytes toCreateDeviceFactory'sPCSTR(which interprets the string in the process ANSI code page unless a UTF-8 ACP manifest is active), whereasprobe_diropensD3D12Core.dllvia wide Win32 paths. Non-ASCII directories (e.g.C:\Users\José\D3D12) can passprobe_dirand fail to resolve inCreateDeviceFactory.
- Calling
-
PE export bounds & implicit candidate fallback (
agility.rs:70-96,agility.rs:112-137,agility.rs:165):rva_to_offsetfalls back toSome(rva as usize)when an RVA lies outside every section (treating an unmapped RVA as a file offset) and does not checkdelta + 4 <= section.file_size, allowing a 4-byte read across a section boundary.- For implicit directories (
<exe_dir>\D3D12,<exe_dir>,%LOCALAPPDATA%\Victory\D3D12),resolve_dirstops at the first candidate with a parseableD3D12SDKVersionexport — if that candidate failsCreateDeviceFactory, remaining implicit candidates are skipped. - Minor: in
resolve_get_interface, ifGetProcAddressfails afterLoadLibraryExW, releasing the loaded module handle withFreeLibraryavoids leaking the extrad3d12.dllreference.
|
Automated triage for the maintainers. Needs work; needs the maintainer's decision. Thanks for rebasing; it now merges cleanly. The new head adds a Before that review, CI must pass. CI: failing ( Generated by Claude Code |
|
Update: the loader is now a shared Validation on RTX 2080 Ti (Turing, SM 6.5 hardware) with Microsoft The last line confirms |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Extracting crates/victory-agility and cleaning up the dred_on() if let in host.rs are nice improvements, but several items from the previous review still remain on 6170e8ee:
- Merge conflict (
crates/victory-gpu/src/host.rs): The branch is still behindorigin/main(842b0cb7/63bcca43) and currently reportsmergeable: dirtyaroundcreate()/depth_bounds_supported. Please rebase ontomain. - No inbox fallback when
factory.CreateDevicefails (crates/victory-agility/src/lib.rs:247):create_devicestill returnsfactory.CreateDevice(...)?directly without falling back toD3D12CreateDevice, so an incompatible Agility runtime or unsupported adapter path will fail device creation instead of falling back to inbox D3D12 as documented. - Unconditional
ApplyToGlobalState()(crates/victory-agility/src/lib.rs:197): CallingApplyToGlobalState()mutates process-wide D3D12 state globally for all subsequent callers (including tests andvictory-shaderWARP/host tests). - ANSI vs UTF-8 path encoding (
crates/victory-agility/src/lib.rs:146-155):format_sdk_pathencodes Rust UTF-8 into aCStringand passes it asPCSTRtoCreateDeviceFactory, which interprets it using the system ANSI code page rather than UTF-8 on non-UTF-8 Windows locales. - PE RVA mapping & implicit directory fallback (
crates/victory-agility/src/lib.rs:72-104,129-137):rva_to_offsetstill returnsSome(rva as usize)when no section containsrva(line 84), and line 77 only checksdelta >= section.file_sizewithout checking that all 4 bytes (delta..delta + 4) lie withinsection.file_size.resolve_dirreturns on the first parseableD3D12Core.dll(line 130); ifcreate_factorythen fails for that candidate, implicit fallback does not try remaining candidate directories.
kotekompotek
left a comment
There was a problem hiding this comment.
LGTM — correct SDK mechanics: D3D12SDKVersion export validated via PE parse before activation, ApplyToGlobalState+ALLOW_RETURNING_EXISTING covers late direct D3D12CreateDevice callers, and configuration_interface goes through the factory so debug interfaces match the device's runtime. Explicit-dir failures reported not skipped; clean inbox fallback everywhere.
6170e8e to
7e2e129
Compare
|
Rebased onto current AI use: WorkBuddy agent re-applied the patch and ran the checks; the account owner reviewed the result. |
|
Checked the CI failure on
Happy to re-review once CI is green. |
…al for GetProcAddress and annotate the transmute source type as FARPROC. - clippy::manual_c_str_literals (lib.rs:172) - clippy::missing_transmute_annotations (lib.rs:175) Verified locally: cargo clippy -p victory-agility --all-targets --locked -- -D warnings clean; cargo test -p victory-agility --lib 3 passed.
|
Thanks @fuzeofficlal for the precise report — both lints fixed in |
Windows 10's inbox
D3D12Core.dllstops at Shader Model 6.5, even on GPUs and drivers that support SM 6.6. This adds an optional app-local Agility SDK loader so a Windows 10 / Turing machine can provide SM 6.6 without changing the OS.Search order for
D3D12Core.dll:%VICTORY_D3D12_DIR%(explicit; a bad path is reported instead of silently ignored),<exe_dir>\D3D12,<exe_dir>,%LOCALAPPDATA%\Victory\D3D12.When a valid SDK is found,
ID3D12SDKConfiguration1::CreateDeviceFactorycreates the device factory andApplyToGlobalStatemakes free functions dispatch through the app-local runtime.Hostnow creates its device and debug/DRED interfaces through this loader; without an SDK it falls back to inboxD3D12CreateDevice/D3D12GetDebugInterface.Validation:
CARGO_BUILD_JOBS=18(2 cores left for the system).cargo build -p victory-gpu: clean.cargo test -p victory-gpu --lib agility::tests -- --test-threads=18: 3 passed, including a real SDK check that readsD3D12SDKVersionfrom Microsoft'sMicrosoft.Direct3D.D3D121.620.2D3D12Core.dll.This does not by itself make wave64 shader emulation or GFX10 translation work; it only fixes the D3D12 runtime/SM 6.6 detection gap.
AI use: AI-assisted (WorkBuddy) for drafting the patch and tests; build/test results are from real local runs.