Repository navigation
Recompiler: validate DXIL containers and split pieces in translated cache - #2540
ramon-victor wants to merge 1 commit into
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Tested: current PR head merged onto current
Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
Enforces DXIL container and split
dispatch_chainvalidation intranslated::cached_rerouted,translated::cached_in, andtranslated::store_in, matching the invariants already enforced bytranslated::load_in.Previously, the production path
translated::cached_reroutedskippeddxc::valid_dxil_container(&c.dxil)(unlike the test-onlycached_in), and none ofstore_in,cached_in, orcached_reroutedvalidatedc.dispatch_chain(dwords_per_group > 0,pieces.len() >= 2, andvalid_dxil_container(piece)for every piece). A corrupt or truncated whole container or split piece could therefore be returned directly to D3D12 and persisted to disk (whereload_inlater rejected it).Part of #2463 (specifically item 3's container/piece validation;
direct_output()already trackscompact_nest_tag()onmain).What is in it
crates/xcl/src/gpu/recomp/pso.rs:translated::valid_compiled(c: &Compiled) -> boolverifyingdxc::valid_dxil_container(&c.dxil)and, whendispatch_chainisSome,dwords_per_group > 0,pieces.len() >= 2, andvalid_dxil_containeron every piece.valid_compiledinstore_in,cached_in, andcached_rerouted(returning an error without writing.binor a permanent.errmarker when validation fails).shader_cache_tests::translated_cache_rejects_invalid_dxil_and_split_piecescovering invalid whole DXIL incached_rerouted, malformeddispatch_chaincases (bad piece bytes,< 2pieces,0dwords per group) acrosscached_rerouted,cached_in, andstore_in, plus a valid 2-piece round-trip.Tested
621.24, wave32), AMD Ryzen 7 5700X, 32 GiB RAM, Windows 11 Pro (26300),rustc 1.99.0(x86_64-pc-windows-msvc), DXC/DXIL1.8.2502.11(Windows SDK10.0.26100.0).cargo test -p xcl --lib translated_cache_rejects_invalid_dxil_and_split_pieces -- --nocapturefailed (0 passed, 1 failed:cached_rerouted must reject invalid whole DXIL).cargo test -p xcl --lib gpu::recomp::pso:: -- --test-threads=1:25 passed, 0 failed, 1 ignored(repeated_pso_shader_compilebenchmark)..\scripts\test.ps1, debug):1424 passed, 0 failed, 46 ignored(skipped on this adapter: wave64-only GPU tests, unsupported per-lane semantics variants,no heap windows).cargo build --release -p xcl) and clean 60 s retail smoke run (.\scripts\smoke.ps1).Regression run
Baseline (
main):PR (
f5cb7ea):Not tested
translated::cached_rerouted,cached_in, andstore_in).AI use
main, implementedvalid_compiledacrossstore_in/cached_in/cached_reroutedand its failing-first unit tests, ran.\scripts\test.ps1, release build, and the 60 ssmoke.ps1run, and drafted this PR description.