Merge candidate: open PRs merged, built and tested together (draft, in progress) #3327

Open
github-bot wants to merge 1053 commits from github-bot/gh-3327 into main AGit
Owner

@⁠pes7 on GitHub · 2026-11-26 18:16 UTC · original
pes7:merge/best-2026-11-26 → main · +56143 −5037 · 185 files · 1053 commits · open

Draft, work in progress. A merge candidate: main plus open pull requests merged together, built and tested together, conflicts between them resolved by hand. Posted so others can see the merge work and not repeat it; coordination in #1633.

Nothing here closes or replaces any pull request: each one stays open and is closed only when it lands in main. This PR shows which set works together and which pull requests need a rebase.

Who is in the build: 375 pull requests

stage branch PRs checked
1. triaged ready-to-merge, clean merges merge/best-2026-11-26 97 clippy -D warnings (also --all-features), cargo test 1 019 passed / 0 failed, the title A/B below
2. their conflicts resolved by hand merge/best-2026-11-26 (this PR) +18 clippy both ways, asset policy, cargo test 1 036 passed / 0 failed
3. every other open PR with a green check that merges and still builds and tests with the set merge/best-2026-11-26 (this PR) +260 cargo check --all-targets after each batch of 12, failing batches bisected to the PR; then clippy both ways, asset policy, cargo test 1 493 passed / 1 failed (see below); failing tests bisected to the PR and its merge reverted

Every PR below is a separate merge commit Merge PR #N: title, so git log --merges on the branch shows who is in.

The title (diagnostics build, Series X, Enter only, 240 s an arm, alternating)

arm        frames  used  frame ms  GPU ms  draws
base1          14     9      2050    1754   1686   (#2936 branch build)
cand1          13     8      3213    2554   2924   (stage 1)
base2          18    13      3073    2701   4653
cand2          20    15      1999    1724   2772

No device removal and no crash in any arm (also a 25 min warm-up of the candidate, which translated every shader again). The picture matches the base build at the same moments. Frame time is within the noise of these runs (the draw count of the scene differs between arms by up to 2.7x): no regression, no win to claim. These runs are of stage 1 only.

The full set (375) does not run the title yet: about 45 s in, before the first scene, the title reads memory that was reserved and never committed (0xc0000005, the same place in two runs). Stage 1 alone does not do this, so one of the stage 2/3 merges changes how title memory is mapped. A git bisect that runs the title at each step is finding it; its merge will be reverted here and the PR named in this description.

Stage 1 - triaged ready-to-merge (97)

Chosen from 1 004 PRs that merge into main with a green check, not drafts: correctness, crash and performance fixes, small, with tests, preferring authors already merged upstream; no diagnostics, CI, README/CLI-only or stacked PRs. Two commits of mine make the set build: #2706 finds #1653's sharded library; lower.rs's tests move to lower_tests.rs (the set takes it past the 512 KiB asset policy, as #3097 says).

  • #2634 victory-gpu: say once, not per slot, that the title's heap outgrew the host's (first frame 21 s -> 33 ms) (@⁠pes7)
  • #2696 victory-gpu: VICTORY_SKIP_PIPELINES works in release builds, where the removals are (@⁠pes7)
  • #2683 victory-shader: clamp heap indices to the largest heap a host can make (no descriptor read past the heap) (@⁠pes7)
  • #1623 gfx10: keep an instruction's words inline instead of in a heap vector (decode -18..-45%, translation -1..-5%) (@⁠pes7)
  • #1734 victory-shader: make the test dispatches cheap - an event wait and reused command objects (emit suite -33% wall, -48% CPU) (@⁠pes7)
  • #2848 victory-gpu: take per-frame allocations, locks and system calls off the frame paths (7 places the profile points at) (@⁠pes7)
  • #1653 victory-gpu: split the pipeline library into shards so a save writes only what changed (was 600 MB per save) (@⁠pes7)
  • #2706 victory-gpu: keep a pipeline library per translation, not one shared one (a translator edit destroyed a 926 MB / 7.5 min cache) (@⁠pes7)
  • #3295 victory-gpu: a copy of title memory in video memory, prepared and tested (@⁠pes7)
  • #2936 victory-gpu: 16-bit packed colour widens for the host (the second crash between the account screen and gameplay), and the two tools it took (@⁠pes7)
  • #324 fix(pe): detect incomplete TLS callback arrays (@⁠pedrofort)
  • #379 Shaders: lower v_div_fixup_f16 (@⁠LouisRiverstone)
  • #477 Shaders: fix DXIL validator UB on null error blobs, unchecked GetStatus, and COM/DLL handle leaks (@⁠nathanbzrr)
  • #590 HLE: reject duplicate blob changes in one save update (@⁠Quat3rnion)
  • #1123 Validate XGameSave blob count before reading (@⁠EatCodeSleep2)
  • #1194 HLE: extract installed_package and add focused xstore license/package tests (@⁠geiyiliyabumo)
  • #1196 HLE: fix self-closing XML element body parsing in runtime.rs and add unit tests (@⁠geiyiliyabumo)
  • #1253 Shaders: ignore pre-loop table loads when proving waterfall offsets (@⁠mgunes1311-lab)
  • #1263 Shader: the loop limit switch works in every build (@⁠pablogonz12)
  • #1327 Shaders: apply bitwise modifiers to v_cmp_class_f32 source operands (@⁠fuzeofficlal)
  • #1540 Shaders: guard both back edges when a conditional branch targets two … (@⁠Texbirds)
  • #1543 GPU: avoid shift and arithmetic overflow panics in subresource and copyable_footprints (victory-gpu) (@⁠Texbirds)
  • #1564 GPU: MakeResident succeeds, as the console's memory is always resident (@⁠LouisRiverstone)
  • #1621 Shaders: bound the bytes one part's native blobs unpack to and hand out (@⁠imjustprism)
  • #1787 GPU: textures drop unordered access in formats the host cannot write (NVIDIA B5G5R5A1) (@⁠Danigamer05)
  • #1827 HLE: enumerate the current installation for XPackageKind::Game (@⁠n-romanovich)
  • #1859 GPU: reject overflowing and non-buffer descriptor spans before shadow… (@⁠VlREX)
  • #1944 Shaders: reject a dxbc part inside the header or part table (@⁠imjustprism)
  • #1993 GPU: hash DXIL shader slices zero-copy in HostPipeline::new (@⁠nathanbzrr)
  • #2037 Shaders: byte and half format loads at a constant offset load the aligned dword directly (NVIDIA) (@⁠desplmfao)
  • #2063 Shaders: lower s_ff0_i32_b32 and s_ff0_i32_b64 in pure 32-bit DXIL (@⁠geiyiliyabumo)
  • #2070 Shaders: refuse the image instructions DXIL has no form of (@⁠0xkn0wh3r3)
  • #2077 Shaders: lower s_sext_i32_i8 and s_sext_i32_i16 in pure 32-bit DXIL (@⁠geiyiliyabumo)
  • #2083 Shaders: lower s_bitreplicate_b64_b32 in pure 32-bit DXIL (@⁠geiyiliyabumo)
  • #2111 GPU: the frame's wait for pipelines is one budget for all recording threads (@⁠r4tedx)
  • #2122 Shaders: query a buffer's size through a handle of its own (@⁠imjustprism)
  • #2141 HLE: registry lookups through kernelbase.dll reach the device-type overrides (@⁠BastienRodz)
  • #2150 Shaders: one instruction for one value (13.5 % fewer emitted instructions, no program lost) (@⁠r4tedx)
  • #2184 xmem: 32-bit XMemAllocDefault blocks get the alignment they ask for (@⁠BastienRodz)
  • #2224 GPU: validate execute_indirect buffer offsets against buffer bounds and u64 overflow (@⁠Xvania7)
  • #2229 Shaders: v_pk_fmac_f16 with DPP reads src0 from the selected lane (@⁠BastienRodz)
  • #2240 GPU: title memory copies are brought up to date again after a title write (@⁠denkencar-sketch)
  • #2254 Shaders: v_mad_i64_i32 sign-extends a 32-bit literal addend (@⁠BastienRodz)
  • #2269 GPU: marks in the last dword of the written-pages bitmap are not discarded (@⁠denkencar-sketch)
  • #2274 GPU: aliased textures copy only the subresources that have the same bytes per row (@⁠denkencar-sketch)
  • #2276 GPU: a depth texture used before it got a twin is copied to the twin in the list (@⁠denkencar-sketch)
  • #2278 GPU: a plain heap description is not read past its 16 bytes without checking they are mapped (@⁠denkencar-sketch)
  • #2295 GPU: the fifth dword of a root constants parameter is read as a constant (@⁠denkencar-sketch)
  • #2299 GPU: harden CopyMemoryToMemoryX against unmapped or read-only pages (@⁠denkencar-sketch)
  • #2303 GPU: page mapping copies wait for the submission that is running (@⁠denkencar-sketch)
  • #2361 Shaders: lower SOP2 s_pack_{ll,lh,hh}_b32_b16 (#815) (@⁠fuzeofficlal)
  • #2404 XG: preserve packed mip swizzle/positions and fix array subresource tiling (fixes issue 2400) (@⁠pushkarreddyy)
  • #2444 HLE: keep refilling XMA PCM buffer across zero-sample decode steps (@⁠Texbirds)
  • #2445 Loader: clamp VEH instruction reads to the faulting page in emulate_amd_only and sse4a (@⁠Texbirds)
  • #2450 Shader: check device removal before FMad readback (@⁠Damokles2)
  • #2476 Discover shaders and pipeline packs through file symlinks (@⁠DoubleD17)
  • #2501 Shaders: a BVH node offset from a root descriptor is computed in 64 bits (@⁠Calvix2k)
  • #2504 HLE: physical-page writes open the title's views before they write (@⁠BastienRodz)
  • #2515 Shaders: VOP3 f16 interpolation attr63.w is not a 32-bit literal (@⁠mgunes1311-lab)
  • #2553 HLE: avoid data race in DirectStorage late page-list polling (@⁠reeledMarek)
  • #2554 Loader: guard null C++ exception pointers in crash::thrown and Rsp overflow/alignment in unwind_into (@⁠reeledMarek)
  • #2576 GPU: read marks of slots forgotten before a submission are cleared before it runs (@⁠BastienRodz)
  • #2598 GPU: giving up a texture leaves the dynamic slots of recorded lists alone (@⁠BastienRodz)
  • #2622 Shaders: a constant branch through a folded block drops its untaken phi entry (@⁠BastienRodz)
  • #2630 PE: refuse a tls directory that runs outside the image (@⁠imjustprism)
  • #2639 GPU: texture bytes off the runtime's memory are read at each refresh, as buffer copies' are (#2638) (@⁠BastienRodz)
  • #2677 App: keep run paths stable when the title changes directory (@⁠jaschinski97-ops)
  • #2724 Shaders: texture reads at a computed table entry keep their read mark (#2722) (@⁠BastienRodz)
  • #2727 GPU: reject overflowing rectangle vertex ranges (@⁠fuzeofficlal)
  • #2776 shader: lower non-sum wave prefix operations to DXIL (@⁠JAEdotUK)
  • #2831 Shaders: dwords read from the first lane outside a waterfall's own reads are one lane's (#2829) (@⁠BastienRodz)
  • #2869 Shaders: a buffer descriptor made raw from first-lane reads needs its waterfall (#2867) (@⁠BastienRodz)
  • #2882 GPU: heaps are bound again after a cut when ours stand in for both kinds (#2881) (@⁠BastienRodz)
  • #2886 Shaders: preserve round mode changes in whole-wave sections (@⁠yumaste)
  • #2893 Shaders: find the normalized load rounding shift with one bit scan (@⁠Ingenioeren)
  • #2896 GPU: a list that binds no view heap gets ours before the root signature (#2894) (@⁠BastienRodz)
  • #2924 Shaders: reuse source-lane activity ballots (@⁠Ingenioeren)
  • #2954 Shaders: lower v_bfe_u32/v_bfe_i32 to one Ubfe/Ibfe (@⁠Ingenioeren)
  • #2980 GPU: a panic while making a host pipeline refuses it instead of ending the worker (@⁠Ingenioeren)
  • #3005 GPU: make already-used pipeline lookups read-only (@⁠AwsAli05)
  • #3007 Shaders: lower the 32-bit mul_hi forms to one UMul/IMul (@⁠Ingenioeren)
  • #3084 GPU: wait for queued presentation before resizing the swap chain (@⁠passerbyyhx)
  • #3092 Loader: keep concurrent crash records whole (@⁠neonbyte1)
  • #3098 GPU: reject truncated or corrupted shader refusal entries (@⁠yefan911)
  • #3131 Game: fix stencil write-mask reachability for NEVER/ALWAYS funcs (@⁠fuzeofficlal)
  • #3141 GPU: flush queued segments before evaluating memory and fence waits (@⁠fuzeofficlal)
  • #3195 HLE: keep async status waits attached through provider cleanup (@⁠andrewpozdnakov7-jpg)
  • #3221 fix(shader): preserve signed zero when f32 div:2 underflows (@⁠brainbudt)
  • #3243 Loader: skip DIR64 relocation addresses that overflow u32 (@⁠andrewpozdnakov7-jpg)
  • #3245 GPU: return pinned HostTexture from alias_source to avoid source Release UAF (@⁠fuzeofficlal)
  • #3248 GPU: preparing a view heap's page table scans the change tracker a word at a time (@⁠borosf)
  • #3257 GPU: fix PresentX subresource copy and plane format handling (@⁠fuzeofficlal)
  • #3266 GPU: back off texture heap growth after out-of-memory (@⁠yumaste)
  • #3272 HLE: wait for in-flight lifecycle callbacks on unregister (@⁠fuzeofficlal)
  • #3280 Fix issue 2412: reject out-of-range export addresses in parse_exports (@⁠tharun-37)
  • #3309 formats: guard XMA Bits::read and Bits::signed against shift overflow (@⁠SalmanBarkat)
  • #3316 Shaders: decode fixed 4-VGPR data and 4-SGPR rsrc for image_bvh_intersect_ray (@⁠mgunes1311-lab)

Stage 2 - conflicts resolved by hand (18)

  • #1565 GPU: Evict succeeds, as the console's memory is never evicted (@⁠LouisRiverstone; conflicted with #1564)
  • #1566 GPU: SetStablePowerState is accepted and ignored (@⁠LouisRiverstone; conflicted with #1564)
  • #2272 GPU: a page a copy holds in part is taken after its marked copy-back (@⁠denkencar-sketch; conflicted with #2269)
  • #2297 GPU: a texture sampled before an in-list title memory copy is uploaded again after it (@⁠denkencar-sketch; conflicted with #2276)
  • #2415 GPU: remapping one mapping of aliased pages leaves the others guarded (@⁠BastienRodz; conflicted with #2269)
  • #2437 GPU: a marked copy-back advances the snapshot of declared ranges over its page (@⁠BastienRodz; conflicted with #2269)
  • #2474 GPU: refreshes of two parts of one page do not make it current whole (@⁠BastienRodz; conflicted with #2240)
  • #2296 GPU: rectangle vertices are read from title memory through the kernel at submission (@⁠denkencar-sketch; conflicted with #2295)
  • #2329 GPU: a list that binds a heap's view-address table keeps it until reset (@⁠denkencar-sketch; conflicted with #2295)
  • #1668 Shaders: read inline floats as f32 bits in 16-bit integer ops (@⁠Calvix2k; conflicted with #1327)
  • #1685 Shaders: lower v_cmp_{f,t}_{i64,u64} constant 64-bit compares (@⁠Calvix2k; conflicted with #1327)
  • #2792 fix(shader): allow untracked scalar lane masks in v_cndmask_b32 (@⁠legayclightning22; conflicted with #1327)
  • #2915 Shaders: f16 results ignore their output modifier, as RDNA2 does with half denormals kept (@⁠0xkn0wh3r3; conflicted with #1327)
  • #2457 Shaders: return zero for unused image_get_resinfo extents (@⁠makmatvey; conflicted with #1253)
  • #2587 Shaders: bind a zero dword for empty root-constant slices (@⁠fuzeofficlal; conflicted with #2515)
  • #2774 Shaders: validate raw fixtures and signed MAD64 with full-word regression (@⁠LogicGrove; conflicted with #2254)
  • #2953 Shaders: lower binary64 division fixup in DXIL (@⁠andrewpozdnakov7-jpg; conflicted with #2936)
  • #2958 Shaders: one lane of a wave sets a mark its wave shares (frames 411 -> 283 ms on an RTX 4070 SUPER) (@⁠moe-miau; conflicted with #2936)

Fixes on top so the stage builds: #2415 opens pages through #2848's open_runs; #2457's and #1253's test helpers merged into one; #2437 keeps #2272's page take and adds its snapshot sync.

Stage 3 - every other PR that merges and builds with the set (260)

  • #159 GPU: occlusion, statistics and timestamp queries run on the host (@⁠r4tedx)
  • #171 Shaders: lower v_mad_u64_u32 and v_mad_i64_i32 (@⁠n-romanovich)
  • #202 GPU: skip unmapped regions after a failed bulk read into host memory (@⁠ifBars)
  • #212 GPU, HLE: report host display HDR luminance and configure swap chain color space (@⁠n-romanovich)
  • #478 Audio capture: guard WASAPI timestamp underflow and stream silence writes (@⁠nathanbzrr)
  • #486 shader: opt the test binaries into an app-local Agility SDK runtime (@⁠naixue2233)
  • #491 GPU: remember pipelines whose creation crashed the process (VICTORY_PIPELINE_JOURNAL) (@⁠desplmfao)
  • #541 GPU: retain D3D12 object names in private data (@⁠broccolize)
  • #545 xtask: add qa command to run policy, rustfmt, and clippy checks (@⁠pushkarreddyy)
  • #601 GPU: bound texture upload and capture slices to the allocated buffer (@⁠AwsAli05)
  • #602 GPU: report retained snapshot, texture scratch and upload memory (@⁠lucaseddd)
  • #652 GPU: use selected mip extents for MSAA resolves (@⁠fuzeofficlal)
  • #927 GameInput: held keys are reported in the order they were pressed, as documented (@⁠BastienRodz)
  • #967 GPU: choose an adapter that can run the title, and name the ones that cannot (@⁠zzm1234560621-prog)
  • #1010 GPU: copy title memory into host memory without a system call (@⁠TG0000)
  • #1013 perf(shader): speed up control-flow structurisation (@⁠matheusfrta)
  • #1059 Loader: VICTORY_PATCH writes bytes into a loaded module after relocation (@⁠Halfect)
  • #1065 Shaders: use validator 1.8 for compute derivatives (@⁠Halfect)
  • #1113 Formats: lay out packed RGB textures as horizontal texel pairs (@⁠Razdva122)
  • #1174 HLE: implement IUnknown::QueryInterface and unit tests for xgame objects (@⁠geiyiliyabumo)
  • #1192 Loader: skip empty executable sections in tls::redirect and add tls.rs unit tests (@⁠geiyiliyabumo)
  • #1199 HLE: return NOT_SUPPORTED early for null out in QueryApiImpl without marking area missing (@⁠geiyiliyabumo)
  • #1212 HLE: expand synthetic unit tests for apu.rs (1 -> 19 tests) (@⁠geiyiliyabumo)
  • #1213 HLE: reject null handle in WinHttpSetOption proxy path and expand net.rs tests (1 -> 17) (@⁠geiyiliyabumo)
  • #1218 xtask: wine-test runs the Windows tests on a Linux host under Wine (@⁠neonbyte1)
  • #1224 fix(hle): coalesce split placeholders when mapping physical pages (@⁠matheusfrta)
  • #1262 Shaders: double-precision add, mul, fma, min, max, compares and conversions (stacked on #416) (@⁠MamaLeVrai)
  • #1264 HLE: map a page scatter in runs, not one page at a time (@⁠pablogonz12)
  • #1283 Clarify DRED reports when GPU progress is unknown (@⁠DoubleD17)
  • #1406 GPU: fix NULL/UNKNOWN SRV/UAVs on promoted-typeless textures and MSAA/array/3D NULL RTV/DSVs (@⁠ESAT586)
  • #1432 HLE: set ERROR_PROC_NOT_FOUND for missing pseudo-module exports (@⁠fuzeofficlal)
  • #1434 Loader: match title DLL filenames ignoring ASCII case (@⁠fuzeofficlal)
  • #1445 HLE reuses freed physical page numbers (@⁠BaggyALPHA)
  • #1571 GPU: add diagnostics for shader dependency wait times (@⁠srijann07)
  • #1584 GPU: add opt-in idle shader cache trimming (@⁠srijann07)
  • #1625 CLI: compare runtime shader failures with offline coverage (@⁠srijann07)
  • #1676 Shaders, CLI: name a host without mesh shaders in the pipeline census (@⁠fiestorra)
  • #1700 GPU: say when a draw's render target has no host copy or lost its permission (@⁠fiestorra)
  • #1701 GPU: VICTORY_MODE overrides the reported console display mode (@⁠Calvix2k)
  • #1712 victory-shader: support line-topology mesh shaders (@⁠tjthebigbearcat-hub)
  • #1716 victory-shader: fold constants and eliminate dead pure ops in bitcode (@⁠bartikele)
  • #1717 HLE: the retail console ID has the documented dotted form (@⁠davutsimsekk)
  • #1722 GPU: the host pipeline library works under Wine (null blob for an empty library) (@⁠Impre-visible)
  • #1732 GPU: f32_to_half keeps NaN and rounds normals to nearest even (#843) (@⁠moe-miau)
  • #1763 GPU: refuse typed UAVs in unsupported formats regardless of family or castability (@⁠n-romanovich)
  • #1772 HLE: handle verbatim/drive-root mounts and UNC/verbatim GetDiskFreeSpaceW roots (@⁠n-romanovich)
  • #1776 GPU: exclude 4:2:2 packed formats 68/69 from castable texture formats (@⁠0xKaji)
  • #1792 Formats: reject texture mip counts beyond the full chain (@⁠VlREX)
  • #1796 Core: report unreadable implicit configuration files (@⁠VlREX)
  • #1797 XMA: reject frame starts in packet headers (@⁠VlREX)
  • #1802 Perf/shader relative shift bounds (@⁠VlREX)
  • #1814 PE tests: cover ImportLibrary::parse short imports and archive errors (@⁠n-romanovich)
  • #1825 GPU: keep the view-stride table once per list, not per draw stage (@⁠slatefield)
  • #1840 Shaders: discover irreducible loops with iterative SCC decomposition (@⁠VlREX)
  • #1846 Shaders: worklist register liveness with 96 independent synthetic CFG… (@⁠VlREX)
  • #1849 GPU: free memory is not the runtime's to watch (fixes a world-load deadlock under Wine) (@⁠crashbashash)
  • #1862 GPU: index bindless texture slots for targeted release and preserve u… (@⁠VlREX)
  • #1866 Game: preserve sample masks in prebuilt graphics pipelines (@⁠necrobytes)
  • #1871 Shaders: lower indexed tbuffer_load_format_* and indexed buffer_store_{byte,short} (@⁠ESAT586)
  • #1884 Perf/memory guard batching (@⁠VlREX)
  • #1892 Tests: every GPU test module takes the shared lock, which diff_tests did not (@⁠fiestorra)
  • #1894 GPU: pool mapped upload buffers across command list resets (@⁠n-romanovich)
  • #1903 Shader: the ray test's triangle multiplies stay apart from their adds (@⁠kais7654)
  • #1907 victory-shader: honor unwritten OSG1 channels and output modes in rectangle_gs (@⁠mgunes1311-lab)
  • #1920 Shaders: v_mad_f32 and v_mac_f32 multiply apart from their add (@⁠kais7654)
  • #1927 Shaders: d16 format loads saturate 32-bit integer channels (@⁠upipibi)
  • #1933 victory-gpu: keep depth-twin UAVs in concrete UAV formats and support default views (@⁠mgunes1311-lab)
  • #1943 Shaders: the null-buffer reads of the heap skip a host that caps its heaps (@⁠kais7654)
  • #1946 Descriptors: null UAV for packed 16-bit formats D3D12 refuses (@⁠Biewlhenrique)
  • #1947 HLE: a live range takes a guard page, and a mapped range is not a placeholder (@⁠fiestorra)
  • #1966 Crash reports: keep them when stderr is closed (@⁠imjustprism)
  • #1975 HLE: match rpcrt4 UuidFromString nil-UUID and canonical string rules (@⁠mgunes1311-lab)
  • #1981 Preserve the last complete save when a newer version is missing a blob (@⁠WerG0D)
  • #1991 Shader tests: skip the GPU suites a device cannot run (@⁠Calvix2k)
  • #1994 Shaders: floor, ceil and fract read denormals as zeros (@⁠astrosteveo)
  • #1995 CLI: recommend a DXIL validator in translate --help (@⁠AlanQiang0418)
  • #2005 GPU: log the missing D3D12 1.7 (no castable texture formats) (@⁠Calvix2k)
  • #2018 Docs: rustdoc builds the GPU crate again (shader_cache's private link) (@⁠Gruzzberry)
  • #2020 Shaders: abs / neg on the shift-add and align ops act on the sign bit (@⁠upipibi)
  • #2022 xmem: an aligned XMemAllocDefault block is padded once, not twice (@⁠0xkn0wh3r3)
  • #2026 Formats: bounds-check a detiled row once, not each run in it (@⁠0xkn0wh3r3)
  • #2039 CLI: resolve same-directory title DLL exports in census (@⁠fuzeofficlal)
  • #2041 Shaders: the fused multiply-add probe binds a sampler heap (@⁠0xkn0wh3r3)
  • #2065 HLE: allow oleaut32.dll in default host policy (@⁠fuzeofficlal)
  • #2072 HLE: an unknown gamertag component is an invalid argument (@⁠0xkn0wh3r3)
  • #2074 DirectStorage: a queue submits itself past half its capacity, not at half (@⁠0xkn0wh3r3)
  • #2076 HLE: implement remaining XAccessibility closed-caption, high-contrast, and speech-to-text slots (@⁠fuzeofficlal)
  • #2079 Shaders: a relative move's program is built at its full range only if no bound is proven (@⁠0xkn0wh3r3)
  • #2094 Shaders: lower v_add_nc_i32, v_sub_nc_i32, v_add_nc_i16, and v_sub_nc_i16 in pure 32-bit DXIL (@⁠geiyiliyabumo)
  • #2115 CLI: translate --count counts the instructions of the emitted shaders (@⁠r4tedx)
  • #2118 GPU: the BVH builder runs whole or not at all (@⁠0xkn0wh3r3)
  • #2134 GPU tests: a world frame's preparing at the published volumes (benchmark) (@⁠r4tedx)
  • #2139 HLE: implement synchronous XGameSave slots and unfiltered blob enumeration (@⁠fuzeofficlal)
  • #2142 GPU: read small buffer diagnostics via read_into instead of VirtualQuery (@⁠fuzeofficlal)
  • #2152 Shaders: lower ds_permute_b32 and ds_nop (@⁠fuzeofficlal)
  • #2173 GPU: handle typed D16/D32 and multisample depth twins (@⁠fuzeofficlal)
  • #2187 GPU: a readable texture does not share a host texture denied to shaders (@⁠fuzeofficlal)
  • #2188 Testing: compare Windows benchmark runs with memory and time limits (@⁠Razdva122)
  • #2195 GPU tests: the library test's shaders compile with Wine's compiler too (@⁠winne42)
  • #2196 GPU tests: root signatures made from each shader's RS string (@⁠winne42)
  • #2235 GPU: a title memory copy left out of a page table is named when slots come back (@⁠denkencar-sketch)
  • #2250 GPU: pipeline workers take their count from VICTORY_PIPELINE_THREADS (@⁠kotekompotek)
  • #2265 Tests: allow the frame clock to skip ticks after a late frame (@⁠andrewpozdnakov7-jpg)
  • #2283 GPU: a fast content digest for untracked textures, and their commit check kept per remap epoch (@⁠alessiodeia)
  • #2284 Shader tests: cover the merged geometry user-data layout (@⁠Halfect)
  • #2320 Preserve signed R16 contrast in PNG captures (@⁠DoubleD17)
  • #2321 Report effect databases in shader-info effects mode (@⁠DoubleD17)
  • #2333 Shaders: buffer byte and half stores of a VGPR's high half (_d16_hi) (@⁠TinkerBell-90)
  • #2344 Shaders: name the operation kind a whole-wave section the simulation cannot follow (@⁠borosf)
  • #2386 Shaders: a DPP step over a lane set the section names stays followed (@⁠borosf)
  • #2387 Shaders: track SGPR origins across cancelling s_xor_b32/b64 swaps (#815) (@⁠fuzeofficlal)
  • #2392 HLE: a null or empty subkey opens the emulated OEM key itself (#765) (@⁠KainanP)
  • #2406 Shaders: s_cbranch_vccz/vccnz tests raw VCC, not VCC & EXEC (@⁠makmatvey)
  • #2443 GPU: expose IDXGIObject on emulated DXGI interfaces (@⁠Damokles2)
  • #2452 HLE: DirectStorage open_file shares write/delete and keeps LastError (@⁠makmatvey)
  • #2483 DSP: the reverb convolver passes the host checks (rebased #240) (@⁠kais7654)
  • #2486 GPU: keep constant nonzero targets visible in captures (@⁠andrewpozdnakov7-jpg)
  • #2491 Shaders: intersect compare bounds with existing range bounds in Ranges::edge_hi (@⁠reeledMarek)
  • #2508 tools: add bounded Windows benchmark script (@⁠The-Star-World)
  • #2509 GPU: upload the stencil plane with guest textures (@⁠andrewpozdnakov7-jpg)
  • #2511 XGameSave: refuse an update when no version number is above the highest (#2497) (@⁠Creaa)
  • #2512 GameInput: look up only devices already seen by the process (@⁠andrewpozdnakov7-jpg)
  • #2516 GPU capture: decode XR-biased RGB before image scaling (@⁠andrewpozdnakov7-jpg)
  • #2520 Shaders: walk a predecessor's live-out registers once instead of searching it per register (@⁠liandraraiane)
  • #2522 HLE: retain pending_with state across cancellation and prevent stale block completions (@⁠reeledMarek)
  • #2524 HLE: bounds-check all four bytes of ACP notification writes in audio::submit (@⁠reeledMarek)
  • #2575 Game: short-circuit pipeline state enumeration once wanted hashes are found (@⁠reeledMarek)
  • #2578 Core: ignore empty VICTORY_LOG and RUST_LOG values instead of overriding default log level (@⁠reeledMarek)
  • #2579 Core: ignore empty LOCALAPPDATA, XDG_CACHE_HOME, and HOME in default directory resolution (@⁠reeledMarek)
  • #2588 Decode RGB9E5 in diagnostic PNG captures (@⁠DoubleD17)
  • #2589 Diagnostics: preserve the world capture draw count (@⁠andrewpozdnakov7-jpg)
  • #2591 Formats: add a runnable BC5 record reconstruction shader example (@⁠Dathinel)
  • #2592 CLI: reject VS+GS graphics pipelines in prebuild (@⁠fuzeofficlal)
  • #2599 GPU: read UAV MipSlice from offset 8 in image_words (@⁠fuzeofficlal)
  • #2605 GPU: waits on memory that cannot be read are counted apart (#2604) (@⁠BastienRodz)
  • #2607 Diagnostics: decode signed 32-bit color captures (@⁠andrewpozdnakov7-jpg)
  • #2617 HLE: hold DirectStorage reads behind held status entries and preserve sequence order (@⁠fuzeofficlal)
  • #2618 XAsync: a result size of 0 when there is no result to take (@⁠F1reworks10)
  • #2642 Check staged file type changes in the asset policy hook (@⁠maxence468)
  • #2648 BCPack: stop completed lanes from taking another lane’s bytes (@⁠chaseb64)
  • #2649 BCPack: retain a partial rANS refill at a fragment boundary (@⁠chaseb64)
  • #2658 Game tests: cover CityHash64 length and block boundaries (@⁠XeNS1)
  • #2659 Loader (diagnostics): VICTORY_POKE writes through the page's protection (@⁠kotekompotek)
  • #2663 Formats/XMA: add 10-bit VLC lookup table, u64 bit-peek, and quant-factor LUT (@⁠RVZO6)
  • #2666 GPU diagnostics: end draw traces at every present (@⁠andrewpozdnakov7-jpg)
  • #2680 GPU: keep edge samples in odd-sized diagnostic PNGs (@⁠andrewpozdnakov7-jpg)
  • #2690 GPU: report default buffer alignment from GetDesc (@⁠andrewpozdnakov7-jpg)
  • #2708 Find the first XMA frame when a buffer starts with continuation data (@⁠VlREX)
  • #2710 Apply outstanding XMA sample skips to the final overlap (@⁠VlREX)
  • #2714 Keep XMA input valid when looping back to the start of a buffer (@⁠VlREX)
  • #2715 Clear stale button and key state in GameInput output buffers (@⁠VlREX)
  • #2720 Preserve ambiguous legacy XGameSave migrations (FIND-23) (@⁠leftmove)
  • #2741 PE: reject null IAT RVAs in non-empty import descriptors (@⁠fuzeofficlal)
  • #2742 HLE: validate XMemMapPhysicalPages inputs before unmapping and roll back partial runs (@⁠fuzeofficlal)
  • #2745 HLE: succeed DisableThreadLibraryCalls for pseudo-module handles (@⁠fuzeofficlal)
  • #2749 XTaskQueue: every queue using a port hears of a task submitted to it (@⁠F1reworks10)
  • #2756 GPU: capture the mip selected by 2D render-target views (@⁠andrewpozdnakov7-jpg)
  • #2763 GPU: inherit typed formats in explicit RTV and DSV descriptions (@⁠andrewpozdnakov7-jpg)
  • #2765 Shaders: scratch with neither address names no register (GFX10.3 ST mode) (@⁠Moon0755)
  • #2782 Shaders: read known FP16/FP64 rounding mode bits (@⁠andrewpozdnakov7-jpg)
  • #2784 Shaders: build Halves def/phi table lazily as a compact Vec in io::raise (@⁠RVZO6)
  • #2793 Shaders: signature rows of one register follow their name offsets (@⁠Moon0755)
  • #2794 Game: truncate oversized inflated stream to pack size in shaderpack::find (@⁠GuckstduWeitaaa)
  • #2795 Formats: speed up XMA2 inverse MDCT by 24-29% (@⁠brainbudt)
  • #2797 Loader: accept identical destination when concurrent publish rename fails (@⁠fuzeofficlal)
  • #2800 Shaders: SP3 text names a discard's address and position target four (@⁠Moon0755)
  • #2804 GPU tests: what marking written title pages costs, per way of marking (benchmark for #2167, #2175, #2465, #2755) (@⁠0xkn0wh3r3)
  • #2805 GPU tests: assert a missed submission through readback (@⁠andrewpozdnakov7-jpg)
  • #2806 GPU tests: what translated 16-bit float math costs against the host's (34x on an RTX 5070 Ti; for #2384) (@⁠0xkn0wh3r3)
  • #2808 Shaders: speed up DXBC container MD5 hashing by 16-43% (@⁠brainbudt)
  • #2812 shader: a comparison sampler replaces the reduction instead of OR-ing into it (@⁠spy0eye-beep)
  • #2817 Shaders: pixel DPP8 within a quad reads through quad operations; common quad patterns take one (@⁠0xkn0wh3r3)
  • #2820 GPU tests: a benchmark of what list calls cost on the title's threads (@⁠0xkn0wh3r3)
  • #2823 Shaders: the neg input modifier flips a NaN's sign too (@⁠xKineticK)
  • #2828 Pipeline cache: verify content when accepting a racing publication (@⁠andrewpozdnakov7-jpg)
  • #2838 CLI: reject conflicting shader-info output modes (@⁠109User109)
  • #2839 CLI: flag files configured as directories (@⁠109User109)
  • #2850 GPU: refresh table CBVs on fresh_tables cache hits (@⁠fuzeofficlal)
  • #2855 xmem: a refused XMemVirtualAlloc leaves the host's reason in the last error (@⁠0xkn0wh3r3)
  • #2858 CLI: inspect names each section's flags (@⁠wilu222)
  • #2866 Translate: count the instructions on 16-bit floats (for #2384, #2825) (@⁠xndbogdan)
  • #2875 GPU: loose windows can sit in video memory the CPU writes (@⁠Luislariosss)
  • #2884 Shaders: round packed FP16 fused multiply-add once in nearest-even mode (@⁠andrewpozdnakov7-jpg)
  • #2887 HLE: a title's ExitProcess is logged as its exit is (@⁠0xkn0wh3r3)
  • #2889 GPU tests: read back cleared constant buffer descriptors (@⁠andrewpozdnakov7-jpg)
  • #2901 GPU: return S_FALSE when private data is already absent (@⁠andrewpozdnakov7-jpg)
  • #2902 HLE: a module name with a trailing dot gets no .dll appended (@⁠pawrenity)
  • #2904 DirectStorage: workers read a file through a handle each (@⁠0xkn0wh3r3)
  • #2909 GPU: reject empty query heaps at creation (@⁠andrewpozdnakov7-jpg)
  • #2910 GPU: fit fallback host window to work area and honor VICTORY_WINDOW_MAX (@⁠alexandruiulian201-bot)
  • #2913 GPU: an argument clamp Wine's compiler builds too (carries #1279) (@⁠arogan178)
  • #2919 GPU: the depth converter Wine's compiler builds too (@⁠arogan178)
  • #2923 Shaders: require EXEC coverage when tracing VALU address operands (@⁠fuzeofficlal)
  • #2931 GPU: match failed feature-level query results (@⁠andrewpozdnakov7-jpg)
  • #2935 GPU: count accepted presents while keeping title frames advancing (@⁠UwUCammie)
  • #2947 GPU: reject unknown shader model feature requests (@⁠andrewpozdnakov7-jpg)
  • #2950 Game: the shader pack in an archive inflates through zlib-rs (@⁠0xkn0wh3r3)
  • #2952 GPU: disable implicit stream depth test without a DSV format (@⁠fuzeofficlal)
  • #2961 GPU: reject shader-visible RTV and DSV heap creation (@⁠andrewpozdnakov7-jpg)
  • #2962 GPU: sample packed 10-bit frames for black-frame diagnostics (@⁠andrewpozdnakov7-jpg)
  • #2968 Shaders: f32 floor, ceil and fract flush denormal operands (@⁠neonbyte1)
  • #2989 Loader: verify OpenThread owner PID before reading thread stack (@⁠fuzeofficlal)
  • #2990 HLE: skip junctions in the persistent-storage quota count (@⁠Halfect)
  • #2991 Loader: clear XMM0 in ReturnZero thunk stubs for floating-point imports (@⁠fuzeofficlal)
  • #2998 HLE: deliver initial XNetworking registration callbacks and track unregister tokens (@⁠fuzeofficlal)
  • #3002 GPU: an early list reset leaves a held host list it cannot replace (@⁠ZeOs360)
  • #3013 GPU: keep untracked pages writable in Tracked::taken (@⁠fuzeofficlal)
  • #3015 App: check transitive static imports of mapped title DLLs for missing files (@⁠fuzeofficlal)
  • #3020 CLI: count all SGD5 hashes and stripped-bitcode XDAT/xbop markers in shader-info (@⁠fuzeofficlal)
  • #3022 GPU: read D24S8 and D32S8 planes into guest buffers (@⁠andrewpozdnakov7-jpg)
  • #3026 xtask: bound policy file reads and report read errors (@⁠fuzeofficlal)
  • #3034 GPU: require texture copy footprints to fit a complete row (@⁠andrewpozdnakov7-jpg)
  • #3038 Shaders: keep spilled compute root parameters from claiming s16+ system SGPRs (@⁠fuzeofficlal)
  • #3049 Game: recover SGD5 records from unparsed databases alongside intact ones (@⁠fuzeofficlal)
  • #3056 Shaders/Lower: guard global_atomic_fmin and global_atomic_fmax against NaN operands (@⁠RVZO6)
  • #3061 GPU: a draw's table entries are looked up once (@⁠0xkn0wh3r3)
  • #3079 gpu: vectorize merge_writeback with 64-bit word chunks (@⁠AdvaitPalve11)
  • #3085 GPU tests: a freed test pool keeps its addresses, and mark tests hold off submissions (@⁠0xkn0wh3r3)
  • #3099 GPU: drop only marked pages for withheld marked ranges (@⁠fuzeofficlal)
  • #3104 HLE XGameSave: tolerate locked old or unfinished version cleanup (@⁠fuzeofficlal)
  • #3105 HLE GameInput: expand per-device reading history to 256 (@⁠fuzeofficlal)
  • #3111 Formats/BCPack: restrict BC7 channel rotation to modes 4 and 5 (@⁠RVZO6)
  • #3119 GPU: initialise new page tables to their null view pair (@⁠fuzeofficlal)
  • #3121 HLE media: block UNC share bypasses for localhost and ??\ file URLs (@⁠Arkenoz)
  • #3126 Formats XMA: reject truncated quant_step escape sequences (@⁠Arkenoz)
  • #3127 Shaders: v_cubesc/tc_f32 keep denormal coordinates, v_cubema_f32 of a zero is +0 (@⁠Moon0755)
  • #3133 xmem: coalesce low-4 GiB guards on retry when no single guard fits (@⁠fuzeofficlal)
  • #3134 HLE: reject failed GetLogicalDrives() mask when mounting virtual drives (@⁠fuzeofficlal)
  • #3140 GPU: restrict texture resource states to legal direct-queue write and read combinations (@⁠fuzeofficlal)
  • #3142 Shaders: lower a subtract atomic as an add of the wrapping negation (@⁠Mdemets)
  • #3162 GPU: a list used twice in one submission gets a prelude per use (@⁠kotekompotek)
  • #3163 GPU: device slots 0x1c8 and 0x218 fail on purpose, with no object (@⁠arogan178)
  • #3167 GPU: a pipeline a list binds again is not kept and named again (@⁠pablogonz12)
  • #3169 GPU: drain fence wait counts and durations together (@⁠andrewpozdnakov7-jpg)
  • #3172 hle: reject null tiling out when the count is nonzero (@⁠cloph-dsp)
  • #3180 Add a synthetic D3D12 wave64 regression for independently looping waves (@⁠carlosmegino)
  • #3184 GPU: list calls can translate on worker threads (VICTORY_DEFER_LISTS, opt-in) (@⁠AurumCarlos)
  • #3185 GPU: round fallback footprint size up to alignment (@⁠reeledMarek)
  • #3187 Shaders: continue scanning wave sections past an unmatched saveexec (@⁠reeledMarek)
  • #3190 HLE: honor available disk space in storage prompts (@⁠andrewpozdnakov7-jpg)
  • #3198 GPU: a placed texture without a host texture gives back its slot (@⁠kotekompotek)
  • #3203 Shader test: skip 64-bit image atomics where the format has none (@⁠zzm1234560621-prog)
  • #3208 pe: bound data directory offset by optional header size (@⁠cloph-dsp)
  • #3215 GPU: a read slot is resolved once, not twice (@⁠borosf)
  • #3225 GPU: a command queue's SuspendX and ResumeX succeed (@⁠JurajSimicevic)
  • #3231 HLE: keep KernelWrite leases across pending overlapped and scatter reads (@⁠kilvynsilveira-tech)
  • #3232 GPU: batch page-table rebuilds by region and owner (@⁠yumaste)
  • #3256 loader: stop clzero loop emulation before address wraparound (@⁠cloph-dsp)
  • #3259 GPU: use smaller staging chunks after allocation failure (@⁠yumaste)
  • #3262 GPU: a page's saved bytes are read into an unzeroed buffer (@⁠Creaa)
  • #3273 HLE media: translate ??<drive> paths through the virtual drives (@⁠andrewpozdnakov7-jpg)
  • #3278 fix(loader): accelerate 15-byte CLZERO loops with page-readability caching (@⁠legayclightning22)
  • #3283 Tests on Windows 10: skip four tests that need shader model 6.6 / ID3D12Device10 / an SM 6.6 WARP (#1999) (@⁠lerapeurdu62280-debug)
  • #3284 feat(hle): add opt-in hidden window mode for lifecycle stand-in (@⁠legayclightning22)
  • #3299 Shaders: avoid overwriting mesh indices when every slot is exported (@⁠andrewpozdnakov7-jpg)
  • #3304 shader: multiply all three PSV0 thread dimensions and keep output maxima in mesh_stride (@⁠fuzeofficlal)
  • #3310 HLE: match host DLLs behind lifecycle and CRT API sets (@⁠fuzeofficlal)
  • #3313 GPU: count single-list submissions in the GPU timing summary (@⁠neonbyte1)
  • #3315 GPU: validate ByteStride alignment and root signature in signature::create (@⁠mgunes1311-lab)
  • #3317 HLE: preserve ERROR_TLW_WITH_WSCHILD and close relaunch duplicate handle (@⁠mgunes1311-lab)

Merge and build, but their tests fail with the set (merge reverted in this branch)

  • #2012 Shaders: decode finds instructions in a table by dword, not a tree (@⁠0xkn0wh3r3): its table decoder fails the decoder tests of the set ("instruction runs past the end of the code"; 338 tests)
  • #1937 Codex/fix gpu castable test 2026 11 25 (@⁠lollo1977): castable-format test fails with the set
  • #1759 Shaders: lower numerical Wave32 mesh masks at uniform entry (@⁠aycow): mesh mask test fails with the set
  • #1942 GameInput: answer IUnknown and own-IID queries on the COM objects (re-lands #1641) (@⁠Calvix2k): GameInput QueryInterface test fails with the set
  • #2557 GameInput: deliver registered reading callbacks (@⁠andrewpozdnakov7-jpg): GameInput reading-callback test fails with the set
  • #3132 HLE: preserve non-S_OK success HRESULTs in xasync::finished (@⁠fuzeofficlal): xasync completion-status test fails with the set
  • #2336 GPU: list only pipelines retained by the host library as prebuilt (@⁠andrewpozdnakov7-jpg): prebuilt-pipeline listing test fails with the set

One test fails only when the whole suite runs in parallel: lifecycle::tests::relaunch_closes_its_duplicated_process_handle (from #3317) counts the process handles while other tests open theirs; alone it passes 3 of 3.

Covered by a PR already in the build

  • #2327 GPU: a save that fails gives its changes back for the next one: #1653 already serialises saves under one lock and keeps the marks of a failed save
  • #2328 GPU: pipeline library saves run one at a time: #1653 already holds one lock from serialising to the last file
  • #166 Shaders: lower s_bitset{0,1}_b64, s_brev_b64 and s_bitreplicate_b64_b32: duplicate of #2083 (same instruction lowered twice)

Need a rebase onto this set

Semantic conflicts with stage 1 (17):

  • #1437 Shaders: preserve the unwritten high half of packed D16 image loads (conflicts with #1253)
  • #1577 Shaders: expand 64-bit inline constants as signed ints and binary64 floats (conflicts with #1327 #2831)
  • #2104 Shaders: lower s_wqm_b32 and s_wqm_b64 in pure 32-bit DXIL (conflicts with #2083 #2361)
  • #2178 GPU+shader: back structured buffer views with raw descriptors for NVIDIA rawBufferLoad (conflicts with #1859)
  • #2238 Watch: dropping a tracker keeps a mapping guarded while a tracker holds its alias (conflicts with #2848)
  • #2293 GPU: a slot rewritten during a run keeps its view's copy of title memory until the run is over (conflicts with #1859)
  • #2294 GPU: a typed depth format in a shader resource view is made in the readable colour format (conflicts with #1859)
  • #2363 GPU: descriptor dwords read as data — the record count and the format (conflicts with #1859)
  • #2435 GPU: give screen passes dedicated pipeline workers and wait budget (fixes issue 2433) (conflicts with #1993 #2111)
  • #2788 Audio: XMA decoding keeps up while frames are slow (MMCSS thread, the mixer never waits for a decode) (conflicts with #2444)
  • #2821 GPU: title threads recording lists no longer wait on descriptor and buffer-copy locks (conflicts with #2848 #2936 #2598)
  • #2943 Shaders: pack half FMA NaNs directly (conflicts with #2893 #2954 #3007)
  • #3151 Shaders: pass SignedOpKind::Signed for float dx.op.wavePrefixOp (conflicts with #2936 #1540 #2893 #2954 #3007)
  • #3155 Shader: a load through a built CODE descriptor starts the constant table at the byte it reads (conflicts with #1540)
  • #3227 GPU: keep fences alive while queues wait on them (conflicts with #3141)
  • #3247 GPU: the held-work pump reads each wait's word once, and answers its own blocked question (conflicts with #3141)
  • #3300 gpu: scale dynamic descriptor pool on capped heaps (NVIDIA) (conflicts with #2683)

Merge, but break the build together with the set (11):

  • #450 GPU: preserve typed null render target slots: crates\victory-gpu\src\query.rs:442:32: error[E0308]: mismatched types: expected Option<&ID3D12Resource>, found &ID3D12Resource | crates\victory-gpu\src\tex
  • #1201 Loader: free mapped module on TLS redirect error and add windows.rs unit tests: crates\victory-loader\src\windows.rs:594:21: error[E0061]: this function takes 3 arguments but 2 arguments were supplied | crates\victory-loader\src\windows.rs:
  • #1335 test(shader): translate random GFX10 programs on every test run: crates\victory-shader\src\emit\random_tests.rs:506:39: error[E0616]: field wordsof structInstructionis private: private field | error: could not compile
  • #1614 Shader tests: a cross-device VALU fuzzer (hardware adapters vs WARP): crates\victory-shader\src\emit\fuzz_tests.rs:716:12: error: cannot construct host::Host with struct literal syntax due to private fields | error: could not co
  • #2001 HLE: resolve the local machine name to loopback: crates\victory-hle\src\modules\net.rs:1315:17: error[E0425]: cannot find function resolvable in this scope: not found in this scope | crates\victory-hle\src\m
  • #2066 Net: forward zero-address datagram disconnects: crates\victory-hle\src\modules\net.rs:2347:5: error[E0428]: the name v6is defined multiple times:v6redefined here | error: could not compilevictory-hle`
  • #2223 GPU: account for pending pipelines before promotion: crates\victory-gpu\src\pipeline\make.rs:713:31: error[E0599]: no method named loadfound for structstd::sync::Once in the current scope: method not found i
  • #2372 Shaders: 16-bit gradient samples (_g16) and a16 independently, in decoding and lowering (#1116): crates\victory-shader\src\gfx10\fields.rs:876:9: error[E0063]: missing field lenin initializer ofgfx10::Instruction: missing len | crates\victory-shader
  • #2396 GPU: wire DeserializeComputePipelineStateX to assemble ACCC: crates\victory-gpu\src\pipeline.rs:810:5: error[E0061]: this function takes 5 arguments but 4 arguments were supplied | error: could not compile victory-gpu (
  • #2608 GPU: split and flush command list segments after texture read-backs: crates\victory-gpu\src\hold.rs:521:32: error[E0063]: missing field flush_afterin initializer ofhold::World<'_, _>: missing flush_after | error: could no
  • #3088 Shaders: match whole entries in the PSV0 string table: crates\victory-shader\src\emit\container.rs:604:25: error[E0063]: missing field validator18in initializer ofemit::container::Psv<'_>: missing validator18`

Conflict with the set (541): #76, #189, #200, #223, #233, #320, #385, #387, #395, #439, #465, #485, #509, #511, #517, #551, #559, #583, #594, #606, #642, #673, #926, #969, #970, #1114, #1142, #1178, #1210, #1211, #1217, #1223, #1244, #1256, #1271, #1300, #1312, #1315, #1396, #1408, #1414, #1422, #1428, #1449, #1460, #1462, #1473, #1493, #1546, #1547, #1548, #1555, #1569, #1630, #1639, #1687, #1693, #1704, #1715, #1731, #1738, #1767, #1769, #1777, #1786, #1793, #1803, #1807, #1816, #1817, #1818, #1819, #1821, #1832, #1855, #1856, #1868, #1880, #1885, #1888, #1897, #1904, #1908, #1917, #1934, #1935, #1936, #1939, #1940, #1953, #1957, #1958, #1959, #1963, #1964, #1974, #1978, #1984, #1985, #1986, #1998, #2014, #2035, #2051, #2053, #2075, #2084, #2085, #2088, #2089, #2091, #2092, #2095, #2096, #2097, #2098, #2099, #2102, #2106, #2117, #2121, #2126, #2128, #2129, #2136, #2146, #2149, #2165, #2166, #2167, #2168, #2176, #2177, #2182, #2193, #2194, #2199, #2201, #2205, #2207, #2208, #2210, #2211, #2225, #2226, #2230, #2249, #2251, #2273, #2279, #2282, #2292, #2298, #2309, #2310, #2312, #2314, #2319, #2325, #2331, #2332, #2341, #2342, #2350, #2358, #2362, #2367, #2382, #2385, #2389, #2397, #2398, #2399, #2405, #2408, #2422, #2423, #2427, #2428, #2429, #2430, #2441, #2442, #2447, #2459, #2460, #2461, #2467, #2472, #2480, #2490, #2492, #2494, #2506, #2510, #2518, #2519, #2527, #2528, #2532, #2533, #2540, #2542, #2543, #2548, #2549, #2556, #2558, #2559, #2562, #2566, #2567, #2569, #2573, #2581, #2585, #2594, #2595, #2596, #2600, #2601, #2603, #2606, #2610, #2612, #2614, #2615, #2619, #2620, #2623, #2625, #2626, #2627, #2628, #2629, #2632, #2633, #2636, #2644, #2646, #2647, #2654, #2655, #2657, #2662, #2664, #2665, #2667, #2668, #2672, #2673, #2675, #2678, #2679, #2686, #2694, #2698, #2702, #2703, #2704, #2705, #2709, #2711, #2713, #2718, #2721, #2726, #2728, #2729, #2731, #2732, #2733, #2735, #2736, #2738, #2740, #2743, #2747, #2755, #2757, #2761, #2766, #2767, #2768, #2769, #2771, #2785, #2786, #2787, #2789, #2791, #2796, #2798, #2799, #2802, #2803, #2809, #2810, #2811, #2816, #2818, #2819, #2825, #2827, #2830, #2832, #2834, #2837, #2840, #2841, #2844, #2846, #2849, #2859, #2864, #2868, #2871, #2872, #2873, #2874, #2877, #2878, #2879, #2883, #2885, #2888, #2890, #2891, #2895, #2897, #2898, #2899, #2900, #2903, #2905, #2906, #2907, #2908, #2911, #2914, #2916, #2917, #2918, #2925, #2926, #2928, #2938, #2940, #2941, #2942, #2948, #2951, #2955, #2956, #2957, #2959, #2960, #2965, #2969, #2970, #2971, #2972, #2973, #2974, #2975, #2977, #2979, #2981, #2982, #2983, #2984, #2985, #2986, #2987, #2988, #2992, #2993, #2994, #2996, #2997, #2999, #3003, #3006, #3008, #3009, #3010, #3016, #3018, #3021, #3023, #3025, #3027, #3029, #3032, #3035, #3039, #3041, #3043, #3044, #3046, #3047, #3048, #3050, #3052, #3053, #3057, #3064, #3065, #3067, #3068, #3069, #3075, #3078, #3080, #3082, #3083, #3086, #3090, #3091, #3093, #3095, #3096, #3102, #3106, #3107, #3108, #3109, #3112, #3113, #3114, #3115, #3117, #3120, #3122, #3124, #3125, #3128, #3129, #3136, #3138, #3139, #3143, #3144, #3145, #3147, #3148, #3149, #3150, #3152, #3153, #3154, #3156, #3157, #3158, #3159, #3160, #3161, #3164, #3166, #3168, #3170, #3173, #3174, #3175, #3176, #3177, #3181, #3182, #3183, #3186, #3188, #3189, #3191, #3193, #3194, #3197, #3199, #3201, #3202, #3204, #3205, #3206, #3207, #3209, #3211, #3212, #3213, #3214, #3216, #3217, #3218, #3220, #3222, #3224, #3226, #3228, #3229, #3230, #3233, #3234, #3236, #3238, #3239, #3242, #3244, #3246, #3249, #3250, #3251, #3252, #3254, #3255, #3258, #3260, #3263, #3264, #3265, #3267, #3268, #3274, #3275, #3276, #3281, #3282, #3286, #3287, #3288, #3289, #3290, #3292, #3293, #3294, #3296, #3297, #3302, #3305, #3307, #3308, #3312, #3318, #3319

🤖 Generated with Claude Code

**@⁠pes7** on GitHub · 2026-11-26 18:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/3327) `pes7:merge/best-2026-11-26` → `main` · +56143 −5037 · 185 files · 1053 commits · open **Draft, work in progress.** A merge candidate: `main` plus open pull requests merged together, built and tested together, conflicts between them resolved by hand. Posted so others can see the merge work and not repeat it; coordination in #1633. Nothing here closes or replaces any pull request: each one stays open and is closed only when it lands in `main`. This PR shows which set works together and which pull requests need a rebase. ## Who is in the build: **375 pull requests** | stage | branch | PRs | checked | |---|---|---|---| | 1. triaged ready-to-merge, clean merges | [`merge/best-2026-11-26`](https://github.com/pes7/VIctory/tree/merge/best-2026-11-26) | 97 | clippy `-D warnings` (also `--all-features`), `cargo test` 1 019 passed / 0 failed, the title A/B below | | 2. their conflicts resolved by hand | `merge/best-2026-11-26` (this PR) | +18 | clippy both ways, asset policy, `cargo test` 1 036 passed / 0 failed | | 3. every other open PR with a green `check` that merges and still builds and tests with the set | `merge/best-2026-11-26` (this PR) | +260 | `cargo check --all-targets` after each batch of 12, failing batches bisected to the PR; then clippy both ways, asset policy, `cargo test` 1 493 passed / 1 failed (see below); failing tests bisected to the PR and its merge reverted | Every PR below is a separate merge commit `Merge PR #N: title`, so `git log --merges` on the branch shows who is in. ## The title (diagnostics build, Series X, Enter only, 240 s an arm, alternating) arm frames used frame ms GPU ms draws base1 14 9 2050 1754 1686 (#2936 branch build) cand1 13 8 3213 2554 2924 (stage 1) base2 18 13 3073 2701 4653 cand2 20 15 1999 1724 2772 No device removal and no crash in any arm (also a 25 min warm-up of the candidate, which translated every shader again). The picture matches the base build at the same moments. Frame time is within the noise of these runs (the draw count of the scene differs between arms by up to 2.7x): no regression, no win to claim. These runs are of stage 1 only. **The full set (375) does not run the title yet:** about 45 s in, before the first scene, the title reads memory that was reserved and never committed (`0xc0000005`, the same place in two runs). Stage 1 alone does not do this, so one of the stage 2/3 merges changes how title memory is mapped. A `git bisect` that runs the title at each step is finding it; its merge will be reverted here and the PR named in this description. ## Stage 1 - triaged ready-to-merge (97) Chosen from 1 004 PRs that merge into `main` with a green `check`, not drafts: correctness, crash and performance fixes, small, with tests, preferring authors already merged upstream; no diagnostics, CI, README/CLI-only or stacked PRs. Two commits of mine make the set build: #2706 finds #1653's sharded library; `lower.rs`'s tests move to `lower_tests.rs` (the set takes it past the 512 KiB asset policy, as #3097 says). - #2634 victory-gpu: say once, not per slot, that the title's heap outgrew the host's (first frame 21 s -> 33 ms) (@⁠pes7) - #2696 victory-gpu: VICTORY_SKIP_PIPELINES works in release builds, where the removals are (@⁠pes7) - #2683 victory-shader: clamp heap indices to the largest heap a host can make (no descriptor read past the heap) (@⁠pes7) - #1623 gfx10: keep an instruction's words inline instead of in a heap vector (decode -18..-45%, translation -1..-5%) (@⁠pes7) - #1734 victory-shader: make the test dispatches cheap - an event wait and reused command objects (emit suite -33% wall, -48% CPU) (@⁠pes7) - #2848 victory-gpu: take per-frame allocations, locks and system calls off the frame paths (7 places the profile points at) (@⁠pes7) - #1653 victory-gpu: split the pipeline library into shards so a save writes only what changed (was 600 MB per save) (@⁠pes7) - #2706 victory-gpu: keep a pipeline library per translation, not one shared one (a translator edit destroyed a 926 MB / 7.5 min cache) (@⁠pes7) - #3295 victory-gpu: a copy of title memory in video memory, prepared and tested (@⁠pes7) - #2936 victory-gpu: 16-bit packed colour widens for the host (the second crash between the account screen and gameplay), and the two tools it took (@⁠pes7) - #324 fix(pe): detect incomplete TLS callback arrays (@⁠pedrofort) - #379 Shaders: lower v_div_fixup_f16 (@⁠LouisRiverstone) - #477 Shaders: fix DXIL validator UB on null error blobs, unchecked GetStatus, and COM/DLL handle leaks (@⁠nathanbzrr) - #590 HLE: reject duplicate blob changes in one save update (@⁠Quat3rnion) - #1123 Validate XGameSave blob count before reading (@⁠EatCodeSleep2) - #1194 HLE: extract installed_package and add focused xstore license/package tests (@⁠geiyiliyabumo) - #1196 HLE: fix self-closing XML element body parsing in runtime.rs and add unit tests (@⁠geiyiliyabumo) - #1253 Shaders: ignore pre-loop table loads when proving waterfall offsets (@⁠mgunes1311-lab) - #1263 Shader: the loop limit switch works in every build (@⁠pablogonz12) - #1327 Shaders: apply bitwise modifiers to v_cmp_class_f32 source operands (@⁠fuzeofficlal) - #1540 Shaders: guard both back edges when a conditional branch targets two … (@⁠Texbirds) - #1543 GPU: avoid shift and arithmetic overflow panics in subresource and copyable_footprints (victory-gpu) (@⁠Texbirds) - #1564 GPU: MakeResident succeeds, as the console's memory is always resident (@⁠LouisRiverstone) - #1621 Shaders: bound the bytes one part's native blobs unpack to and hand out (@⁠imjustprism) - #1787 GPU: textures drop unordered access in formats the host cannot write (NVIDIA B5G5R5A1) (@⁠Danigamer05) - #1827 HLE: enumerate the current installation for XPackageKind::Game (@⁠n-romanovich) - #1859 GPU: reject overflowing and non-buffer descriptor spans before shadow… (@⁠VlREX) - #1944 Shaders: reject a dxbc part inside the header or part table (@⁠imjustprism) - #1993 GPU: hash DXIL shader slices zero-copy in HostPipeline::new (@⁠nathanbzrr) - #2037 Shaders: byte and half format loads at a constant offset load the aligned dword directly (NVIDIA) (@⁠desplmfao) - #2063 Shaders: lower s_ff0_i32_b32 and s_ff0_i32_b64 in pure 32-bit DXIL (@⁠geiyiliyabumo) - #2070 Shaders: refuse the image instructions DXIL has no form of (@⁠0xkn0wh3r3) - #2077 Shaders: lower s_sext_i32_i8 and s_sext_i32_i16 in pure 32-bit DXIL (@⁠geiyiliyabumo) - #2083 Shaders: lower s_bitreplicate_b64_b32 in pure 32-bit DXIL (@⁠geiyiliyabumo) - #2111 GPU: the frame's wait for pipelines is one budget for all recording threads (@⁠r4tedx) - #2122 Shaders: query a buffer's size through a handle of its own (@⁠imjustprism) - #2141 HLE: registry lookups through kernelbase.dll reach the device-type overrides (@⁠BastienRodz) - #2150 Shaders: one instruction for one value (13.5 % fewer emitted instructions, no program lost) (@⁠r4tedx) - #2184 xmem: 32-bit XMemAllocDefault blocks get the alignment they ask for (@⁠BastienRodz) - #2224 GPU: validate execute_indirect buffer offsets against buffer bounds and u64 overflow (@⁠Xvania7) - #2229 Shaders: v_pk_fmac_f16 with DPP reads src0 from the selected lane (@⁠BastienRodz) - #2240 GPU: title memory copies are brought up to date again after a title write (@⁠denkencar-sketch) - #2254 Shaders: v_mad_i64_i32 sign-extends a 32-bit literal addend (@⁠BastienRodz) - #2269 GPU: marks in the last dword of the written-pages bitmap are not discarded (@⁠denkencar-sketch) - #2274 GPU: aliased textures copy only the subresources that have the same bytes per row (@⁠denkencar-sketch) - #2276 GPU: a depth texture used before it got a twin is copied to the twin in the list (@⁠denkencar-sketch) - #2278 GPU: a plain heap description is not read past its 16 bytes without checking they are mapped (@⁠denkencar-sketch) - #2295 GPU: the fifth dword of a root constants parameter is read as a constant (@⁠denkencar-sketch) - #2299 GPU: harden CopyMemoryToMemoryX against unmapped or read-only pages (@⁠denkencar-sketch) - #2303 GPU: page mapping copies wait for the submission that is running (@⁠denkencar-sketch) - #2361 Shaders: lower SOP2 s_pack_{ll,lh,hh}_b32_b16 (#815) (@⁠fuzeofficlal) - #2404 XG: preserve packed mip swizzle/positions and fix array subresource tiling (fixes issue 2400) (@⁠pushkarreddyy) - #2444 HLE: keep refilling XMA PCM buffer across zero-sample decode steps (@⁠Texbirds) - #2445 Loader: clamp VEH instruction reads to the faulting page in emulate_amd_only and sse4a (@⁠Texbirds) - #2450 Shader: check device removal before FMad readback (@⁠Damokles2) - #2476 Discover shaders and pipeline packs through file symlinks (@⁠DoubleD17) - #2501 Shaders: a BVH node offset from a root descriptor is computed in 64 bits (@⁠Calvix2k) - #2504 HLE: physical-page writes open the title's views before they write (@⁠BastienRodz) - #2515 Shaders: VOP3 f16 interpolation attr63.w is not a 32-bit literal (@⁠mgunes1311-lab) - #2553 HLE: avoid data race in DirectStorage late page-list polling (@⁠reeledMarek) - #2554 Loader: guard null C++ exception pointers in crash::thrown and Rsp overflow/alignment in unwind_into (@⁠reeledMarek) - #2576 GPU: read marks of slots forgotten before a submission are cleared before it runs (@⁠BastienRodz) - #2598 GPU: giving up a texture leaves the dynamic slots of recorded lists alone (@⁠BastienRodz) - #2622 Shaders: a constant branch through a folded block drops its untaken phi entry (@⁠BastienRodz) - #2630 PE: refuse a tls directory that runs outside the image (@⁠imjustprism) - #2639 GPU: texture bytes off the runtime's memory are read at each refresh, as buffer copies' are (#2638) (@⁠BastienRodz) - #2677 App: keep run paths stable when the title changes directory (@⁠jaschinski97-ops) - #2724 Shaders: texture reads at a computed table entry keep their read mark (#2722) (@⁠BastienRodz) - #2727 GPU: reject overflowing rectangle vertex ranges (@⁠fuzeofficlal) - #2776 shader: lower non-sum wave prefix operations to DXIL (@⁠JAEdotUK) - #2831 Shaders: dwords read from the first lane outside a waterfall's own reads are one lane's (#2829) (@⁠BastienRodz) - #2869 Shaders: a buffer descriptor made raw from first-lane reads needs its waterfall (#2867) (@⁠BastienRodz) - #2882 GPU: heaps are bound again after a cut when ours stand in for both kinds (#2881) (@⁠BastienRodz) - #2886 Shaders: preserve round mode changes in whole-wave sections (@⁠yumaste) - #2893 Shaders: find the normalized load rounding shift with one bit scan (@⁠Ingenioeren) - #2896 GPU: a list that binds no view heap gets ours before the root signature (#2894) (@⁠BastienRodz) - #2924 Shaders: reuse source-lane activity ballots (@⁠Ingenioeren) - #2954 Shaders: lower v_bfe_u32/v_bfe_i32 to one Ubfe/Ibfe (@⁠Ingenioeren) - #2980 GPU: a panic while making a host pipeline refuses it instead of ending the worker (@⁠Ingenioeren) - #3005 GPU: make already-used pipeline lookups read-only (@⁠AwsAli05) - #3007 Shaders: lower the 32-bit mul_hi forms to one UMul/IMul (@⁠Ingenioeren) - #3084 GPU: wait for queued presentation before resizing the swap chain (@⁠passerbyyhx) - #3092 Loader: keep concurrent crash records whole (@⁠neonbyte1) - #3098 GPU: reject truncated or corrupted shader refusal entries (@⁠yefan911) - #3131 Game: fix stencil write-mask reachability for NEVER/ALWAYS funcs (@⁠fuzeofficlal) - #3141 GPU: flush queued segments before evaluating memory and fence waits (@⁠fuzeofficlal) - #3195 HLE: keep async status waits attached through provider cleanup (@⁠andrewpozdnakov7-jpg) - #3221 fix(shader): preserve signed zero when f32 div:2 underflows (@⁠brainbudt) - #3243 Loader: skip DIR64 relocation addresses that overflow u32 (@⁠andrewpozdnakov7-jpg) - #3245 GPU: return pinned HostTexture from alias_source to avoid source Release UAF (@⁠fuzeofficlal) - #3248 GPU: preparing a view heap's page table scans the change tracker a word at a time (@⁠borosf) - #3257 GPU: fix PresentX subresource copy and plane format handling (@⁠fuzeofficlal) - #3266 GPU: back off texture heap growth after out-of-memory (@⁠yumaste) - #3272 HLE: wait for in-flight lifecycle callbacks on unregister (@⁠fuzeofficlal) - #3280 Fix issue 2412: reject out-of-range export addresses in parse_exports (@⁠tharun-37) - #3309 formats: guard XMA Bits::read and Bits::signed against shift overflow (@⁠SalmanBarkat) - #3316 Shaders: decode fixed 4-VGPR data and 4-SGPR rsrc for image_bvh_intersect_ray (@⁠mgunes1311-lab) ## Stage 2 - conflicts resolved by hand (18) - #1565 GPU: Evict succeeds, as the console's memory is never evicted (@⁠LouisRiverstone; conflicted with #1564) - #1566 GPU: SetStablePowerState is accepted and ignored (@⁠LouisRiverstone; conflicted with #1564) - #2272 GPU: a page a copy holds in part is taken after its marked copy-back (@⁠denkencar-sketch; conflicted with #2269) - #2297 GPU: a texture sampled before an in-list title memory copy is uploaded again after it (@⁠denkencar-sketch; conflicted with #2276) - #2415 GPU: remapping one mapping of aliased pages leaves the others guarded (@⁠BastienRodz; conflicted with #2269) - #2437 GPU: a marked copy-back advances the snapshot of declared ranges over its page (@⁠BastienRodz; conflicted with #2269) - #2474 GPU: refreshes of two parts of one page do not make it current whole (@⁠BastienRodz; conflicted with #2240) - #2296 GPU: rectangle vertices are read from title memory through the kernel at submission (@⁠denkencar-sketch; conflicted with #2295) - #2329 GPU: a list that binds a heap's view-address table keeps it until reset (@⁠denkencar-sketch; conflicted with #2295) - #1668 Shaders: read inline floats as f32 bits in 16-bit integer ops (@⁠Calvix2k; conflicted with #1327) - #1685 Shaders: lower v_cmp_{f,t}_{i64,u64} constant 64-bit compares (@⁠Calvix2k; conflicted with #1327) - #2792 fix(shader): allow untracked scalar lane masks in v_cndmask_b32 (@⁠legayclightning22; conflicted with #1327) - #2915 Shaders: f16 results ignore their output modifier, as RDNA2 does with half denormals kept (@⁠0xkn0wh3r3; conflicted with #1327) - #2457 Shaders: return zero for unused image_get_resinfo extents (@⁠makmatvey; conflicted with #1253) - #2587 Shaders: bind a zero dword for empty root-constant slices (@⁠fuzeofficlal; conflicted with #2515) - #2774 Shaders: validate raw fixtures and signed MAD64 with full-word regression (@⁠LogicGrove; conflicted with #2254) - #2953 Shaders: lower binary64 division fixup in DXIL (@⁠andrewpozdnakov7-jpg; conflicted with #2936) - #2958 Shaders: one lane of a wave sets a mark its wave shares (frames 411 -> 283 ms on an RTX 4070 SUPER) (@⁠moe-miau; conflicted with #2936) Fixes on top so the stage builds: #2415 opens pages through #2848's `open_runs`; #2457's and #1253's test helpers merged into one; #2437 keeps #2272's page take and adds its snapshot sync. ## Stage 3 - every other PR that merges and builds with the set (260) - #159 GPU: occlusion, statistics and timestamp queries run on the host (@⁠r4tedx) - #171 Shaders: lower v_mad_u64_u32 and v_mad_i64_i32 (@⁠n-romanovich) - #202 GPU: skip unmapped regions after a failed bulk read into host memory (@⁠ifBars) - #212 GPU, HLE: report host display HDR luminance and configure swap chain color space (@⁠n-romanovich) - #478 Audio capture: guard WASAPI timestamp underflow and stream silence writes (@⁠nathanbzrr) - #486 shader: opt the test binaries into an app-local Agility SDK runtime (@⁠naixue2233) - #491 GPU: remember pipelines whose creation crashed the process (VICTORY_PIPELINE_JOURNAL) (@⁠desplmfao) - #541 GPU: retain D3D12 object names in private data (@⁠broccolize) - #545 xtask: add qa command to run policy, rustfmt, and clippy checks (@⁠pushkarreddyy) - #601 GPU: bound texture upload and capture slices to the allocated buffer (@⁠AwsAli05) - #602 GPU: report retained snapshot, texture scratch and upload memory (@⁠lucaseddd) - #652 GPU: use selected mip extents for MSAA resolves (@⁠fuzeofficlal) - #927 GameInput: held keys are reported in the order they were pressed, as documented (@⁠BastienRodz) - #967 GPU: choose an adapter that can run the title, and name the ones that cannot (@⁠zzm1234560621-prog) - #1010 GPU: copy title memory into host memory without a system call (@⁠TG0000) - #1013 perf(shader): speed up control-flow structurisation (@⁠matheusfrta) - #1059 Loader: VICTORY_PATCH writes bytes into a loaded module after relocation (@⁠Halfect) - #1065 Shaders: use validator 1.8 for compute derivatives (@⁠Halfect) - #1113 Formats: lay out packed RGB textures as horizontal texel pairs (@⁠Razdva122) - #1174 HLE: implement IUnknown::QueryInterface and unit tests for xgame objects (@⁠geiyiliyabumo) - #1192 Loader: skip empty executable sections in tls::redirect and add tls.rs unit tests (@⁠geiyiliyabumo) - #1199 HLE: return NOT_SUPPORTED early for null out in QueryApiImpl without marking area missing (@⁠geiyiliyabumo) - #1212 HLE: expand synthetic unit tests for apu.rs (1 -> 19 tests) (@⁠geiyiliyabumo) - #1213 HLE: reject null handle in WinHttpSetOption proxy path and expand net.rs tests (1 -> 17) (@⁠geiyiliyabumo) - #1218 xtask: wine-test runs the Windows tests on a Linux host under Wine (@⁠neonbyte1) - #1224 fix(hle): coalesce split placeholders when mapping physical pages (@⁠matheusfrta) - #1262 Shaders: double-precision add, mul, fma, min, max, compares and conversions (stacked on #416) (@⁠MamaLeVrai) - #1264 HLE: map a page scatter in runs, not one page at a time (@⁠pablogonz12) - #1283 Clarify DRED reports when GPU progress is unknown (@⁠DoubleD17) - #1406 GPU: fix NULL/UNKNOWN SRV/UAVs on promoted-typeless textures and MSAA/array/3D NULL RTV/DSVs (@⁠ESAT586) - #1432 HLE: set ERROR_PROC_NOT_FOUND for missing pseudo-module exports (@⁠fuzeofficlal) - #1434 Loader: match title DLL filenames ignoring ASCII case (@⁠fuzeofficlal) - #1445 HLE reuses freed physical page numbers (@⁠BaggyALPHA) - #1571 GPU: add diagnostics for shader dependency wait times (@⁠srijann07) - #1584 GPU: add opt-in idle shader cache trimming (@⁠srijann07) - #1625 CLI: compare runtime shader failures with offline coverage (@⁠srijann07) - #1676 Shaders, CLI: name a host without mesh shaders in the pipeline census (@⁠fiestorra) - #1700 GPU: say when a draw's render target has no host copy or lost its permission (@⁠fiestorra) - #1701 GPU: VICTORY_MODE overrides the reported console display mode (@⁠Calvix2k) - #1712 victory-shader: support line-topology mesh shaders (@⁠tjthebigbearcat-hub) - #1716 victory-shader: fold constants and eliminate dead pure ops in bitcode (@⁠bartikele) - #1717 HLE: the retail console ID has the documented dotted form (@⁠davutsimsekk) - #1722 GPU: the host pipeline library works under Wine (null blob for an empty library) (@⁠Impre-visible) - #1732 GPU: f32_to_half keeps NaN and rounds normals to nearest even (#843) (@⁠moe-miau) - #1763 GPU: refuse typed UAVs in unsupported formats regardless of family or castability (@⁠n-romanovich) - #1772 HLE: handle verbatim/drive-root mounts and UNC/verbatim GetDiskFreeSpaceW roots (@⁠n-romanovich) - #1776 GPU: exclude 4:2:2 packed formats 68/69 from castable texture formats (@⁠0xKaji) - #1792 Formats: reject texture mip counts beyond the full chain (@⁠VlREX) - #1796 Core: report unreadable implicit configuration files (@⁠VlREX) - #1797 XMA: reject frame starts in packet headers (@⁠VlREX) - #1802 Perf/shader relative shift bounds (@⁠VlREX) - #1814 PE tests: cover ImportLibrary::parse short imports and archive errors (@⁠n-romanovich) - #1825 GPU: keep the view-stride table once per list, not per draw stage (@⁠slatefield) - #1840 Shaders: discover irreducible loops with iterative SCC decomposition (@⁠VlREX) - #1846 Shaders: worklist register liveness with 96 independent synthetic CFG… (@⁠VlREX) - #1849 GPU: free memory is not the runtime's to watch (fixes a world-load deadlock under Wine) (@⁠crashbashash) - #1862 GPU: index bindless texture slots for targeted release and preserve u… (@⁠VlREX) - #1866 Game: preserve sample masks in prebuilt graphics pipelines (@⁠necrobytes) - #1871 Shaders: lower indexed tbuffer_load_format_* and indexed buffer_store_{byte,short} (@⁠ESAT586) - #1884 Perf/memory guard batching (@⁠VlREX) - #1892 Tests: every GPU test module takes the shared lock, which diff_tests did not (@⁠fiestorra) - #1894 GPU: pool mapped upload buffers across command list resets (@⁠n-romanovich) - #1903 Shader: the ray test's triangle multiplies stay apart from their adds (@⁠kais7654) - #1907 victory-shader: honor unwritten OSG1 channels and output modes in rectangle_gs (@⁠mgunes1311-lab) - #1920 Shaders: v_mad_f32 and v_mac_f32 multiply apart from their add (@⁠kais7654) - #1927 Shaders: d16 format loads saturate 32-bit integer channels (@⁠upipibi) - #1933 victory-gpu: keep depth-twin UAVs in concrete UAV formats and support default views (@⁠mgunes1311-lab) - #1943 Shaders: the null-buffer reads of the heap skip a host that caps its heaps (@⁠kais7654) - #1946 Descriptors: null UAV for packed 16-bit formats D3D12 refuses (@⁠Biewlhenrique) - #1947 HLE: a live range takes a guard page, and a mapped range is not a placeholder (@⁠fiestorra) - #1966 Crash reports: keep them when stderr is closed (@⁠imjustprism) - #1975 HLE: match rpcrt4 UuidFromString nil-UUID and canonical string rules (@⁠mgunes1311-lab) - #1981 Preserve the last complete save when a newer version is missing a blob (@⁠WerG0D) - #1991 Shader tests: skip the GPU suites a device cannot run (@⁠Calvix2k) - #1994 Shaders: floor, ceil and fract read denormals as zeros (@⁠astrosteveo) - #1995 CLI: recommend a DXIL validator in translate --help (@⁠AlanQiang0418) - #2005 GPU: log the missing D3D12 1.7 (no castable texture formats) (@⁠Calvix2k) - #2018 Docs: rustdoc builds the GPU crate again (shader_cache's private link) (@⁠Gruzzberry) - #2020 Shaders: abs / neg on the shift-add and align ops act on the sign bit (@⁠upipibi) - #2022 xmem: an aligned XMemAllocDefault block is padded once, not twice (@⁠0xkn0wh3r3) - #2026 Formats: bounds-check a detiled row once, not each run in it (@⁠0xkn0wh3r3) - #2039 CLI: resolve same-directory title DLL exports in census (@⁠fuzeofficlal) - #2041 Shaders: the fused multiply-add probe binds a sampler heap (@⁠0xkn0wh3r3) - #2065 HLE: allow oleaut32.dll in default host policy (@⁠fuzeofficlal) - #2072 HLE: an unknown gamertag component is an invalid argument (@⁠0xkn0wh3r3) - #2074 DirectStorage: a queue submits itself past half its capacity, not at half (@⁠0xkn0wh3r3) - #2076 HLE: implement remaining XAccessibility closed-caption, high-contrast, and speech-to-text slots (@⁠fuzeofficlal) - #2079 Shaders: a relative move's program is built at its full range only if no bound is proven (@⁠0xkn0wh3r3) - #2094 Shaders: lower v_add_nc_i32, v_sub_nc_i32, v_add_nc_i16, and v_sub_nc_i16 in pure 32-bit DXIL (@⁠geiyiliyabumo) - #2115 CLI: translate --count counts the instructions of the emitted shaders (@⁠r4tedx) - #2118 GPU: the BVH builder runs whole or not at all (@⁠0xkn0wh3r3) - #2134 GPU tests: a world frame's preparing at the published volumes (benchmark) (@⁠r4tedx) - #2139 HLE: implement synchronous XGameSave slots and unfiltered blob enumeration (@⁠fuzeofficlal) - #2142 GPU: read small buffer diagnostics via read_into instead of VirtualQuery (@⁠fuzeofficlal) - #2152 Shaders: lower ds_permute_b32 and ds_nop (@⁠fuzeofficlal) - #2173 GPU: handle typed D16/D32 and multisample depth twins (@⁠fuzeofficlal) - #2187 GPU: a readable texture does not share a host texture denied to shaders (@⁠fuzeofficlal) - #2188 Testing: compare Windows benchmark runs with memory and time limits (@⁠Razdva122) - #2195 GPU tests: the library test's shaders compile with Wine's compiler too (@⁠winne42) - #2196 GPU tests: root signatures made from each shader's RS string (@⁠winne42) - #2235 GPU: a title memory copy left out of a page table is named when slots come back (@⁠denkencar-sketch) - #2250 GPU: pipeline workers take their count from VICTORY_PIPELINE_THREADS (@⁠kotekompotek) - #2265 Tests: allow the frame clock to skip ticks after a late frame (@⁠andrewpozdnakov7-jpg) - #2283 GPU: a fast content digest for untracked textures, and their commit check kept per remap epoch (@⁠alessiodeia) - #2284 Shader tests: cover the merged geometry user-data layout (@⁠Halfect) - #2320 Preserve signed R16 contrast in PNG captures (@⁠DoubleD17) - #2321 Report effect databases in shader-info effects mode (@⁠DoubleD17) - #2333 Shaders: buffer byte and half stores of a VGPR's high half (_d16_hi) (@⁠TinkerBell-90) - #2344 Shaders: name the operation kind a whole-wave section the simulation cannot follow (@⁠borosf) - #2386 Shaders: a DPP step over a lane set the section names stays followed (@⁠borosf) - #2387 Shaders: track SGPR origins across cancelling s_xor_b32/b64 swaps (#815) (@⁠fuzeofficlal) - #2392 HLE: a null or empty subkey opens the emulated OEM key itself (#765) (@⁠KainanP) - #2406 Shaders: s_cbranch_vccz/vccnz tests raw VCC, not VCC & EXEC (@⁠makmatvey) - #2443 GPU: expose IDXGIObject on emulated DXGI interfaces (@⁠Damokles2) - #2452 HLE: DirectStorage open_file shares write/delete and keeps LastError (@⁠makmatvey) - #2483 DSP: the reverb convolver passes the host checks (rebased #240) (@⁠kais7654) - #2486 GPU: keep constant nonzero targets visible in captures (@⁠andrewpozdnakov7-jpg) - #2491 Shaders: intersect compare bounds with existing range bounds in Ranges::edge_hi (@⁠reeledMarek) - #2508 tools: add bounded Windows benchmark script (@⁠The-Star-World) - #2509 GPU: upload the stencil plane with guest textures (@⁠andrewpozdnakov7-jpg) - #2511 XGameSave: refuse an update when no version number is above the highest (#2497) (@⁠Creaa) - #2512 GameInput: look up only devices already seen by the process (@⁠andrewpozdnakov7-jpg) - #2516 GPU capture: decode XR-biased RGB before image scaling (@⁠andrewpozdnakov7-jpg) - #2520 Shaders: walk a predecessor's live-out registers once instead of searching it per register (@⁠liandraraiane) - #2522 HLE: retain pending_with state across cancellation and prevent stale block completions (@⁠reeledMarek) - #2524 HLE: bounds-check all four bytes of ACP notification writes in audio::submit (@⁠reeledMarek) - #2575 Game: short-circuit pipeline state enumeration once wanted hashes are found (@⁠reeledMarek) - #2578 Core: ignore empty VICTORY_LOG and RUST_LOG values instead of overriding default log level (@⁠reeledMarek) - #2579 Core: ignore empty LOCALAPPDATA, XDG_CACHE_HOME, and HOME in default directory resolution (@⁠reeledMarek) - #2588 Decode RGB9E5 in diagnostic PNG captures (@⁠DoubleD17) - #2589 Diagnostics: preserve the world capture draw count (@⁠andrewpozdnakov7-jpg) - #2591 Formats: add a runnable BC5 record reconstruction shader example (@⁠Dathinel) - #2592 CLI: reject VS+GS graphics pipelines in prebuild (@⁠fuzeofficlal) - #2599 GPU: read UAV MipSlice from offset 8 in image_words (@⁠fuzeofficlal) - #2605 GPU: waits on memory that cannot be read are counted apart (#2604) (@⁠BastienRodz) - #2607 Diagnostics: decode signed 32-bit color captures (@⁠andrewpozdnakov7-jpg) - #2617 HLE: hold DirectStorage reads behind held status entries and preserve sequence order (@⁠fuzeofficlal) - #2618 XAsync: a result size of 0 when there is no result to take (@⁠F1reworks10) - #2642 Check staged file type changes in the asset policy hook (@⁠maxence468) - #2648 BCPack: stop completed lanes from taking another lane’s bytes (@⁠chaseb64) - #2649 BCPack: retain a partial rANS refill at a fragment boundary (@⁠chaseb64) - #2658 Game tests: cover CityHash64 length and block boundaries (@⁠XeNS1) - #2659 Loader (diagnostics): VICTORY_POKE writes through the page's protection (@⁠kotekompotek) - #2663 Formats/XMA: add 10-bit VLC lookup table, u64 bit-peek, and quant-factor LUT (@⁠RVZO6) - #2666 GPU diagnostics: end draw traces at every present (@⁠andrewpozdnakov7-jpg) - #2680 GPU: keep edge samples in odd-sized diagnostic PNGs (@⁠andrewpozdnakov7-jpg) - #2690 GPU: report default buffer alignment from GetDesc (@⁠andrewpozdnakov7-jpg) - #2708 Find the first XMA frame when a buffer starts with continuation data (@⁠VlREX) - #2710 Apply outstanding XMA sample skips to the final overlap (@⁠VlREX) - #2714 Keep XMA input valid when looping back to the start of a buffer (@⁠VlREX) - #2715 Clear stale button and key state in GameInput output buffers (@⁠VlREX) - #2720 Preserve ambiguous legacy XGameSave migrations (FIND-23) (@⁠leftmove) - #2741 PE: reject null IAT RVAs in non-empty import descriptors (@⁠fuzeofficlal) - #2742 HLE: validate XMemMapPhysicalPages inputs before unmapping and roll back partial runs (@⁠fuzeofficlal) - #2745 HLE: succeed DisableThreadLibraryCalls for pseudo-module handles (@⁠fuzeofficlal) - #2749 XTaskQueue: every queue using a port hears of a task submitted to it (@⁠F1reworks10) - #2756 GPU: capture the mip selected by 2D render-target views (@⁠andrewpozdnakov7-jpg) - #2763 GPU: inherit typed formats in explicit RTV and DSV descriptions (@⁠andrewpozdnakov7-jpg) - #2765 Shaders: scratch with neither address names no register (GFX10.3 ST mode) (@⁠Moon0755) - #2782 Shaders: read known FP16/FP64 rounding mode bits (@⁠andrewpozdnakov7-jpg) - #2784 Shaders: build Halves def/phi table lazily as a compact Vec<Def> in io::raise (@⁠RVZO6) - #2793 Shaders: signature rows of one register follow their name offsets (@⁠Moon0755) - #2794 Game: truncate oversized inflated stream to pack size in shaderpack::find (@⁠GuckstduWeitaaa) - #2795 Formats: speed up XMA2 inverse MDCT by 24-29% (@⁠brainbudt) - #2797 Loader: accept identical destination when concurrent publish rename fails (@⁠fuzeofficlal) - #2800 Shaders: SP3 text names a discard's address and position target four (@⁠Moon0755) - #2804 GPU tests: what marking written title pages costs, per way of marking (benchmark for #2167, #2175, #2465, #2755) (@⁠0xkn0wh3r3) - #2805 GPU tests: assert a missed submission through readback (@⁠andrewpozdnakov7-jpg) - #2806 GPU tests: what translated 16-bit float math costs against the host's (34x on an RTX 5070 Ti; for #2384) (@⁠0xkn0wh3r3) - #2808 Shaders: speed up DXBC container MD5 hashing by 16-43% (@⁠brainbudt) - #2812 shader: a comparison sampler replaces the reduction instead of OR-ing into it (@⁠spy0eye-beep) - #2817 Shaders: pixel DPP8 within a quad reads through quad operations; common quad patterns take one (@⁠0xkn0wh3r3) - #2820 GPU tests: a benchmark of what list calls cost on the title's threads (@⁠0xkn0wh3r3) - #2823 Shaders: the neg input modifier flips a NaN's sign too (@⁠xKineticK) - #2828 Pipeline cache: verify content when accepting a racing publication (@⁠andrewpozdnakov7-jpg) - #2838 CLI: reject conflicting shader-info output modes (@⁠109User109) - #2839 CLI: flag files configured as directories (@⁠109User109) - #2850 GPU: refresh table CBVs on fresh_tables cache hits (@⁠fuzeofficlal) - #2855 xmem: a refused XMemVirtualAlloc leaves the host's reason in the last error (@⁠0xkn0wh3r3) - #2858 CLI: inspect names each section's flags (@⁠wilu222) - #2866 Translate: count the instructions on 16-bit floats (for #2384, #2825) (@⁠xndbogdan) - #2875 GPU: loose windows can sit in video memory the CPU writes (@⁠Luislariosss) - #2884 Shaders: round packed FP16 fused multiply-add once in nearest-even mode (@⁠andrewpozdnakov7-jpg) - #2887 HLE: a title's ExitProcess is logged as its exit is (@⁠0xkn0wh3r3) - #2889 GPU tests: read back cleared constant buffer descriptors (@⁠andrewpozdnakov7-jpg) - #2901 GPU: return S_FALSE when private data is already absent (@⁠andrewpozdnakov7-jpg) - #2902 HLE: a module name with a trailing dot gets no .dll appended (@⁠pawrenity) - #2904 DirectStorage: workers read a file through a handle each (@⁠0xkn0wh3r3) - #2909 GPU: reject empty query heaps at creation (@⁠andrewpozdnakov7-jpg) - #2910 GPU: fit fallback host window to work area and honor VICTORY_WINDOW_MAX (@⁠alexandruiulian201-bot) - #2913 GPU: an argument clamp Wine's compiler builds too (carries #1279) (@⁠arogan178) - #2919 GPU: the depth converter Wine's compiler builds too (@⁠arogan178) - #2923 Shaders: require EXEC coverage when tracing VALU address operands (@⁠fuzeofficlal) - #2931 GPU: match failed feature-level query results (@⁠andrewpozdnakov7-jpg) - #2935 GPU: count accepted presents while keeping title frames advancing (@⁠UwUCammie) - #2947 GPU: reject unknown shader model feature requests (@⁠andrewpozdnakov7-jpg) - #2950 Game: the shader pack in an archive inflates through zlib-rs (@⁠0xkn0wh3r3) - #2952 GPU: disable implicit stream depth test without a DSV format (@⁠fuzeofficlal) - #2961 GPU: reject shader-visible RTV and DSV heap creation (@⁠andrewpozdnakov7-jpg) - #2962 GPU: sample packed 10-bit frames for black-frame diagnostics (@⁠andrewpozdnakov7-jpg) - #2968 Shaders: f32 floor, ceil and fract flush denormal operands (@⁠neonbyte1) - #2989 Loader: verify OpenThread owner PID before reading thread stack (@⁠fuzeofficlal) - #2990 HLE: skip junctions in the persistent-storage quota count (@⁠Halfect) - #2991 Loader: clear XMM0 in ReturnZero thunk stubs for floating-point imports (@⁠fuzeofficlal) - #2998 HLE: deliver initial XNetworking registration callbacks and track unregister tokens (@⁠fuzeofficlal) - #3002 GPU: an early list reset leaves a held host list it cannot replace (@⁠ZeOs360) - #3013 GPU: keep untracked pages writable in Tracked::taken (@⁠fuzeofficlal) - #3015 App: check transitive static imports of mapped title DLLs for missing files (@⁠fuzeofficlal) - #3020 CLI: count all SGD5 hashes and stripped-bitcode XDAT/xbop markers in shader-info (@⁠fuzeofficlal) - #3022 GPU: read D24S8 and D32S8 planes into guest buffers (@⁠andrewpozdnakov7-jpg) - #3026 xtask: bound policy file reads and report read errors (@⁠fuzeofficlal) - #3034 GPU: require texture copy footprints to fit a complete row (@⁠andrewpozdnakov7-jpg) - #3038 Shaders: keep spilled compute root parameters from claiming s16+ system SGPRs (@⁠fuzeofficlal) - #3049 Game: recover SGD5 records from unparsed databases alongside intact ones (@⁠fuzeofficlal) - #3056 Shaders/Lower: guard global_atomic_fmin and global_atomic_fmax against NaN operands (@⁠RVZO6) - #3061 GPU: a draw's table entries are looked up once (@⁠0xkn0wh3r3) - #3079 gpu: vectorize merge_writeback with 64-bit word chunks (@⁠AdvaitPalve11) - #3085 GPU tests: a freed test pool keeps its addresses, and mark tests hold off submissions (@⁠0xkn0wh3r3) - #3099 GPU: drop only marked pages for withheld marked ranges (@⁠fuzeofficlal) - #3104 HLE XGameSave: tolerate locked old or unfinished version cleanup (@⁠fuzeofficlal) - #3105 HLE GameInput: expand per-device reading history to 256 (@⁠fuzeofficlal) - #3111 Formats/BCPack: restrict BC7 channel rotation to modes 4 and 5 (@⁠RVZO6) - #3119 GPU: initialise new page tables to their null view pair (@⁠fuzeofficlal) - #3121 HLE media: block UNC share bypasses for localhost and \??\ file URLs (@⁠Arkenoz) - #3126 Formats XMA: reject truncated quant_step escape sequences (@⁠Arkenoz) - #3127 Shaders: v_cubesc/tc_f32 keep denormal coordinates, v_cubema_f32 of a zero is +0 (@⁠Moon0755) - #3133 xmem: coalesce low-4 GiB guards on retry when no single guard fits (@⁠fuzeofficlal) - #3134 HLE: reject failed GetLogicalDrives() mask when mounting virtual drives (@⁠fuzeofficlal) - #3140 GPU: restrict texture resource states to legal direct-queue write and read combinations (@⁠fuzeofficlal) - #3142 Shaders: lower a subtract atomic as an add of the wrapping negation (@⁠Mdemets) - #3162 GPU: a list used twice in one submission gets a prelude per use (@⁠kotekompotek) - #3163 GPU: device slots 0x1c8 and 0x218 fail on purpose, with no object (@⁠arogan178) - #3167 GPU: a pipeline a list binds again is not kept and named again (@⁠pablogonz12) - #3169 GPU: drain fence wait counts and durations together (@⁠andrewpozdnakov7-jpg) - #3172 hle: reject null tiling out when the count is nonzero (@⁠cloph-dsp) - #3180 Add a synthetic D3D12 wave64 regression for independently looping waves (@⁠carlosmegino) - #3184 GPU: list calls can translate on worker threads (VICTORY_DEFER_LISTS, opt-in) (@⁠AurumCarlos) - #3185 GPU: round fallback footprint size up to alignment (@⁠reeledMarek) - #3187 Shaders: continue scanning wave sections past an unmatched saveexec (@⁠reeledMarek) - #3190 HLE: honor available disk space in storage prompts (@⁠andrewpozdnakov7-jpg) - #3198 GPU: a placed texture without a host texture gives back its slot (@⁠kotekompotek) - #3203 Shader test: skip 64-bit image atomics where the format has none (@⁠zzm1234560621-prog) - #3208 pe: bound data directory offset by optional header size (@⁠cloph-dsp) - #3215 GPU: a read slot is resolved once, not twice (@⁠borosf) - #3225 GPU: a command queue's SuspendX and ResumeX succeed (@⁠JurajSimicevic) - #3231 HLE: keep KernelWrite leases across pending overlapped and scatter reads (@⁠kilvynsilveira-tech) - #3232 GPU: batch page-table rebuilds by region and owner (@⁠yumaste) - #3256 loader: stop clzero loop emulation before address wraparound (@⁠cloph-dsp) - #3259 GPU: use smaller staging chunks after allocation failure (@⁠yumaste) - #3262 GPU: a page's saved bytes are read into an unzeroed buffer (@⁠Creaa) - #3273 HLE media: translate \??\<drive> paths through the virtual drives (@⁠andrewpozdnakov7-jpg) - #3278 fix(loader): accelerate 15-byte CLZERO loops with page-readability caching (@⁠legayclightning22) - #3283 Tests on Windows 10: skip four tests that need shader model 6.6 / ID3D12Device10 / an SM 6.6 WARP (#1999) (@⁠lerapeurdu62280-debug) - #3284 feat(hle): add opt-in hidden window mode for lifecycle stand-in (@⁠legayclightning22) - #3299 Shaders: avoid overwriting mesh indices when every slot is exported (@⁠andrewpozdnakov7-jpg) - #3304 shader: multiply all three PSV0 thread dimensions and keep output maxima in mesh_stride (@⁠fuzeofficlal) - #3310 HLE: match host DLLs behind lifecycle and CRT API sets (@⁠fuzeofficlal) - #3313 GPU: count single-list submissions in the GPU timing summary (@⁠neonbyte1) - #3315 GPU: validate ByteStride alignment and root signature in signature::create (@⁠mgunes1311-lab) - #3317 HLE: preserve ERROR_TLW_WITH_WSCHILD and close relaunch duplicate handle (@⁠mgunes1311-lab) ## Merge and build, but their tests fail with the set (merge reverted in this branch) - #2012 Shaders: decode finds instructions in a table by dword, not a tree (@⁠0xkn0wh3r3): its table decoder fails the decoder tests of the set ("instruction runs past the end of the code"; 338 tests) - #1937 Codex/fix gpu castable test 2026 11 25 (@⁠lollo1977): castable-format test fails with the set - #1759 Shaders: lower numerical Wave32 mesh masks at uniform entry (@⁠aycow): mesh mask test fails with the set - #1942 GameInput: answer IUnknown and own-IID queries on the COM objects (re-lands #1641) (@⁠Calvix2k): GameInput QueryInterface test fails with the set - #2557 GameInput: deliver registered reading callbacks (@⁠andrewpozdnakov7-jpg): GameInput reading-callback test fails with the set - #3132 HLE: preserve non-S_OK success HRESULTs in xasync::finished (@⁠fuzeofficlal): xasync completion-status test fails with the set - #2336 GPU: list only pipelines retained by the host library as prebuilt (@⁠andrewpozdnakov7-jpg): prebuilt-pipeline listing test fails with the set One test fails only when the whole suite runs in parallel: `lifecycle::tests::relaunch_closes_its_duplicated_process_handle` (from #3317) counts the process handles while other tests open theirs; alone it passes 3 of 3. ## Covered by a PR already in the build - #2327 GPU: a save that fails gives its changes back for the next one: #1653 already serialises saves under one lock and keeps the marks of a failed save - #2328 GPU: pipeline library saves run one at a time: #1653 already holds one lock from serialising to the last file - #166 Shaders: lower s_bitset{0,1}_b64, s_brev_b64 and s_bitreplicate_b64_b32: duplicate of #2083 (same instruction lowered twice) ## Need a rebase onto this set Semantic conflicts with stage 1 (17): - #1437 Shaders: preserve the unwritten high half of packed D16 image loads (conflicts with #1253) - #1577 Shaders: expand 64-bit inline constants as signed ints and binary64 floats (conflicts with #1327 #2831) - #2104 Shaders: lower s_wqm_b32 and s_wqm_b64 in pure 32-bit DXIL (conflicts with #2083 #2361) - #2178 GPU+shader: back structured buffer views with raw descriptors for NVIDIA rawBufferLoad (conflicts with #1859) - #2238 Watch: dropping a tracker keeps a mapping guarded while a tracker holds its alias (conflicts with #2848) - #2293 GPU: a slot rewritten during a run keeps its view's copy of title memory until the run is over (conflicts with #1859) - #2294 GPU: a typed depth format in a shader resource view is made in the readable colour format (conflicts with #1859) - #2363 GPU: descriptor dwords read as data — the record count and the format (conflicts with #1859) - #2435 GPU: give screen passes dedicated pipeline workers and wait budget (fixes issue 2433) (conflicts with #1993 #2111) - #2788 Audio: XMA decoding keeps up while frames are slow (MMCSS thread, the mixer never waits for a decode) (conflicts with #2444) - #2821 GPU: title threads recording lists no longer wait on descriptor and buffer-copy locks (conflicts with #2848 #2936 #2598) - #2943 Shaders: pack half FMA NaNs directly (conflicts with #2893 #2954 #3007) - #3151 Shaders: pass SignedOpKind::Signed for float dx.op.wavePrefixOp (conflicts with #2936 #1540 #2893 #2954 #3007) - #3155 Shader: a load through a built CODE descriptor starts the constant table at the byte it reads (conflicts with #1540) - #3227 GPU: keep fences alive while queues wait on them (conflicts with #3141) - #3247 GPU: the held-work pump reads each wait's word once, and answers its own blocked question (conflicts with #3141) - #3300 gpu: scale dynamic descriptor pool on capped heaps (NVIDIA) (conflicts with #2683) Merge, but break the build together with the set (11): - #450 GPU: preserve typed null render target slots: `crates\victory-gpu\src\query.rs:442:32: error[E0308]: mismatched types: expected `Option<&ID3D12Resource>`, found `&ID3D12Resource` | crates\victory-gpu\src\tex` - #1201 Loader: free mapped module on TLS redirect error and add windows.rs unit tests: `crates\victory-loader\src\windows.rs:594:21: error[E0061]: this function takes 3 arguments but 2 arguments were supplied | crates\victory-loader\src\windows.rs:` - #1335 test(shader): translate random GFX10 programs on every test run: `crates\victory-shader\src\emit\random_tests.rs:506:39: error[E0616]: field `words` of struct `Instruction` is private: private field | error: could not compile ` - #1614 Shader tests: a cross-device VALU fuzzer (hardware adapters vs WARP): `crates\victory-shader\src\emit\fuzz_tests.rs:716:12: error: cannot construct `host::Host` with struct literal syntax due to private fields | error: could not co` - #2001 HLE: resolve the local machine name to loopback: `crates\victory-hle\src\modules\net.rs:1315:17: error[E0425]: cannot find function `resolvable` in this scope: not found in this scope | crates\victory-hle\src\m` - #2066 Net: forward zero-address datagram disconnects: `crates\victory-hle\src\modules\net.rs:2347:5: error[E0428]: the name `v6` is defined multiple times: `v6` redefined here | error: could not compile `victory-hle` - #2223 GPU: account for pending pipelines before promotion: `crates\victory-gpu\src\pipeline\make.rs:713:31: error[E0599]: no method named `load` found for struct `std::sync::Once` in the current scope: method not found i` - #2372 Shaders: 16-bit gradient samples (_g16) and a16 independently, in decoding and lowering (#1116): `crates\victory-shader\src\gfx10\fields.rs:876:9: error[E0063]: missing field `len` in initializer of `gfx10::Instruction`: missing `len` | crates\victory-shader` - #2396 GPU: wire DeserializeComputePipelineStateX to assemble ACCC: `crates\victory-gpu\src\pipeline.rs:810:5: error[E0061]: this function takes 5 arguments but 4 arguments were supplied | error: could not compile `victory-gpu` (` - #2608 GPU: split and flush command list segments after texture read-backs: `crates\victory-gpu\src\hold.rs:521:32: error[E0063]: missing field `flush_after` in initializer of `hold::World<'_, _>`: missing `flush_after` | error: could no` - #3088 Shaders: match whole entries in the PSV0 string table: `crates\victory-shader\src\emit\container.rs:604:25: error[E0063]: missing field `validator18` in initializer of `emit::container::Psv<'_>`: missing `validator18` Conflict with the set (541): #76, #189, #200, #223, #233, #320, #385, #387, #395, #439, #465, #485, #509, #511, #517, #551, #559, #583, #594, #606, #642, #673, #926, #969, #970, #1114, #1142, #1178, #1210, #1211, #1217, #1223, #1244, #1256, #1271, #1300, #1312, #1315, #1396, #1408, #1414, #1422, #1428, #1449, #1460, #1462, #1473, #1493, #1546, #1547, #1548, #1555, #1569, #1630, #1639, #1687, #1693, #1704, #1715, #1731, #1738, #1767, #1769, #1777, #1786, #1793, #1803, #1807, #1816, #1817, #1818, #1819, #1821, #1832, #1855, #1856, #1868, #1880, #1885, #1888, #1897, #1904, #1908, #1917, #1934, #1935, #1936, #1939, #1940, #1953, #1957, #1958, #1959, #1963, #1964, #1974, #1978, #1984, #1985, #1986, #1998, #2014, #2035, #2051, #2053, #2075, #2084, #2085, #2088, #2089, #2091, #2092, #2095, #2096, #2097, #2098, #2099, #2102, #2106, #2117, #2121, #2126, #2128, #2129, #2136, #2146, #2149, #2165, #2166, #2167, #2168, #2176, #2177, #2182, #2193, #2194, #2199, #2201, #2205, #2207, #2208, #2210, #2211, #2225, #2226, #2230, #2249, #2251, #2273, #2279, #2282, #2292, #2298, #2309, #2310, #2312, #2314, #2319, #2325, #2331, #2332, #2341, #2342, #2350, #2358, #2362, #2367, #2382, #2385, #2389, #2397, #2398, #2399, #2405, #2408, #2422, #2423, #2427, #2428, #2429, #2430, #2441, #2442, #2447, #2459, #2460, #2461, #2467, #2472, #2480, #2490, #2492, #2494, #2506, #2510, #2518, #2519, #2527, #2528, #2532, #2533, #2540, #2542, #2543, #2548, #2549, #2556, #2558, #2559, #2562, #2566, #2567, #2569, #2573, #2581, #2585, #2594, #2595, #2596, #2600, #2601, #2603, #2606, #2610, #2612, #2614, #2615, #2619, #2620, #2623, #2625, #2626, #2627, #2628, #2629, #2632, #2633, #2636, #2644, #2646, #2647, #2654, #2655, #2657, #2662, #2664, #2665, #2667, #2668, #2672, #2673, #2675, #2678, #2679, #2686, #2694, #2698, #2702, #2703, #2704, #2705, #2709, #2711, #2713, #2718, #2721, #2726, #2728, #2729, #2731, #2732, #2733, #2735, #2736, #2738, #2740, #2743, #2747, #2755, #2757, #2761, #2766, #2767, #2768, #2769, #2771, #2785, #2786, #2787, #2789, #2791, #2796, #2798, #2799, #2802, #2803, #2809, #2810, #2811, #2816, #2818, #2819, #2825, #2827, #2830, #2832, #2834, #2837, #2840, #2841, #2844, #2846, #2849, #2859, #2864, #2868, #2871, #2872, #2873, #2874, #2877, #2878, #2879, #2883, #2885, #2888, #2890, #2891, #2895, #2897, #2898, #2899, #2900, #2903, #2905, #2906, #2907, #2908, #2911, #2914, #2916, #2917, #2918, #2925, #2926, #2928, #2938, #2940, #2941, #2942, #2948, #2951, #2955, #2956, #2957, #2959, #2960, #2965, #2969, #2970, #2971, #2972, #2973, #2974, #2975, #2977, #2979, #2981, #2982, #2983, #2984, #2985, #2986, #2987, #2988, #2992, #2993, #2994, #2996, #2997, #2999, #3003, #3006, #3008, #3009, #3010, #3016, #3018, #3021, #3023, #3025, #3027, #3029, #3032, #3035, #3039, #3041, #3043, #3044, #3046, #3047, #3048, #3050, #3052, #3053, #3057, #3064, #3065, #3067, #3068, #3069, #3075, #3078, #3080, #3082, #3083, #3086, #3090, #3091, #3093, #3095, #3096, #3102, #3106, #3107, #3108, #3109, #3112, #3113, #3114, #3115, #3117, #3120, #3122, #3124, #3125, #3128, #3129, #3136, #3138, #3139, #3143, #3144, #3145, #3147, #3148, #3149, #3150, #3152, #3153, #3154, #3156, #3157, #3158, #3159, #3160, #3161, #3164, #3166, #3168, #3170, #3173, #3174, #3175, #3176, #3177, #3181, #3182, #3183, #3186, #3188, #3189, #3191, #3193, #3194, #3197, #3199, #3201, #3202, #3204, #3205, #3206, #3207, #3209, #3211, #3212, #3213, #3214, #3216, #3217, #3218, #3220, #3222, #3224, #3226, #3228, #3229, #3230, #3233, #3234, #3236, #3238, #3239, #3242, #3244, #3246, #3249, #3250, #3251, #3252, #3254, #3255, #3258, #3260, #3263, #3264, #3265, #3267, #3268, #3274, #3275, #3276, #3281, #3282, #3286, #3287, #3288, #3289, #3290, #3292, #3293, #3294, #3296, #3297, #3302, #3305, #3307, #3308, #3312, #3318, #3319 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The ISA's special cases in its order: a NaN numerator or denominator comes
back quieted, 0/0 and inf/inf give NaN, x/0 and inf/x a signed infinity,
0/x and x/inf a signed zero, otherwise |S0| with the quotient's sign.
Worked on the f32 values of the f16 operands, which are exact.
The ISA's "exponent of S0 all ones -> overflow" check runs before the
final |S0| case, so a NaN quotient with a finite, non-zero numerator and
denominator gives sign | infinity, as measured on gfx1036 hardware. The
zero, infinity and invalid checks still come first.
XGameSave permits only one write or delete per blob in an update. WriteBlob and DeleteBlob accepted repeats and submit silently kept the last one, so a title could pass locally but fail on a console. Refuse a second change to a blob already in the update, update the existing test that relied on write-then-delete, and keep the first change.
VICTORY_SHADER_LOOP_LIMIT was read only with the diagnostics feature, so a
release build could not run the experiment another VIctory fork reports as a
~6x GPU time win. It is now honoured in every build, with the default (2^20)
unchanged, values from 2^31 clamped to i32::MAX (the emitted counter is an i32
compared unsigned, so a bigger constant would act as no limit), and the same
parse rules. The shader cache already hashes the limit into its key, so
translations made with different limits never mix; the warning says so.

The 256/1024 advice and the risk of 32 are in xcl-bin/notes/loop.md.
Hosts differ in which formats take unordered access: NVIDIA has none
for B5G5R5A1_UNORM, AMD has. host_desc kept the title's UAV flag for
such a texture, so on an NVIDIA card the host description was invalid,
and the size query shared_texture makes with it removed the device
(DXGI_ERROR_INVALID_CALL) in the menus, about 50 s after start.

A texture in a format the host cannot write from shaders (asked once
per format with CheckFeatureSupport, typed unordered access views) is
now made without that use; typeless formats keep it, their views decide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
64 index entries could name one blob and 8 stage slots one code range,
so a small container inflated up to 1 GiB and had about 8 GiB of code
copied out. the bytes a part's blobs unpack to and the code and raw
table bytes read out of them now come off one 16 MiB budget.
format_load aligned the offset of a field narrower than a dword with
`off & !3` even when the offset was a constant. vkd3d-proton turns a raw
load at a computed offset into a per-component raw access chain
(stride 0), and on NVIDIA that load did not see the dword the same
invocation had just stored through the buffer's other access (stride 16,
per element): it read 0. A constant offset now gives a constant aligned
address and shift, and the load takes the same access as the store.

Fixes on an RTX 5080 (vkd3d-proton 3.2.0, Proton):
normalized_buffer_formats_load_their_ends_exactly and
tbuffer_d16_loads_pack_two_channels_per_dword.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`BUDGET` is "waiting allowed per title frame, over all threads", but each
wait took what was left of it when the wait began and counted its own time
only on return. The title records its lists on several threads: a thread
that began to wait while another still waited got the whole budget again,
from its own start. The frame then stood still for up to twice the budget
(a thread that begins just before the first returns), and its threads
waited a budget each.

The waits of a frame now end together (`Waits`): time counts while any
thread waits, once however many do; waits one after the other share what
is left; a thread still naming the frame before brings no budget back.

The frame line prints the time waited: these waits are on the recording
threads, outside the submissions, so they were in none of its times.

Tests, no GPU: waits_of_a_frame_share_its_budget (the accounting, on given
instants) and a_thread_that_waits_while_another_does_gets_no_budget_of_its_own
(four threads waiting on pipelines never made).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Include kernelbase.dll in xsystem::device_type::module().dlls alongside advapi32.dll and api-ms-win-core-registry-*, matching kernel::module() and files::module(). On Windows, api-ms-win-core-registry-l1-1-0.dll resolves to kernelbase.dll, so dynamic lookups via GetProcAddress (through kernel::host_override) and direct imports from kernelbase.dll bypassed the emulated OEM ConsoleMode registry key and fell through to the host registry.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lowering writes code as the console instructions name it: a register
read as a float is cast again at each read, a descriptor's handle is made
and its index clamped again in each block, an address is shifted and
masked again for each access. `bitcode::reuse` runs on the finished
module: an instruction that computes what an earlier one computed, where
every path to it has run that earlier one, is left out and its readers
take the earlier result.

It takes integer arithmetic and compares, integer selects, width and bit
casts, extractvalue, getelementptr, handle creation and annotation, the
integer `readnone` operations, `getDimensions`, and raw loads from the
host's own tables (page table, view addresses, view marks, view
strides). Float arithmetic, float compares, conversions, every other
load, samples, atomics and wave operations stay as written.

What goes is always a copy of an instruction that stays, so no operation
and no declaration loses its last use: shader flags and declarations
stay valid without being recomputed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XMemAllocDefault previously forwarded ALLOC_32BIT requests straight to
XMemVirtualAlloc without passing the alignment field from attributes, so
MEM_ADDRESS_REQUIREMENTS::Alignment was always 0 (64 KiB granularity)
and alignments above 64 KiB (128 KiB, 256 KiB, 2 MiB, ...) were ignored.

Extract a virtual_alloc helper taking an explicit Alignment and pass
`1 << ((attributes >> 24) & 0x1f)` when it exceeds 64 KiB (0 otherwise,
as required by MEM_ADDRESS_REQUIREMENTS).

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lower::valu puts a DPP instruction's cross-lane src0 in self.src0 before
lowering the operation; fsrc, src, half_src and v_cndmask_b32 read it for
source 0, but fmac_half read the operand directly, so v_pk_fmac_f16_dpp
multiplied the lane's own src0 in both halves. Read self.src0 for source
0 as the other readers do.

The test draws a 2x2 quad whose pixels swap their packed src0 through
quad_perm:[1,0,3,2].

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mips with the same footprint and rows but another row width were copied
through a buffer sized for one of them.
src64 sign-extends a literal for operations named *_i64 (#447), but
v_mad_i64_i32's addend is S2.i64 too, and its name ends in _i32, so a
negative literal there was zero-extended: 0 * 0 + -100 gave 0xffffff9c
with a high dword of 0. RDNA 2 ISA 6.2.1: a 64-bit signed integer source
sign-extends its literal. v_mad_u64_u32 keeps zero-extending.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review on #1787: host textures are made with their castable formats, and
D3D12 allows ALLOW_UNORDERED_ACCESS when a format the texture can be cast
to takes typed unordered access (B5G5R5A1_UNORM's 16-bit aliases such as
R16_UINT on NVIDIA). Dropping the use whenever the texture's own format
lacks it lost writes through those aliases.

host_desc now drops it only when neither the format nor any castable
format takes typed unordered access. make_texture's fallback without
castable formats (CreateCommittedResource3 refused or no Device10) drops
it when the format alone lacks it, since there the alias is gone and the
flag is illegal. The test makes the textures through make_texture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adapt fxceless/victory-fork#971 to cover translate, its cache warm-up,
pipeline pack discovery, and shader-info. Resolve file symlinks for
type and size checks while preserving each caller's regular-file
metadata policy and shader-info's warning for large regular files.

Thanks to avt0m4t48 for independently verifying the translate fix and
identifying the remaining shader-info gap in fxceless/victory-fork#971.
With the node's base taken from a root descriptor ("Built"), the node's byte
offset was shifted and added in 32 bits and then zero-extended to 64: a BVH
larger than 2 GiB has offsets that do not fit, and any negative intermediate
(the adds are signed) became about 4 GiB too large instead of sign-extending.
The explicit-descriptor path next to it already does the shift in 64 bits,
so the two halves of the same instruction disagreed.

The offset is now built in 64 bits for a raw (title-memory) base — shift,
constant, and the computed part — and only the buffer-view path keeps the
32-bit form D3D12 takes for a buffer's offset.

`intersections_with_64_bit_pointers_on_the_gpu_equal_the_reference` covers
this path on the card; it and the rest of the lib suite are green (247
passed, 3 ignored). A case that *fails* before this needs a BVH of more than
2 GiB, which this machine does not hold, so the change is argued from the
arithmetic rather than from a red test — if a title-side repro shows up, this
is the first place to look.
Review feedback on #2501: the comment said the 64-bit shift also fixed a
negative offset becoming about 4 GiB too large, but `built_offset` gives `k`
as `u32` and the computed part goes through `Cast::ZExt`, so the new code
zero-extends too; the old 32-bit add wrapped instead. Drop the claim.

Add the test the review asked for: `run_cases` gains a `high` mode that sets
bit 29 of the node pointer and maps the page 4 GiB higher in the page table to
a second copy of the nodes, with zeros in the page below. With the old 32-bit
shift the offset wraps back to the zeros and no case matches the reference;
with the 64-bit shift the pointer reaches its copy. `page_table_high` adds the
level-1 entry for the 256 MiB region 4 GiB up and a block for it.
Since 52d14b1 a heap slot whose texture view is left null (a placed
texture written into the heap, or one given up since 69d1e8e) is
forgotten (forget_read) so that its next read marks it again and
take_reads, after the submission, has its view made. Both happen before
the submission runs (sync_heaps, evict_unused), but the forgotten marks
were only cleared inside take_reads, after it ran: the mark a shader of
that very submission had just set was wiped with them. The slot was made
only after a later submission read it again (another frame of a null
view), or never if nothing read it again.

The marks of slots forgotten since the last submission are now cleared
just before the next one runs (clear_forgotten_reads); take_reads still
clears those forgotten while it ran.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since 69d1e8e, giving up a host texture (idle, or past the card's
budget) nulls every heap slot viewing it (HostHeap::evict). Since
ed25c0e it finds them by scanning `kept`, which covers the dynamic slots
too: the descriptor tables lists build for their draws. A recorded list
not yet reset still uses those (the dynamic slots it took are not
released until then), and its table is not made again before it runs,
so its draws read a null 2D view, and the slot no longer held the
texture. resource.rs: "Lists recorded before hold it until they are
reset, so no GPU work reads it freed".

evict now leaves dynamic slots a list still holds (taken in `next`), and
holds `made` and `next` across the scan and the clearing.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Until the slot is next made, not until its list is reset (review by
fyernald).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since 286a00e the DXIL writer takes a branch on a constant as a branch to
its one target, drops phi entries of edges that are gone, and folds an
empty block with one predecessor into it. Plan::edge decided whether a
phi of block x keeps its entry from b by following b's successors
through folded blocks (`to`). For `CondBr(true, empty, join)` with
`empty` folded (`empty` branches to `join`) and a phi in `join` with
entries from `empty` and from the untaken direct edge, the direct entry
was kept as well: the phi got two entries for its one predecessor,
which is invalid IR.

An entry stays when b's own terminator, constant branches taken as
branches, still has x among its successors; a folded block's entry
still stays and is written from the block it was folded into.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title asks for 1 245 184 descriptor slots, more than the 1 000 000 a host
heap holds, and it walks them in increasing order. "Log when the high-water
mark moves" is therefore one line per distinct slot: 199 846 of the first
200 000 lines of a run, ~8 000 a second, on the thread recording the frame.

That was the whole of the first frame's stall:

    before   310 932 lines in the run, first frame 21 433 ms
    after        231 lines in the run, first frame     33 ms

Same build, same warm caches (926 MB pipeline library, 1 347 MB shader cache),
same 150 s window. What the line said - that slots above the host heap's count
are not mirrored - is what the one line now says.

The underlying problem is not this change: 245 184 title slots can never be
mirrored because they exceed the tier-2 heap limit, which needs either several
host heaps with the index arithmetic adjusted or the views above 1 M placed
elsewhere. That is why the first world frames get null views.

cargo test --workspace --locked; both clippy configurations with -D warnings;
cargo xtask policy.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
What was wrong: a tracker leaves pages that touch memory other than the
runtime's untracked, "copied whole at each use" (280b150), and such a
tracker is never clean. A texture's refresh asked only the tracker's
changed pages (`Tracked::take`) and, since cc5f961, re-detiled only the
subresources those pages touch: a subresource lying wholly in untracked
pages was never touched, so it was not uploaded at all, not even the
first time (before cc5f961 the first refresh read the whole texture).

What changed: the refresh also takes the tracker's untracked parts
(`Tracked::untracked`) as candidates. Subresources in them are read and
their bytes decide by hash, as for a page shared with other data; the
"a whole changed page" shortcut still looks at tracked pages only.

Test: `draw::tests::a_mip_off_the_runtimes_memory_is_uploaded` (a
two-mip linear texture whose mip 0 lies in plain committed memory after a
reserved page: both mips uploaded at first, mip 0 again after a write).
On main it fails: "both mips at first", left 1, right 2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Translated shaders clamp every heap index they compute below HEAP_VIEWS,
and NULL_BUFFER_VIEW = HEAP_VIEWS - 2 is the slot a shader reads instead of
a slot with no buffer view. HEAP_VIEWS was 1 << 21 = 2 097 152, the
console-shaped heap the indices were first written for, but
D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2 is 1 000 000
(victory-gpu's PORTABLE_VIEWS): the clamp allowed an index 32 MB past the
end of any heap that can exist, and what is there is read as a descriptor.
The code knew - "a host that caps its heaps below HEAP_VIEWS (NVIDIA)
faults on an index past them" - and on the title it never got as far as
the null slots:

    host view heap capped at 1000000 count=1245184
    no room for the null buffer views: ... count=934464 total=1000000

HEAP_VIEWS is now the largest heap a host may create (1 000 000), so every
index the clamp can produce is inside the heap and NULL_BUFFER_VIEW is
999 998. A heap capped at PORTABLE_VIEWS keeps the top of itself for those
two slots (MIN_DYNAMIC - NULL_RESERVE dynamic slots), so the title slots
and the dynamic ones end below them and the warning above no longer
happens; measured on the title, warm caches: "null buffer views: 0".

The title asks for 1 245 184 slots, more than a host will hold, so slots
above the capped heap's title region are still unmirrored - they read a
null slot now, which is the safe answer the clamp was meant to give, not a
read outside the heap.

HEAP_VIEWS is baked into translated shaders, so the shader cache is
translated once more (SOURCE_HASH changes); the pipeline library is keyed
by the title's shaders and is unaffected.

cargo test --workspace --locked; both clippy configurations with -D
warnings; cargo xtask policy.
What was wrong: since 2d6c0df only texture views the program takes from
the resource heap itself set a read mark; reads through a table set none,
because "the host makes table slots for the draw". The host makes only the
entries the used-resource list names (`draw::State::tables`: one `table_entry`
per entry, the whole range only for tables made afresh). A table read at
a computed offset (a descriptor array indexed by data: `s_load_dwordx8`
with an SGPR soffset, a per-lane or waterfall load) may reach any slot
past those, and a slot there holding a placed texture left null was made
by its read mark before 2d6c0df; now nothing makes it and the view reads
null for good.

What changed: a texture read sets its mark unless its descriptor is a
table entry at a fixed offset on every path (`Lower::fixed_table_entry`),
the case 2d6c0df meant to skip. Heap-direct reads mark as before.

Test: `heap_direct_texture_reads_mark_their_heap_index` gains a table
read at a computed entry (soffset from `v_readfirstlane`, shifted by 5);
it was not marked before, it is now. The fixed-entry table read still
marks nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The host rewrites table entries while the GPU runs (the heap's
write_stride, set_mark and note_address), so the notes no longer say it
does not. The pass needs no such promise: inside one invocation the
reads of one entry it merges give the first read's value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reserve was applied in the capped path only, so the two successful
layouts (count + DYNAMIC, count + MIN_DYNAMIC) put 999 997/999 998 inside
the dynamic slots, the guard refused the null views there, and a clamp to
HEAP_VIEWS - 1 named a written slot. Every layout now stops its dynamic
range NULL_RESERVE slots below the end of the heap it got.
`Tracer::classify` traced every `v_readfirstlane_b32` result as the
dwords each lane holds. That is right only for the reads a waterfall
loop at the access compares, which `track` proves. Reads reached another
way were never proven:

- copied back to VGPRs before a loop (`v_readfirstlane_b32 s24, v4`,
  `v_mov_b32 v4, s24`): a per-lane source (a `global_load` entry) came
  out as each lane's own, though every lane holds the first lane's;
- picked by `s_cselect` or joined at an SGPR phi: the dwords had to be
  the same only in the lanes that access the descriptor, but the first
  lane may be another (lane 0 kept its old VGPRs, the accessing lanes
  overwrote theirs under EXEC).

RDNA2 ISA, V_READFIRSTLANE_B32: "Copy one VGPR value to one SGPR ...
Lane# = FindFirst1fromLSB(exec)".

The access's own reads are now traced in `descriptor` as before. Others
must give the same descriptor in every lane that runs the reads (the
reach of their block); a per-lane source is refused as "a descriptor
read from the first lane outside a waterfall loop".

Test: `first_lane_reads_no_waterfall_loop_proves_are_not_each_lanes_own`
(both shapes; on main the first traces to `Fetched`, the second to
`Select` of the first and second buffers).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Read src0 of v_cmp_class_f32 and v_cmpx_class_f32 as raw 32-bit bits (with SDWA sub-dword selection when present) and apply VOP3/SDWA abs and neg modifiers in integer bits rather than through fsrc float operations. This prevents D3D12 FTZ from flushing negated +denormals to -0.0 and prevents float ops from quieting signalling NaNs.
copy_back_page, copy_back_or_not and copy_back_marked each made a fresh
Vec for the bytes they read from title memory, up to 64 KiB a call, and a
world frame copies dozens of ranges back. A fresh buffer is committed and
touched from scratch, which is one page fault per 4 KiB: the frame report
counted about 1 900 page faults per frame in copy-back alone, and the
allocator traffic on top.

The buffers now come from the same pool the snapshots use and go back to
it (the pool keeps what fits, so nothing is dropped in practice), and the
pages a copy-back took are filtered where they are instead of being
collected into a second Vec.

(cherry picked from commit b0bb0dcdbaf3c503640adc839167bc38a61f6001)
`HostHeap::sync_slots` collected the record of every slot it was asked
about into a Vec, then a Vec<bool> of which name a current view, then a
Vec of the slots that differ. A world frame asks about ~800 000 slots
(`copystat`: "heap slots the title copied"), so that is tens of megabytes
of allocation and copying per frame, for records that are read once.

512 slots at a time now, in buffers on the stack: read, checked against
the records the slots hold, and the differing ones mirrored, which is a
few hundred a frame. `views_current` fills a slice instead of building a
Vec, and takes one lock of the view list per pass as it did per call.

(cherry picked from commit 341a051e9d2a02f35e627b216deed1ba29ae93fa)
`SHADER_HEAPS` guards the list of shader-visible heaps: which heap a
handle is in. Two kinds of caller read it and never change it - every
title thread that writes a view into a heap (`mirror`) and each
submission's heap sync, which walks every slot of the pages the title
wrote (`sync_heaps`, ~800 000 slots a frame). With one mutex they took
turns, and the frame report put 48 ms per world frame into title threads
waiting for it (`copystat`: "title threads waiting to write views").

Readers share an `RwLock` now; only a heap's registration and its release
(`Heap::drop`) take it alone, and a drop still waits for readers, so a
heap cannot be freed while `mirror` or a sync holds its address. The slot
work itself was never serialized by this lock: each host heap has its own
`made`/`kept` locks, and `mirror` already re-checks a slot after dropping
`made` because another thread may have made it meanwhile.

(cherry picked from commit 9fe32dd749df24d987bf9f0c1fb460418c6d5480)
`Shadow::update` is called for every range a submission's lists refresh
(thousands to tens of thousands a frame) and locked `pending` - the set of
ranges shaders of the submission may be writing - to see whether the range
meets any. Most refresh ranges meet none, and outside the window between a
GPU-write step and the submission's copy-back the set is empty.

An atomic count beside the set now answers that without the lock; the lock
is taken only when there is something to look at. The count moves where the
set moves (`writing` inserts, the copy-back removes).

(cherry picked from commit 98a7a935478282daedb7d69b26ea1b61401fca55)
A heap sync asks, for every slot of every page the title wrote, whether the
record there still names a current view: ~800 000 slots a world frame
(`copystat`: "heap slots the title copied"), one `Vec` lookup each into
`Views::list`, whose entries are a whole `View` (tens of bytes) and a
generation. The generation now lives in a `Vec<u32>` of its own, so the
answer is one 4-byte read instead of a cache line of view data; only the
slots that do name a current view need the view itself, and those are the
few hundred that get mirrored.

(cherry picked from commit 20db67d0d19e5df272dcce613a86d2e0133e2a8a)
`open` gave access back one page at a time: a `VirtualProtect` per page,
plus a set removal. World frames open tens of thousands of pages
(`copystat`: "pages opened", 13 624, and 75.95 ms in the guard handler),
and the pages a write or a copy covers are consecutive - the title writes
runs of them, and so does our own copy-back.

Consecutive guarded pages are given back in one call now, both where a
write of ours opens what it covers (`changed_here`) and where a released
tracker opens what nothing else watches.

(cherry picked from commit 1ce5a606f1e9676359f92e07ccd7ca1f243fc798)
The dwords a stage's user data sets were collected into a fresh `vec!` for
every stage of every draw (a few dwords at most, thousands of draws a
frame). Up to 64 of them now live in an array on the stack; a title that
asks for more still gets a Vec.

(cherry picked from commit 65f9815f639efbad912d8b33d04f1910244d49c0)
DirectStorage's page destinations are written through our own views of
the physical pages (xmem::page_window, write_physical), which the GPU
write watch's guards on the title's views do not see. xmem tells the
watch where the pages show when the write ends (report_written), but
kernel_will_write is meant to come first as well: "Before our own write
into title memory [...] opens its guarded blocks, marks them changed and
keeps them open while the result lives", saving an armed page's bytes
before the write lands. Told only afterwards, an armed page kept the
streamed bytes as its old ones, and copy_back_marked put the copy's
stale bytes back over the streamed data.

PhysicalWrite opens the title views showing the pages when the write
begins and holds them until it is done; the end-of-write report still
tells views mapped in the meantime.

victory-gpu exposes its trackers (Tracked, track) under a new
`test-hooks` feature, which only victory-hle's tests enable.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
One `Vec<u32>` per instruction was one allocation and one cache miss for
the dword or two most instructions have. The words live in a fixed
`[u32; MAX_WORDS]` with a length now: five dwords covers the longest
instruction here (an MIMG with its three extra address dwords), and the
decoder refuses anything longer rather than truncating it.

Decode -18..45% depending on program size; whole translation -1..5%,
since decode is a small part of it.

Now that #1180 is in `main`, this applies on its own: an `Instruction`
carries both the inline `words`/`len` and the cached `name`, and neither
costs the other its win.

cargo test --workspace --locked; both clippy configurations with
-D warnings; cargo xtask policy.
#2143 (merged today) reads `i.machine.words.len()` in `code_table_start`,
and this branch made `words` an inline array behind an accessor, so the two
textually disjoint hunks do not build together. The accessor returns the
slice, so `.len()` is the same number; no behaviour change.
Restore comment encoding and drop unrelated rustfmt churn.
`draw` and `dispatch` poll `fence.GetCompletedValue()` and call
`GetDeviceRemovedReason` on every iteration while a thread spins. One
event per submission, `SetEventOnCompletion`, and `WaitForSingleObject`
in 100 ms slices: the same device-removal report, no CPU burned while the
GPU works, and no device call in a hot loop.

The 100 ms timeout is what keeps that check: a removed device never
signals, so an INFINITE wait would hang the run instead of reporting it.
`WAIT_FAILED` returns an error rather than looping.

Interleaved A/B, 9 runs each, `emit::` with --test-threads=8:

    wall           9 080 ms  ->  9 084 ms
    CPU (median)   5 562 ms  ->  4 438 ms   -20%

Every event run stayed under 4.66 s of CPU; eight of the nine spin runs
were at 4.88 s or above.

`draw` and `dispatch` are `#[cfg(test)]`, so nothing in the game changes.
Cargo.toml gains Win32_Security and Win32_System_Threading for the
optional windows dependency (CreateEventW sits behind both); victory-gpu
already enables them.

cargo test --workspace --locked; both clippy configurations with
-D warnings; cargo xtask policy.
A dispatch made a new queue, allocator, list, fence and event every call.
Making those five costs 4.19 ms of an 8.35 ms dispatch (200 iterations,
release, hardware device), and emit::valu_tests runs hundreds of
dispatches for one shader: every f16 pattern, two opcodes, two backends.

Keep them in `Host`, bump the fence value per dispatch, and reset the list
with the dispatch's own PSO. That is safe here because the GPU tests run
one at a time (ONE_AT_A_TIME) and every dispatch waits for its fence, so
the allocator is never in use when it is reset. `Drop for Reused` closes
the event; `draw` still makes its own, since it is not on this path.

    v_cvt_norm_i16_and_u16_f16_round_the_exact_product   4.81 s -> 2.17 s
    emit:: suite, wall                                  9 084 -> 6 053 ms
    emit:: suite, CPU                                   4 438 -> 2 891 ms

Together with the event wait, against the original code: emit:: wall
9 080 -> 6 053 ms and CPU 5 562 -> 2 891 ms.

cargo test --workspace --locked; both clippy configurations with
-D warnings; cargo xtask policy.
Two things the triage found in the `Reused` cache.

The allocator was never reset, so it kept the memory of every dispatch
recorded since the host was made - hundreds per `valu_tests` case.
`ID3D12CommandAllocator::Reset` now runs before the list is reset, which
is safe because the previous dispatch waited for its fence. It costs
nothing measurable: four interleaved pairs of the `emit` suite gave
10.5 s of CPU with the reset against 11.1 s without it.

An error between `list.Reset` and `Close` left the cached list recording,
so the next dispatch's `Reset` failed too and one bad case turned every
later GPU test on that host into a failure with a misleading message.
`Reused` now notes that a recording is open and is thrown away instead of
reused if it is.

cargo test --workspace --locked; both clippy configurations with
-D warnings; cargo xtask policy.
The switch answers one question - "is this shader the one that removes the
device (or paints the wrong picture)?" - and it could only be asked of a
diagnostics build. That is the build in which the removal does not
reproduce on the machines seen so far: a diagnostics build does more work
per submission, so the frame that hangs the GPU in a release build never
gets there (measured here: release removes the device 10 s in, the same
build with `--features diagnostics` and no debug layer runs 180 s and does
not remove it at all).

So `is_skipped`, `skipped_shader` and `parse_skip_hashes` are no longer
behind the feature, and the three call sites keep the skip but gate only
their reporting (`note_drop`, `dropped`, `shaders_of`). A release build
now answers the question testers are actually asking:

    VICTORY_SKIP_PIPELINES=0602c2384acbb3b2  -> dropped 1/frame in the menu

and a skipped pipeline is dropped the way one with no host pipeline is
(the frame's "dropped N without a host pipeline" counter moves).

No behaviour change without the variable: `is_skipped` reads it once, and
an empty list is the `false` it was before.

cargo test --workspace --locked; both clippy configurations with -D
warnings; cargo xtask policy.
The library's pipelines are named after the shaders they are made from, so
a change to the translator (`victory_shader::SOURCE_HASH`) makes every name
in it useless - and the first run after one wrote the few pipelines it made
over the old library. Measured on the title:

    warm:  host pipeline library loaded bytes=970507898 ms=57   (926 MB, 27 160 pipelines)
    after a translator change, the next start-up says:
           host pipeline library loaded bytes=626800            (612 KB)

That 926 MB was a 7.5 minute warm-up (`translate --cache --pipelines`,
made=23057 on a cold library). It is not a truncated write -
`write_atomically` is already there, and so is the translator hash in the
pre build's list - the new library is simply small and replaces the old
one. The cost lands on the loop that needs the cache most: bisecting
between two builds paid the warm-up for each of them, in turn, every time.

So each translation keeps its library in `dir/<SOURCE_HASH>`, and the two
newest are kept (`KEPT`): the one in use and the previous build's, which is
what a bisection needs. A run only ever writes its own directory, and
pruning takes a directory only when its name is 16 lowercase hex digits and
it holds `host-pipelines.bin`, so a `backup/` someone keeps in the cache
directory is left alone (there is a test with a sentinel file in one).

Measured (retail title, two runs in a row, `O:\tmp\victory-cache\pipelines`):

    run 1:  host pipeline library saved  bytes=3086   (no load: first use of this key)
            host pipeline library saved  bytes=7488
    run 2:  host pipeline library loaded bytes=7488 ms=0
    -> O:\tmp\victory-cache\pipelines\94ef170ae2f5e8da\host-pipelines.bin

Nothing else moves: `use_pipeline_cache` still takes the same directory, and
the pipeline library of a build that is not the current one is now left
alone instead of being overwritten.

Rebased onto today's `main`: the file gained `tag()` (which holds the
translator hash for the pre build's list) and `write_atomically`, so this
is the directory part only, applied to those.

cargo test --release -p victory-gpu (229 tests); clippy clean; both
`victory` configurations build.
# Conflicts:
#	crates/victory-shader/src/emit/valu_tests.rs
`descriptor` traces a buffer descriptor made raw before a byte access
(stride cleared, records times stride, bounds in bytes) to the words it
was made from. When those are `v_readfirstlane_b32` results, `classify`
takes them as each lane's own. But `track` looked for first-lane reads in
the access's own SGPRs, where dwords 1-3 are the s_and/s_mul/s_or
results, so it found none and proved no waterfall loop. With no loop the
console uses the first lane's buffer in every lane, yet each lane read
its own.

`first_lane_words` now reads the same words as `descriptor` (the new
`words`). With no loop the access is refused, as other first-lane reads
are. Inside a waterfall loop the proof now holds and the loop runs in one
pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three image instructions translated into DXIL operations the validator
rejects (and a driver may refuse, or run wrongly), where refusing them
is the right outcome:

- a gather (`image_gather4_lz`, `_l`, `_lz_o`, `_l_o`) from a 1D or 3D
  image: "gather requires resource declared as texture/2D/Cube/2DArray/
  CubeArray";
- a gather with offsets (`_o`) from a cube or cube array: "out of bound
  offset must be undef";
- `image_load_mip` from a UAV, which is one level of its resource: "uav
  load don't support mipLevel/sampleIndex" (and the typed-UAV-load flag
  was left out, so "Flags must match usage" too).

They are now refused with those reasons, as the gathers DXIL cannot do
already are ("a gather with implicit level", "a gather of several
channels").

Found by validating random programs (the generator of #1335, with a
validation pass, validator 1.6): 5 of 16,207 programs that translated
out of 200,000; with this and #2056 every one of them validates. The new
test lowers each into LDS, so the refusal ends the translation, and the
2D gather and the plain UAV load next to them, which still lower; it
fails on `main`, and without either of the checks.
`image_sample_c_lz` and the other comparison samples (`sampleCmp`,
`sampleCmpLevelZero`) of a 3D image translated into a DXIL operation the
validator rejects ("samplec requires resource declared as texture1D/2D/
Cube/1DArray/2DArray/CubeArray"): D3D compares samples of every kind of
texture but 3D. They are now refused, as the other image forms DXIL has
no form of.

Found by the same random-program validation, over 2,000,000 more
programs: 3 of 164,934 that translated. The image test now also lowers
the same comparison sample of a 2D image, and refuses it of a 3D one (it
translates on `main`).
#1778 made the sampler heap we bind when the title binds none
SAMPLERS_OURS = usize::MAX. Our view heap for title memory, MEMORY_HEAP
(memory::OURS), is usize::MAX too, and host_state_lost marks the host
list's heaps unknown with [usize::MAX; 2]. A draw or dispatch that wants
both of ours (the title binds no heap, its shaders use title memory or
root views) then wants exactly that marker, so bind_heaps found nothing to
change: after a cut at a Wait32/64BitValueX the new host list starts with
no heaps and none were set before the root signature, which indexes both
directly (SetDescriptorHeaps must come first: the debug layer's 1419,
INVALID_CALL on NVIDIA); after external::record the heaps of the other
recorder stayed bound. Before #1778 such a list wanted [usize::MAX, 0].

SAMPLERS_OURS is now usize::MAX - 1, which neither a title heap nor the
marker takes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On current main the test took lower.rs past the repository's 512 KiB
source-file limit (CI's policy check). It moves unchanged into
lower/tests/image_refusals.rs, a child of lower's test module, so it
keeps its helpers.
Use FirstbitHi to count the leading zeros in the runtime quotient. A synthetic 11-bit UNORM load emits 60 DXIL instructions, down from 78.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only its last bit takes the marks of offsets past it; clearing the whole
dword dropped the writes to the 31 pages before it.
The placement of a newer title's extended description is read through the
kernel, so an older title's description at the end of its memory does not
fault.
Remapping title pages under a submission's reads and copy-backs could
fault it; the host's submission lock now covers the remap.
State::rectangles previously evaluated u64::from(first + count) * stride, adding first and count in u32 before widening so overflowing draw arguments could panic in debug builds (or wrap in release). Widen both operands to u64 before adding and check the expanded D3D12_VERTEX_BUFFER_VIEW::SizeInBytes conversion via rectangle_vertex_bounds.
A list's Step::Memory (crate::memory::prepare) was queued once, by bind at the list's first title-memory draw, while a buffer range (defer_refresh) or a heap's views (defer_heap) are queued again after a step that writes title memory. A draw after an in-list copy into a title buffer then read the copy's old bytes through the page table. defer_memory now queues once until a title write (like defer_heap), and State::memory_map asks again on its cached path.
The list's first use of the twin counted as the list's first use of the
texture, so the prelude copied the depth side before the draws that wrote
it.
Use host::write_mapped under watch::writing so CopyMemoryToMemoryX does not fault if pages are unmapped or read-only between the committed check and the copy. Disjoint ranges copy directly in one pass with no temporary buffer; overlapping ranges keep a committed-bounded staging buffer for memmove order.
Any user-data entry at the view-offset dword was taken for a root view's
offset, so a draw reading that constant was dropped.
Share the ballot for the same EXEC predicate within a DXIL block. Two dependent DPP8 instructions emit one ballot instead of two.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every root signature we make indexes both heaps directly
(CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED), and
the SM 6.6 spec has SetDescriptorHeaps pass "the corresponding heaps"
before such a signature is set. #1778 made bind_heaps bind a sampler heap
of ours when the title binds none, but the view half still bound ours
only when the shaders read title memory or root views: a list with no
view heap whose shaders read only constants set the signature with no
view heap bound (State::wanted([0, 0], false) == [0, SAMPLERS_OURS]).

Such a list now gets our view heap (crate::memory::heap) as well, which
root views and the write-mark table already use when the title binds
none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`VICTORY_DUMP_SHADER=8bbcbda6008eaa37` (or `all`) writes each named
shader's DXIL to `%TEMP%\victory-<hash>.dxil` as it is translated; `dxc
-dumpbin` reads it as LLVM IR. The pipeline log and the breadcrumb reports
name shaders by this hash, and until now there was no way to see what our
translation of one looks like - which is what a frame spent in a compute
dispatch that asks for 746 tiny groups needs.

Found with it in the prologue: `8bbcbda6008eaa37` (NumThreads 8x4x1) is a
ray march whose exit is a float comparison and whose only other way out is
the loop limit (1 << 20), and `00167d58cc5a78d7` (4x4x4) has no loops and
no barriers at all yet stops the queue - two different causes behind the
same "GPU hang".
The title renders to a 2560x1440 B4G4R4A4_UNORM texture and makes a typed
unordered view of a B5G5R5A1_UNORM one. D3D12 supports neither, and the
debug layer says so while the run is going:

    CreateCommittedResource: A texture that has
    D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET set ... must be created with a
    format that either can be used as a render target, or cast to a format
    that could be

    CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be
    used with a Typed Unordered Access View. This is because the current
    graphics implementation does not even support this Format.

    RemoveDevice: DXGI_ERROR_INVALID_CALL

so the run ended a minute after the account screen, in the first scene of
the prologue, with the device removed. (The 16-bit render target's creation
was already failing quietly - `no host texture` - and the unordered view
above removed the device.)

`pc_format` now widens B5G6R5, B5G5R5A1 and B4G4R4A4 (85, 86, 115) to
B8G8R8A8_UNORM (87): the same channel order, legal for render targets,
unordered access and shader reads, and it is the one function resources,
views, twins and pipeline target formats all go through, so they agree. The
title loses the console's 5 or 4 bits a channel, not the picture's layout.

With it the title reaches gameplay and the numbers the frame report then
prints for the first time: 2 555 draws a frame (before: the device was
removed in the loading screen), 3 969 ms a frame, 1 674 draws dropped for
want of a host pipeline, 621 MB of title memory copied and 139 MB of
textures uploaded a frame. That frame's 3.6 s on the GPU is the next
problem - and, being over the 2 s TDR, the next removal.

Found with the debug layer (`VICTORY_D3D12_DEBUG=1`) in a diagnostics
build: `fail()` now drains the layer's stored messages, which name the
call instead of only its code.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-shader/src/emit/valu_tests.rs
The pipeline log says how long a translation took but not who ran it: with
the prologue's cold cache 1 725 translations of ~110 ms each add up to the
20-25 s the first gameplay frame spends, and the question that decides the
fix is whether that is one thread (move it off the recorder) or the eight
pipeline workers (a translator throughput problem). It is the workers:
victory-pipelines-3..7 took 181-288 translations and 18 000-27 000 ms of
wall time each in the same run, so the batch is already spread and the
stall is per-translation cost.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two diagnostics (the `diagnostics` feature only) that answer why a cold
shader cache costs the first gameplay frame 20-25 s:

    shader phases (us): stage=Cs blocks=1542 range=342 resource=99315 io=5255 emit=8126713
    lowering passes: 74 blocks=1542 setup_us=5561 run_us=85672

- a translation is 74 % structurisation/resource tracing and 25 % lowering
  in the aggregate, but the *worst* shaders are lowering: 8.1 s of 8.2 s for
  the biggest one;
- `emit::lower` re-runs the whole lowering once per phi that does not
  settle (`Stop::Retry`): 74 passes for one shader, 222 extra passes over 17
  shaders in a batch of 1 725. At ~86 ms a pass on 1 542 blocks that is
  6.7 s for one shader alone - the whole cold batch is 160 s of CPU across
  eight workers, 25 s of wall.

Nothing changes in a release build (no `diagnostics`): the phases are
`Instant`s behind `cfg` and the pass count is not compiled at all.
Main's #1320 gave `Pending::new` the diagnostics build's shader hashes to
skip; the test passes none, as the module's other tests do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Extract the high dword directly from DXIL UMul or IMul. The 24-bit forms use the same lowering after extending their operands.

Each synthetic shader emits three fewer DXIL instructions and clears its INT64 feature bit. The high dwords match main bit for bit on AMD hardware and WARP.
A command that hangs the GPU cannot be read back afterwards: the
breadcrumbs name it, the record dump (`read_indirect`) needs the list to
have run, and that is exactly what it did not do. The arguments live in the
*host copy* of title memory, though, and the refresh that fills it runs
just before the list: so a deferred step logs the record's dwords at
submission time, from the copy the GPU will read.

    indirect arguments {kind, max, count, dwords, name}

For the two dispatches that stop the prologue (`00167d58cc5a78d7`,
`f607780aa8e502d0`) and whatever the breadcrumbs name next, this says
whether the long loops are fed by huge counts or by garbage, which is the
question the read-back could not answer.

Diagnostics only; nothing runs without the switch.
`VICTORY_GPU_TIMING` gives per-command GPU times only by submitting every
list on its own and waiting for it, which reads ~10x the real frame and
therefore cannot say what a *batched* submission spent its time on. Its
stamps did not help either: every list resolves into offset 0 of its
read-back buffer, so only the list that closed last kept its times.

`VICTORY_GPU_STAMPS` (diagnostics) turns the timestamps on without the
one-list-per-submission mode, and a submission of all lists that takes over
200 ms now reports the two longest commands of every list in it:

    slow host submission ms=...
    slow list 7 command, 918.6 ms: dispatch 8x16x2 [compute ...]

That is the report the loading needs: the frame is 15 s of GPU work with a
batched submission, and nothing could name the command inside it.

Diagnostics only; the release build is unchanged.
268 of those lines printed without a single per-command line, and nothing in
them said why: now they carry how many commands the lists noted and whether
the timestamp heap exists, which is the difference between 'no markers were
recorded' and 'the read-back is empty'.
\Map\ returns the start of a read-back resource, not of the range asked
for, so after every list took its own slot the report read offset 0 - the
slot of whichever list had id 0, or zeroes - and every command came out as
0.0 ms while 7 439 notes and a live timestamp heap were there. With the
slot read, the loading says:

    5251  ms: dispatch 1x1x1 [compute caa78b8ca62bc3d6]
     123.1 ms: indirect kind 2 max 1 [compute 8bbcbda6008eaa37]
     111.2 ms: draw 3x1 [vertex ce57291b5a1750ca, pixel ...]

a single workgroup of 64 threads is what costs the loading its five
seconds, and it is the same 2^20-iteration shape.
The two searches of \caa78b8ca62bc3d6\ exit on \loaded != key\ and the cap
is the only other way out; whether the key is missing from our copy or the
comparison is wrong needs the values, and those live in title memory that
the shader reads - not in anything a read-back can report after the hang.

With \VICTORY_DUMP_VIEWS\ (diagnostics) and \VICTORY_TRACE_SHADERS\ naming
the shader, every constant or placed buffer view its pipeline binds has the
first sixteen dwords of its copy logged at submission, after the refresh
that fills it.

First run printed nothing for that shader, so it binds its data some other
way (root views or user data rather than tables) - the next step is to log
which kind it does use.
The 6 s dispatch of \caa78b8ca62bc3d6\ binds neither a descriptor table
(nothing printed) nor a root view (nothing printed either): its only
bindings are the user-data dwords, which are now logged at submission -

    traced user data [compute caa78b8ca62bc3d6] user_data=[... 18816, 4294966592, 768 ...]
    traced user data [compute caa78b8ca62bc3d6] user_data=[... 27520, 4294966208, 1024 ...]

6 005 lines in one loading run, and the values are small and structured
(an offset, a negative offset, a size: 18816 / -2048 / 768), not garbage.
So the table the two searches walk is *title memory* (the page-table path),
which puts the memory refresh and its withhold/miss accounting next in
line.
The copy-list fence precedes Present. On a size or format change, signal the presentation queue again and wait before DXGI releases the old back buffers in ResizeBuffers. Keep the wait inside the resize retry so unchanged frames continue as before.
The title's 3 444 host copies of its memory span more than 1 030 distinct
256 MiB regions of its address space, while `CAPACITY` gave a list's page
table room for 512 - "the world's ~4 100 copies use a few dozen", which held
for the world and not for this title. Every region past the cap reads as
absent, and the diagnostics said so plainly:

    title memory this frame: 18 447 withheld and 1 098.1 MB of views kept,
    missed 120 539 pages and 23 256 MiB regions with no copy

A compute shader that searches a table in that memory then reads zeros,
never matches its key and runs its loop to the 2^20 cap. The one that cost
the loading its five seconds is `caa78b8ca62bc3d6` (64 threads, three nested
loops), and with the capacity raised it does not appear in the slow-command
report at all:

    before, CAPACITY 512 : dispatch 1x1x1  [compute caa78b8ca62bc3d6]  6 012.2 ms
    after,  CAPACITY 2048: (below the report's threshold)
    loading run, no VICTORY_SKIP_PIPELINES and the default loop limit:
        120 world frames, 0 device removals, the full 420 s window
        frames 1.8-2.6 s: GPU 1.2-1.7 s, copies 137-240 ms / 1.4-2.0 GB

Until this, the prologue only ran with two dispatches skipped or with the
loop limit cut to 1024 (both diagnostics); with the capacity raised it runs
on an unmodified build.

Cost: a table is `(CAPACITY + 1) * 32 KiB` beside the level-1 entries, so
67 MB instead of 17 MB per table, and the run keeps one or two of them.
Raising it further only helps the remaining 6-19 regions and grows linearly,
so the next change there is to allocate level-2 blocks per submission for
the regions a submission's views reach, not a bigger constant.

The corpus A/B is unchanged, as it must be - the translator is not touched:
25 889 per-program outcome lines, 0 differences, 47 s. cargo test --release
--workspace: 30 suites, 0 failures; clippy -D warnings clean with
diagnostics.
WriteFile only promises atomicity for a single sector, and a crash
record spans many: another reporter can write between its bytes even
with FILE_APPEND_DATA, and under Wine the concurrent-records test saw
it happen. Each record is written in one append under a process-local
lock. A handler never waits on it for long, since an exception may come
from the thread that holds it: one that cannot take it still writes, as
a rare interleaving beats losing the report.
This reverts commit 1e53e9132e.
Three prologue compute pipelines read a *root view's* offset while the title
had bound that root as 32-bit constants, and every such draw or dispatch was
dropped:

    dropped 1-2.4/frame without a host pipeline:
      dispatch: a root view's offset: no root view, or outside title buffers
      [compute 35e51bb27a463294], [compute f94e5d8bf4e1cf05], ...

A diagnostics count of the two halves of that reason says which it is: over a
whole run, `no_view` fires and `no_copy` never does - the slot holds
`Root::Constants(...)`, not `Root::View(...)`. The console lets a title pass a
descriptor itself as root constants, and the ones here hold their buffer's
address in dword 0 (`Constants([1915200512, 13, 0, 0, 190980448, 16, 8, ...])`).

`State::root_address` now answers "the title address this root stands for" for
both forms: the view's address, or the first dword of the constants when that
address lies in a host copy (`shadow::find`), and `root_view_at` binds the view
at that address exactly as it did for a view root. When the address is in no
copy the old drop stands, so nothing is invented.

Measured on the prologue scenario (play driver, 560 s window, diagnostics):

    before: 2.4/frame dropped for this reason, run ends on the title's int3
    after:  0 dropped for this reason
    after, with the diagnostic loop cap 1024 (so the unrelated 5-6 s loop
    class does not end the run first): 208 world frames, 0 device removals,
    0 drops, the whole 560 s window, no title exception

The visible checkerboard patches in the credits frame are the shape this
should fix; the fix is not yet shown to remove them (the run above has no
screenshots), which is the next check.
In Held::pump, Item::Signal flushed the accumulated piece on the current queue before running, while Item::Segment (with non-empty ValueWaits) and Item::FenceWait evaluated their wait conditions while earlier segments on the same queue were still unexecuted in piece.

Because an earlier segment on the same queue can modify the waited memory (via Write32/64BitValueBottomOfPipeX, GPU writebacks, or direct writes to fence::gpu_address), evaluating a wait against stale pre-segment memory caused two bugs:
- A wait after a segment that clears or rewrites a previously satisfied flag read the stale value, erroneously passed, and batched the waiting segment into the same host submission instead of holding it until a peer queue satisfied it.
- A wait satisfied by an earlier segment on the same queue initially read the stale value, falsely marked itself blocked, and recorded a spurious wait entry.

Flush any pending piece before testing non-empty ValueWaits on Item::Segment and before testing Item::FenceWait. Consecutive wait-free segments continue to batch into a single host submission.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A refusal carries `at 0x14dc`, and until now the offset was all it said: the
program is 12 000 words of native code and the instruction at that offset was
the one thing the message did not have. It has it now, in the same line:

    bvh_skinning:CSComputeSkinningPedBlendShapesVelocity_1c34db0a_Wrapped Cs
      at 0x14dc  [s_cbranch_execz Sopp { imm: 92 }]  emit: a lane mask read as data

That names the prologue's remaining functional hole instead of hinting at it:
four programs of the whole pack (`CSComputeSkinningPedBlendShapes`,
`...SecMotion`, `...Velocity`, `...SecMotionVelocity` - the character skinning
with blend shapes) fail on the same opcode, and the one the prologue binds
(`compute 82a2ad6d07417d36`) is dropped 4 times a frame in the interior scene
that the play run then stands in for four minutes. The other three shader
families that refuse at an offset get the same line for free.
A program's refusal is usually not the instruction the message names: the
emitter gives up on an instruction, marks its writes missing and goes on, so a
branch can report a reason that came from something dozens of instructions
earlier (the prologue's character skinning reports `s_cbranch_execz` at
0x14dc while the first thing it cannot do is a mask copy at 0x5c).

Two switches for that:

- `VICTORY_ONLY=@0x<offset>` (`translate --list`): translate only that
  container, so one program's log is its own;
- `VICTORY_TRACE_FAILS=1`: log every instruction the emitter gives up on, with
  its offset, block, reason and reads.

Together they give the ordered list, which is what says where to look:

    FAIL s_setreg_imm32_b32 at 0x1c (block 0): a register the emitter does not model
    FAIL s_mov_b32 at 0x5c (block 1): a lane mask read as data reads [(S(126), Value(8))]
    ...

Both are read at run time only, so a normal run pays nothing.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
`sop()` refused every scalar instruction whose destination is a lane mask -

    if inst.write(Reg::S(EXEC)).is_some() || self.is_mask(lo) {
        return Err(LANE_MASK);
    }

- so a program that copies exec before its first branch was refused at that
branch, and the whole pipeline was dropped. That is the prologue's character
skinning with blend shapes (`CSComputeSkinningPedBlendShapes`, `...SecMotion`,
`...Velocity`, `...SecMotionVelocity`), dropped four dispatches a frame in the
scene where the play run then stands still.

Now the op lowers the mask the structure already has for what it writes,
instead of refusing. Three details make it hold:

* only the writes the structure names as masks get a bit; a write it does not
  name (the saved exec of an `s_and_saveexec`, a register the compiler reuses
  for data) carries the destination's mask, because the branch that follows
  would otherwise read a value with no definition at all;
* a phi registered while such an evaluation runs is *lenient*: an edge the
  structure cannot name gives it no lanes instead of failing the program, so
  `a_scalar_result_needs_no_exec` (a copy of exec that only guards a
  `v_readlane`) keeps translating;
* every other mask join keeps its refusal, so a mask holding lanes off its edge
  joined with data still does not translate
  (`a_compare_mask_joined_with_data_on_the_skip_edge_is_0_there`, second half).

Measured over the whole shader pack (`translate --list`, 26 084 programs),
against a baseline taken with this change stashed:

    before 25889 program lines, after 25889
    only before: 4   only after: 4      (the same four, now emitted)
    compute programs 2658 -> 2662

Nothing else changes. `cargo test --release --workspace`: 30 suites, 0
failures; clippy `-D warnings` clean.

`lower.rs` is at the repository's 512 KiB asset-policy limit, so the two new
methods live in `emit/lower/masks.rs`.
`VICTORY_KEYS=<seconds>:<key>` held each key for 200 ms, which is enough for a
menu press and not for walking. The entries now take a third field, the hold
in milliseconds:

    VICTORY_KEYS=200:W:6000,215:A:1200,10:Enter:300,20:Enter:300

Both the keyboard device and the stand-in pad see the keys (the HLE merges
them in `poll`), so a run can be driven while the title's window stays in the
background: nothing calls `SetForegroundWindow` or `keybd_event`, and the
person using the machine keeps their focus. Enter is the pad's A and W the
left stick up, so the account screen, the menu and walking all work this way.

First run with it (`nofocus`): the title reached the world without any window
activation - 1 862 draws/frame at 153 s, 4 657 at 196 s - where every earlier
driver had to attach to the window's input queue and steal focus at 15/40/70 s.
Translated shaders clamp heap indices below `HEAP_VIEWS` (1 000 000), so a
heap shorter than that lets the clamp name a slot the heap does not have. The
small-dynamic-range path still asked for `count + MIN_DYNAMIC` with no floor:
800 000 title views made an 865 536-slot heap, and every index in
865 536..999 999 was out of bounds (review on #2683, from a title count of
737 856..934 463).

The layout decisions are now two pure functions, so the boundaries can be
checked without a GPU:

* `capped_layout(count)` - `Some((slots, dynamic))` when the title's slots
  plus even the small dynamic range do not fit `HEAP_VIEWS`: the capped
  layout, taken on **every** host including tier-3 ones whose heaps are
  larger, so the layout (and the clamp's bound) is the same everywhere and the
  null buffer views keep the top of the heap;
* `small_request(count, views)` - `(count + MIN_DYNAMIC).max(views)`, the heap
  a host that refuses the large dynamic range is asked for: never below the
  clamp.

Tests: `the_capped_layout_and_the_small_range_fit_the_clamp_shaders_use` pins
the review's counts (737 856, 800 000, 934 464 fit; 934 465, 1 000 000,
1 050 000 take the capped layout, whose `slots + dynamic + NULL_RESERVE`
closes inside `HEAP_VIEWS`) and fails on the previous expression (checked by
putting it back: "a heap of 65536 is short of the clamp 1000000");
`a_heap_has_every_slot_shaders_clamp_to` checks the same invariants on a real
host's heap, and skips where no heap can be made.
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
`watch::open_runs` took each page out of `Guards::protected` *before* asking
the kernel for write access, and ignored what the call returned. A page that
only left the set that way is read-only for good - no tracker holds it any
more, so nothing opens it again - and the title's next write there faults with
no guard to take it (review on #2848: reproduced in-game under Wine,
`crashbashash`).

Now the set changes only after the protection is off, and a run the kernel
refuses - a range crossing two allocations, 487 on Windows - is retried one
page at a time, the pages it does open leaving the set and the rest staying
in it for the next take (or the fault handler). How many opened is logged when
some did not, and counted in `copystat`'s "pages opened".
`Shadow::writing` inserted into `pending` and then bumped `pending_len` after
the mutex was already released; `copy_back` reads that count to decide whether
the fast path (nothing pending) applies. A reader could therefore see 0 while
a range is in the set, take the snapshot path without it, and the count could
drift below the set's size - the review's "underflow or a missed insert".

The bump is now inside the lock the set moves under, the add/sub use Release
and the load Acquire: the counter is a hint, and a hint has to be published
with the set it describes.
The batched report named two commands a list, and only for submissions over
200 ms, so a frame's ~350 commands were ranked by their two longest - which is
why the biggest pipeline looked like 44 % of the frame when it is 7 %.

Two switches now say how much to list and when:

    VICTORY_GPU_REPORT=40           commands per list (default 2)
    VICTORY_GPU_REPORT_MIN_MS=250   submission length that triggers it (default 200)

With 40, a 1 150 ms submission lists 354 commands summing to 1 144 ms, i.e. the
report accounts for the submission's whole time. On the prologue's frames it
gives the family table the next optimization needs - no single shader:

    indirect 25ebc92075b62822   2 453 ms   (an indirect draw: geometry)
    dispatch 39f0e9aeb156a61c   2 019
    indirect 7a071f906f98311b   1 749
    draw     05e958b19269d596   1 126
    dispatch 5cf00dc39042edaf     538
    mesh     04b9be3756e8f41c     475

over the sampled submissions, each family 200-600 ms of a ~3 s frame: geometry
and compute in similar measure, not one bad pass.

Diagnostics only (the switches are read at run time, nothing changes without
them); clippy `-D warnings` clean, `cargo test --release -p victory-gpu` 231
passed.
resource::alias_source previously looked up a GPU-written aliased texture under TEXTURES_AT, dropped the Arc<HostTexture> and lock, and returned a raw *const Object (This) with no COM reference. If another thread legally called ID3D12Resource::Release() on the aliased source texture before texture::alias_copy ran, alias_copy dereferenced the freed Box<Resource> (or a recycled allocation at the same address) in resource::host_resource and list::ensure_state.

Return Option<Arc<HostTexture>> cloned while holding TEXTURES_AT, route pinned host-texture transitions (including depth twins) through HostList::transition_copy and list::ensure_copy_state, and pin the destination HostTexture once inside texture::alias_copy so concurrent eviction cannot split destination identity across GetDesc, host_writes, state tracking and CopyTextureRegion.
`memory::prepare` ran once per list that binds a title-memory view heap,
per submission, and asked `watch::clean_bit` once per copy the layout
names — about 4,700 in the world, nearly all clean — so a submission of
tens of lists paid hundreds of thousands of single-bit loads a frame.

The layout now keeps its copies' tracker bits as `(bit, index)` pairs
ordered by bit plus the words they span, and `dirty_indices` walks the
tracker a word at a time with `trailing_zeros`, asking only for the
changed bits. A layout costs the words its bits span (~74 for 4,700
contiguous bits) instead of the copies, and the set of copies handed to
`add` is exactly the one the per-copy loop found.

Arithmetic, not a title measurement: ~4,700 loads at ~4 ns becomes ~74,
i.e. ~19 µs to ~0.3 µs per list per submission; the frame line's
`StepMemoryUs` counter already reports the total, so a run with this merged
shows it directly.

Verification: `cargo clippy -p victory-gpu --all-targets --locked -- -D
warnings` and `--all-features` both clean; `cargo test -p victory-gpu --lib
--locked --no-fail-fast` 231 passed, 2 failed — both the known Intel
baseline failures pristine main also fails (#1744/#1829). New test
`memory::tests::the_dirty_scan_finds_each_changed_copy_once_in_tracker_order`
covers order, clean trackers, foreign bits in the same words and an empty
layout. `rustfmt --edition 2024 --check` hunks against main: memory.rs 30/30,
watch.rs 39/39.

Synthetic tests only; no game data.
Every indirect command is clamped by a compute dispatch between two global
unordered-access barriers, and the world runs 2 600 of them a frame - so the
barriers are a candidate for a large part of a frame. Measuring them needs an
A/B that keeps the commands running, which `VICTORY_NO_CLAMP` could not: it
returned `None`, the command was dropped, and the run then compared a frame
with 5 018 indirect commands against one with none.

Two switches replace it, neither changing anything unless set:

    VICTORY_ONE_BARRIER=1   after the clamp, only the transition out of
                            unordered access (which already flushes that
                            buffer) - the global barrier after it ordered
                            nothing the command needs;
    VICTORY_NO_BARRIERS=1   both global barriers gone: the ceiling of what
                            they cost together, for the measurement only (the
                            title's writes then need not be visible to the
                            clamp).

`VICTORY_NO_CLAMP` is removed: it measured a different program.

No numbers claimed: the A/B was started and stopped early (base 47 and 13 world
frames, one-barrier 3), so nothing here says the change is faster. It says how
to find out.
Every world frame of every run so far reports the same three numbers:

    0 pages copied back, 20 000-31 000 withheld, missed 70 000-112 000 pages
    and 27-50 region marks with no copy (first: 0x740000000 0x750000000 ...)

`copy_back` withholds *all* of a frame's write-backs as soon as one page of
title memory was read by a shader with no copy (`withholding()`), and that is
the state of every frame: the title reads 0x740000000-0x780000000 - a gigabyte
with no host copy - so

* the title's memory never receives what its shaders wrote, and the host copy
  the title's own reads are answered from (and that a refresh pushes back) is
  what the GPU wrote a while ago or never;
* the per-frame work is real: 100 000 page marks read back and walked, 20 000
  pages dropped, every frame.

Whether that is what keeps the game from advancing (the prologue's first scene
waits for input and never moves on) cannot be told from the logs. The new
switch copies back even while pages are missing, so one run says it:

    VICTORY_ALLOW_COPYBACK=1

Diagnostics only: the rule above is unchanged unless the switch is set.

No behaviour change and no numbers claimed.
Every world frame reports thousands of pages of title memory a shader read
with no copy (`memory`'s frame line), and the first four addresses have been
the same four gigabyte-apart regions for every run - so the next question is
what those addresses are, which the line could not say.

`shadow::describe(address)` answers it: the registered title buffer that holds
the address and whether a copy of it was made, or how far the nearest
registered buffers are. The first four missed pages of a frame log it at
`debug`:

    title memory a shader read with no copy page=0x740000000
        what="no registered title buffer at 0x740000000; nearest below ..."

That separates "the title never registered a buffer there" (a use we do not
translate into a buffer access at all, so no copy exists to make) from "the
buffer is registered but its copy was never made or was released".

Diagnostics only, no behaviour change, no numbers claimed.
A save serialised the whole library - over 600 MB once the world's
pipelines are in it - and wrote it in one piece every SAVE_EVERY, even
when a run added a handful of pipelines. The host can only serialise a
library whole, so the only way to write less is to keep less together:
the library is now SHARDS files, and a pipeline always lands in the same
one, because its name is a hash.

A save serialises and writes only the shards that gained pipelines, with
the pre-build's list kept per shard beside the bytes it holds for. Two
things the review of the previous revision asked for are kept: the SAVING
lock spans serialising and publishing, so two saves cannot publish an
older snapshot over a newer one, and a shard's dirty flags are cleared
only after its bytes are published, by what was serialised - a failed
write leaves the shard for the next save, and a store during the write
keeps it dirty.

Synthetic control, 16 MiB payload, one/4/16 dirty shards (aycow):
1.56/5.59/24.15 ms against 8.21/7.85/8.55 ms for one blob. Sharding wins
in the steady state - one to four dirty shards - and loses when every
shard is dirty, which is the first run after the upgrade.

cargo test --workspace --locked; both clippy configurations with
-D warnings; cargo xtask policy.
A save snapshots a shard's prebuilt keys, releases the lock and writes the
files. A key recorded while it writes was not in the file, but clearing the
flag by "was it set at snapshot time" marked it saved anyway, so the next
save skipped the shard and the published list never gained the key.

Acknowledge only what was published: the shard stays dirty when its key
count changed while the write ran. `save_shard` is split out so the race is
testable, and the regression test injects a key from inside the write - it
fails on the old check and passes on this one.

`USED_CHANGED` had the same shape, so the early list is acknowledged the
same way: a generation counter bumped by `note_used` decides whether the
list that was written is still the whole list.

Fix and regression test by andrewpozdnakov7-jpg, from the analysis on #1653.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
Use CopyTextureRegion on subresource 0 instead of CopyResource for single-plane PresentX so mipmapped and array textures present without D3D12 error #944 or WARP process abort.

Route format-converting planes (such as R16G16B16A16_UNORM/SNORM into R16G16B16A16_FLOAT) through the compositor and resolve plane SRV formats without casting across incompatible float/UNORM types or passing typeless/unsampleable formats (such as B8G8R8X8_TYPELESS or integer overlays) to CreateShaderResourceView.
The branch was 160 commits behind, and three of them change this file. The
rebase could only go through by taking this side of `pipeline/library.rs`
whole, which dropped them - so they are ported onto the sharded code here, one
per section:

* `zeroed(n)` (`321a4bc1`, Kevin Pratap): a shard's serialise buffer is
  reserved fallibly. A shard holds each pipeline's machine code (about 1.7 GB
  in all on NVIDIA after `--cache --pipelines`), and the infallible
  `vec![0u8; size]` aborted the process mid-run ("memory allocation of
  2650101862 bytes failed"). Without the memory the shard stays dirty and a
  later save writes it.

* lock-free loads (`555c112e`, winne42): each shard keeps its interface a
  second time (`Shared { loads, state }`), and `pipeline` loads through that
  one without taking the lock a save holds while it serialises a shard.
  Before this, a load cloned the interface under the lock, so every load of a
  shard waited out its save (230-600 MB in the world). Ported with its test:
  `a_pipeline_loads_while_a_save_holds_the_library` holds a shard's lock and
  requires a stored pipeline to load anyway (30 s bound), which the cloning
  version fails.

* the ordered early list (`e9ea9a45`, Danilo Mori Schuler): `Used::before` is
  a map from key to its place in the list as loaded, and `Used::list` sorts by
  it, so a full list drops the *oldest* runs' keys rather than any of them (a
  set gave no order to drop by); a list saved by an earlier build, in no
  order, still reads. `the_early_list_keeps_this_run_first` now asserts both
  ends: the most recent earlier key is kept and the oldest is the one that
  made room.

This branch's own two races stay as they were: a save acknowledges only what
it snapped (`d09b71bf`), snapshot and publish are one transaction under
`SAVING`, and the early list is published with a generation check.

Verification: `cargo test --release -p victory-gpu pipeline::library` - 11
passed (both GPU tests among them); clippy `--all-targets -D warnings` clean.

Co-authored-by: Kevin Pratap <[email protected]>
Co-authored-by: winne42 <[email protected]>
Co-authored-by: Danilo Mori Schuler <[email protected]>
Reviewer on #3248: copies with no tracker bit (untracked memory, or a full
bit pool) have `dirty_bit() == None`, and `clean_bit(None)` is false — never
clean — so the old per-copy loop asked for them every time. Building
`by_bit` with filter_map dropped them, which would have treated them as
permanently clean and stopped refreshing them.

`Layout` now keeps those indices in `untracked`, and `prepare` asks for them
unconditionally before the word-at-a-time scan of the tracked ones.
`dirty_indices` also returns before reading any word when `by_bit` is empty.

Synthetic tests only; no game data.
`is_translation` decided whether a directory in the cache is one this crate
wrote by looking for `host-pipelines.bin`. #1653 splits that library into
`host-pipelines.NN.bin` shards and drops the single file, so the two changes
read each other's directories as foreign: pruned ones would never be pruned,
and with #1653 first this file does not even compile (`LIBRARY_FILE` is gone).

`library_in(dir)` accepts either, and the pruning test writes the file by its
name, so this lands the same way before or after the split - checked by
merging the two branches and running `cargo test -p victory-gpu pipeline::`
(24 passed, both the shard tests and the pruning test among them).
Co-authored-by: LooperSalty <[email protected]>
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
UnregisterAppStateChangeNotification and UnregisterAppConstrainedChangeNotification previously only removed the registration from the vector while end_title dispatched cloned snapshots on a background thread. A title freeing callback context immediately after unregistering could hit a heap use-after-free from either an in-flight invocation or a stale snapshot entry not yet started (including suspend callbacks unregistered during the constrained phase).

Track registered entries and in-flight (id, ThreadId) invocations behind a shared Notifications mutex+condvar, re-checking each entry before invoking it and waiting in unregister for any in-flight call on another thread to return via an unwind-safe RAII guard while allowing same-thread self-unregistration without deadlocking.
Nine switches were added by the prologue work and none was in the table a bug
report is written from: `VICTORY_GPU_STAMPS`, `VICTORY_GPU_REPORT` and its
`_MIN_MS`, `VICTORY_DUMP_SHADER`, `VICTORY_DUMP_ARGUMENTS`,
`VICTORY_TRACE_FAILS`, `VICTORY_ALLOW_COPYBACK`, and the two clamp-barrier
measurements (`VICTORY_ONE_BARRIER`, `VICTORY_NO_BARRIERS`).

They are the ones a report like the prologue's device removal needed: the
pipeline log names a shader hash and `VICTORY_DUMP_SHADER` gives its code; the
attribution of a 3 s frame needs the whole command list, not the two slowest
commands of it; and "why does this shader not translate" is `VICTORY_TRACE_FAILS`
rather than guessing from a dump.

Rows only, no behaviour change.
# Conflicts:
#	apps/victory/src/run.rs
`shadow`'s copies of title memory live in system memory (`Host::shared_buffer`
is a `CUSTOM`/`L0` buffer): the title's memory is host memory, so the copy is
something the CPU refreshes and compares, and every shader read of it crosses
PCIe. On the console the same read is GDDR6. The one experiment so far
(`VICTORY_COPIES_IN_VIDEO_MEMORY`) put them in a `GPU_UPLOAD` heap and measured
*worse* (3 196 -> 4 289 ms a frame in the world): that is a BAR window, not
video memory.

This is the mechanism for the other arrangement, small enough to review on its
own and not wired into the frame path:

    VramCopy::new(len)                    a buffer in D3D12_HEAP_TYPE_DEFAULT
    upload(list, offset, bytes)           staged now, copied when the list runs
    read(list, offset, len) -> Read        a readback after the list ran
    gpu()                                 the address a shader reads

Nothing is committed to using it yet - `#![allow(dead_code)]` and the module
doc say where it plugs in (`Shadow` gaining an `Option<VramCopy>`, `Batch::flush`
staging instead of memcpying, `Shadow::copy_back_page` reading through `read`).
Landing it separately means the integration PR can be a measured before/after
rather than a rewrite nobody can A/B.

The tests are the semantics the integration depends on (and they are what found
the one non-obvious rule):

* `uploaded_bytes_reach_a_shader_and_its_result_reads_back` - bytes the host
  stages arrive at a shader that reads the copy by GPU address, and the
  shader's result reads back;
* `what_a_shader_writes_reads_back` - what a shader writes is what the
  write-back path would see;
* `two_ranges_in_one_list_do_not_overwrite_each_other` - staged ranges are not
  shared behind the caller's back;
* `a_range_past_the_end_is_refused`, `a_copy_is_whole_pages`,
  `an_upload_reads_back_without_a_shader` - the edges, and the copy path with
  no shader in it at all.

**What the tests found:** a copy from `COMMON` is not ordered against a shader
access on either side of it. The first version of `upload`/`read` copied from
`COMMON` and the readback came back zeroed - the shader read the buffer before
the copy landed. Both now enter and leave an explicit state
(`COMMON -> COPY_DEST -> COMMON`, `COMMON -> COPY_SOURCE -> COMMON`), which is
the same shape `capture.rs` uses for its readback and the reason its comment
says a title buffer's copy, never transitioned, is only ever read.

Verification: `cargo test --release -p victory-gpu` - 237 passed, 1 ignored
(the new six among them); clippy `--all-targets -D warnings` clean on `main`.

No frame-time claim: nothing in the frame path changes here.
A synthetic measurement, no title involved: the same copy of 128 MiB read by a
compute shader, once from video memory (`VramCopy`) and once from the system
memory `shadow`'s copies live in today (`Host::shared_buffer`), with two
access shapes - a stride-1 scan and a random 16-byte line a thread - one 16-byte
read a thread and no stores, so the timing is the reads.

Measured here (RX 9070 XT, shared machine, best of three, ten dispatches a
list):

    128 MiB read        video     system    ratio
    stride-1 scan      3.829ms    4.021ms   1.05x
    random lines      56.301ms   57.100ms   1.01x

Earlier shapes agreed before the parallism was raised (1.21x / 1.04x), and the
one in-game experiment that exists - `VICTORY_COPIES_IN_VIDEO_MEMORY`, a
`GPU_UPLOAD` heap - measured *worse* (3 196 -> 4 289 ms a frame).

So: on this machine, putting these copies in video memory does not make
shader reads faster, in either access shape. Two readings of that, and both
matter before anyone writes the integration:

* either the reads are not what the frame spends its time on (then variant A
  would have bought nothing, and the frame's cost is elsewhere), or
* the `CUSTOM`/`L0` copies already come back at PCIe speed on this machine
  (~32 GB/s measured) and video memory has no headroom left to give.

Either way the number that decides the integration now exists, and it says no.
The unit stays (its own tests hold the mechanism), and this test is the record
of why it is not wired in - and the thing to re-run on a machine whose result
differs.

Verification: `cargo test --release -p victory-gpu` - 238 passed, 1 ignored;
`clippy --all-targets -D warnings` clean.
Whether a frame draws the scene several times over is not visible from the
draw count: the world reports 5 000-10 000 draws a frame for a prison cell,
which is a few hundred on a console, and the frame line said nothing about
what those draws cover. `take_work` counts, per frame, vertices
(`DrawInstanced`), indices (`DrawIndexedInstanced`), dispatch threads
(groups x 64) and mesh groups (x 128), and the report logs them:

    work a frame: 96 000 vertices, 74 000 indices, 734 000 dispatch threads,
                  5 700 mesh groups

The counters are the two atomics a draw already pays (`DRAWN`); the line is
printed by the diagnostics report, beside the draw count and the dropped ones.
Indirect records are not counted here - their arguments are read out by
`VICTORY_DUMP_ARGUMENTS`, which names the work per record.

No behaviour change; the numbers are what the next run is for.
Match depth_stencil_desc's D3D12 BOOL semantics for StencilEnable (c[3] != 0) instead of checking c[3] == 1, and cover non-1 non-zero values (2 and u8::MAX) as well as 0 in stencil_write_mask_requires_a_reachable_op.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two arms with it set (ncb1/cb1 and cb2 in one A/B) died before the world:
`0xc0000005` reading `0x8` and `0x80000003`, both in the title's own image, and
both arms without it ran 6-7 minutes each with 0 removals and 0 exceptions.

That is what the rule beside it already said in words - a list that computed
from zeros hands the title garbage pointers - so the switch is documented as
the demonstration of that, not as something to use.

Measured on the same driver, same scene, 240 s arms: withholding is not what
keeps the game from advancing; the missing copies are the problem, and the
switch shows fixing it the wrong way round breaks the title.
The merged PRs grow lower.rs from 520 563 to 544 760 bytes; the asset
policy test refuses files past 524 288. #3097 does the same move but
conflicts with the merged set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:17:58 +00:00
Author
Owner

@⁠qtLkz on GitHub · 2026-11-26 18:43 UTC · original

@⁠pes7 One note on the set: #2774 is in the pass2 group. Its fixture change (the stride tests switched to raw buffers) makes a_heap_buffer_read_by_element_takes_the_views_stride pass on NVIDIA by no longer exercising a structured view. The runtime defect underneath (a raw read through a structured view applies the stride twice on NVIDIA) stays.

I made that mistake myself on #2317: a stack with #2774 reported 0 failures on an RTX 4070 Ti, and I had to correct it. With the fixtures untouched, #2885 is what actually fixes it in the runtime. On the same card, main 63bcca4 + #2596 + #2683 + #2633 + #2885 gives victory-gpu 233/0 and victory-shader 313/0, including the stride and gather tests (details in #2317). #2774 was also proposed for close in triage.

So for this set: if #2774 lands without #2885, the stride tests go green on NVIDIA while title reads through structured views stay wrong. I'd suggest leaving #2774's fixture part out, or at least not counting it as the NVIDIA fix. I haven't checked its signed MAD64 part, so this note is only about the fixtures.

AI-assisted (Claude).

**@⁠qtLkz** on GitHub · 2026-11-26 18:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/3327#issuecomment-7200778153) @⁠pes7 One note on the set: #2774 is in the pass2 group. Its fixture change (the stride tests switched to raw buffers) makes `a_heap_buffer_read_by_element_takes_the_views_stride` pass on NVIDIA by no longer exercising a structured view. The runtime defect underneath (a raw read through a structured view applies the stride twice on NVIDIA) stays. I made that mistake myself on #2317: a stack with #2774 reported 0 failures on an RTX 4070 Ti, and I had to correct it. With the fixtures untouched, #2885 is what actually fixes it in the runtime. On the same card, main 63bcca4 + #2596 + #2683 + #2633 + #2885 gives victory-gpu 233/0 and victory-shader 313/0, including the stride and gather tests (details in #2317). #2774 was also proposed for close in triage. So for this set: if #2774 lands without #2885, the stride tests go green on NVIDIA while title reads through structured views stay wrong. I'd suggest leaving #2774's fixture part out, or at least not counting it as the NVIDIA fix. I haven't checked its signed MAD64 part, so this note is only about the fixtures. AI-assisted (Claude).
github-bot changed title from Merge candidate: triaged ready-to-merge PRs built and tested together (draft, in progress) to Merge candidate: open PRs merged, built and tested together (draft, in progress) 2026-11-26 18:58:31 +00:00
Reuse LICObr's correction from upstream PR #2357, head dd25e37.
Reuse BastienRodz's correction and original regression from upstream PR #2254, head 5a8a792.
Non-cube 1D/2D/1D-array image_get_resinfo filled unused width/height/depth
channels with 1 (DXIL's unused fill). RDNA2 returns 0 there. Cubes keep 1
for the unused depth channel; UAVs still report one mip level.

Refs #1249 / #1242 (VIC-BT-038). Open #1313 needs rebase; this is a focused
re-land on current main with a synthetic 2D GPU/WARP regression.

Co-authored-by: Matsvey Makushenka <[email protected]>
Batch::flush kept, as a copy's current range, the union of the ranges it
refreshed whenever they touched. Two flushes of one submission that each
refresh part of a 64 KiB page ([p, p + 4 KiB), then the rest) leave the
page changed and unguarded: Tracked::take copies a page held in part and
"stays changed". Their union still covered the whole page, so a later
refresh of all of it in the same submission (Batch::add) was skipped and
the page was never taken. After the submission copy_back_marked found it
changed with nothing saved and kept the title's bytes, dropping the
shaders' writes to it (copy_back_page too).

Ranges now join only where they meet across a page boundary, so no page
is current unless one refresh covered it whole; whole pages still join.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
copy_back_marks runs before the copy-backs of declared ranges. It puts a
marked page's GPU bytes back, and the copy takes the title's others
(`*h = *t`), but the snapshot of a declared range over that page
(Shadow::before) kept the bytes from before the submission. That range's
copy-back then found the title's bytes the copy had taken differing from
the snapshot, took them for the GPU's, and put them back over what the
title had written in between.

copy_back_marked now brings the snapshot over the page to the copy's
bytes (sync_snapshot).

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
title_memory_remapped marked [first, last) changed through `changed`,
which follows alias links: every other address showing the same
physical pages was opened and its trackers marked changed, without
saving. Those addresses still show the same bytes. If a copy there was
armed for marked writes, copy_back_marked then found the page changed
with nothing saved and kept the title's bytes, dropping the shaders'
writes; and a later title write there no longer faulted to save the
page.

Mark only [first, last) (changed_here), and when its alias links go,
open a page that was guarded for them only, one no tracker holds itself
or through a remaining alias.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
root_signature_for declares user_data_dwords().max(1) root constants even when a shader reads no user data. Passing Vec::new().as_ptr() (0x4) with count 0 to SetComputeRoot32BitConstants or SetGraphicsRoot32BitConstants causes NVIDIA's D3D12 driver to dereference 0x4 (STATUS_ACCESS_VIOLATION), while skipping the call leaves the declared slot unset. Bind &[0u32] when the slice is empty and test both Host::dispatch and Host::draw on hardware and WARP.
Only whole pages were; the page stayed changed and unguarded, so the next
submission's marked writes to it were dropped.
The table lived and died with the heap, which the title may release while
the GPU still reads it as a root view. It is also made under the made-slots
lock now, so a view noted meanwhile is not lost.
The title may unmap the vertex buffer between the draw and the submission;
the raw slice over it faulted.
The list's per-texture first-use set was kept across defer_copy and defer,
so a later draw skipped the upload and read the pre-copy pixels.
Every store through a heap view sets its page's bit in the write-mark
bitmap, and every heap-direct texture read its slot's read mark: a load of
the bitmap word, and an atomic OR where the bit is clear. The bitmap is in
system memory (the CPU reads and clears it after each submission), so on
the GPU each of those loads crosses the bus, once per lane. Most lanes of a
wave write the same 64 KiB page or read the same slot.

Lanes whose bit equals the first active lane's now leave the load and the
atomic to that lane (`waveReadLaneFirst`, `waveIsFirstLane`). In pixel
shaders the leading lane is the first that is no helper (a helper's writes
are dropped): the lowest lane index among non-helpers, by `waveActiveOp`
min, and `waveReadLaneAt` of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pixel wave of helpers only had no non-helper lane, so the minimum key was
u32::MAX and waveReadLaneAt read past the wave. A helper's key is now its
lane with bit 30 set: the minimum is the first non-helper, or a helper that
no lane matches as leader, at a lane index that exists (bit 30 masked off).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A VOP3 f16 result with an output modifier (times 2, 4 or 0.5) was
refused ("an output modifier on a 16-bit operation"). It now translates
with the modifier ignored: the clamp still applies in f32 and the result
is rounded to a half once. The RDNA2 ISA guide (section 6.2.2) ignores
output modifiers when output denormals are enabled, and the float model
keeps 16-bit denormals. The exactly rounded v_fma_f16 path follows, and
half_modifiers no longer multiplies an f16 interpolation result.

Test: f16_results_ignore_their_output_modifier (v_add_f16 of 1.5 and
0.25 with each modifier, and with div:2 and clamp; v_mul_f16 and
v_fma_f16 with mul:2; on the hardware adapter and WARP).
interpolated_f16_writes_the_op_sel_half_with_modifiers checks the clamp
without the multiply.

From DexNom/VIctory@570a941e9b
(float_result's output modifier).

Co-authored-by: DexNom <[email protected]>
half_src decoded the inline constants 240..=248 as packed f16 patterns for
every 16-bit operation. Hardware only uses those patterns when the source
type is F16; an integer operation sees the 32-bit value, so 1.0 is
0x3F800000 and its low half is 0 (the high half 0x3F80). Route
v_cvt_f16_u16/i16, the 16-bit add/sub/mul/shift/min/max ops, and the
u16/i16 compares through the 32-bit view, keeping f16 operations on
f16_operand.

Measured on a Radeon RX 7800 XT: v_add_nc_u16 v0, 1.0, v1 with v1 = 5
yields 5, and with op_sel selecting the high half 16261; before the change
they yielded 0x3C05 and 5.

Addresses VIC-BT-021 from audit #1242.

Validation:
- cargo test -p victory-shader --locked -- --test-threads=1
  --skip emit::valu_tests --skip emit::waterfall_tests
- the new GPU test on the RX 7800 XT (Agility SDK runtime) -- passed
- cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings
- cargo xtask policy
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- valu_tests: #1668's test closes the closure it follows (my resolution dropped `});`); #2792's test keeps its #[test]
- shadow.rs, host.rs: no doubled #[test] from the kept-both resolutions
- watch.rs: #2415 opens a page through open_runs, which #2848 put in place of open
- waterfall_tests: one helper takes both #1253's wave_ops and #2457's expected nonuniform handles

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Some host drivers crash while compiling a translated shader. Under Wine
the fault inside vkCreate*Pipelines ends the process with exit code 3
before any handler runs, so nothing names the shader and the same crash
comes back on every run.

With VICTORY_PIPELINE_JOURNAL=1, each host pipeline is noted in
pipeline-journal/pending/ while it is created, and the note is removed
when creation returns. A note left at the next start names the pipeline
that was being created when the process ended: it goes into
pipeline-journal/crashed.txt and is refused from then on, its draws and
dispatches dropped like those of any refused pipeline. Pipelines are
created one at a time while the journal is on, so a crash names only the
pipeline that caused it. Off by default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each constant buffer fill of a submission was one ReadProcessMemory call,
0.7-1 us for a few hundred bytes. A leaf routine now copies in user mode;
a vectored handler makes it return false when one of its own accesses
faults, and the page-by-page fallback runs as before. Runs of fills are
timed as one. 4096 fills of 256 B: 2.94 ms -> 0.046 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A crash with one pipeline in creation names it (crashed.txt) as before. A
crash with several in creation makes them suspects (suspects.txt): they
are not refused, but each is created alone until its creation returns, so
a repeat crash leaves one note and names it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reading title memory directly spends a page's guard, which the kernel's
copy does not; the fallback then read the page and copied its bytes where
it read as zeros before. The handler now puts the guard back, with the
page's other protection, before the copy fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cross-builds the test binaries with clang-cl, lld-link and an xwin splat
and runs them in a Wine prefix under target/. --vkd3d-proton puts that
folder's D3D12 in the prefix instead of Wine's own. The loader's
end-to-end test cannot start cargo inside Wine, so its fixture is built
beforehand and named by VICTORY_HLE_PROBE.
Library paths go through CARGO_ENCODED_RUSTFLAGS and include paths are
shell-quoted for cc (CC_SHELL_ESCAPED_FLAGS), so a path with spaces is
no longer split.
Idea from ivall/xcl#254: XCL's scatter asked VirtualQuery about every page
whose home it mapped, and the query's cost grew with the run, so n pages
cost O(n^2) (16,384 pages: 29 s there). Scarlight has no per-page query --
a page costs one unmap, one view and one commit, linear in the pages -- so
nothing here is quadratic. Consecutive addresses still paid those three
system calls per 64 KiB page though: XMemMapPhysicalPagesScatter called
XMemMapPhysicalPages once per entry, which defeated the run batching that
call already does.

Now addresses given in consecutive pages ride one call: one unmap of the
run, one view per section run, one commit per run. A zero page ends the run
it is in (it unmaps only its own address), and a run that spans two
placeholders -- which cannot be one view -- falls back to the per-page
calls, so every case the old code mapped still maps.

Diagnostics: the copy line now reports page scatters, the pages they name
and the map calls they made, so a run tells whether the title scatters at
all and how much of it batches.
Builds on the double type and makeDouble of #416 (v_cvt_f32_f64), which
this commit includes below it. A double is a VGPR or SGPR pair; DXIL has
fadd, fmul, fma, fmax and fmin for it.

Lowered: v_add_f64, v_mul_f64, v_fma_f64, v_max_f64, v_min_f64, every
v_cmp_*_f64 and v_cmpx_*_f64 except class, v_cvt_f64_f32, v_cvt_f64_i32,
v_cvt_f64_u32, v_cvt_i32_f64 and v_cvt_u32_f64. Sources take the abs and
neg modifiers on the sign bit, inline float constants, literals (the high
dword) and SGPR pairs; output modifiers on a double result are refused.

fma and the double/integer conversions are D3D11.1 double extensions, so
they set the new DOUBLE_EXTENSIONS flag (ShaderFlags bit 6, SFI0 0x20),
which the validator checks. Of two zeros, min and max follow the f32 rule.
A constant v_cmp_f/v_cmp_tru builds no doubles: WARP loses the device on a
double `fcmp false`.

The new code is in emit/lower/double.rs; #416's double_src there becomes
fsrc64 (any source, not only the first).

Tests (valu_tests.rs) run each instruction on the host GPU and WARP and
compare with Rust's f64: IEEE results with NaN, infinities, zeros and
overflow, min/max zero order, abs/neg, SGPR pairs, all 16 compare
predicates, and saturating conversions. Checked on an RX 6950 XT: clippy
(both CI runs) is clean and cargo test --workspace passes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The cargo calls run from the repository root, so a relative --xwin was
checked against one directory and used from another. It is now made
absolute first; std::path::absolute keeps the splat symlink.
The module is not referenced here and its file lives on another branch; with
--all-features the build stopped on a missing producers.rs.

Written with an AI assistant.
An empty library was asked for with an empty Rust slice, whose pointer is
dangling and non-null. Windows only looks at the length; vkd3d-proton
refuses a non-null blob of length 0 with E_INVALIDARG, so under Wine every
run logged 'no host pipeline library: pipelines are not kept' and the
early-start list was never written. The empty library is now created with
a null blob.

Loading a pipeline held the library's mutex for the whole LoadPipeline
call. Where the host's library keeps no compiled code (vkd3d-proton with
its internal cache on), a load is a whole pipeline creation, so the workers
made 'loaded' pipelines one at a time. The load now runs on a reference of
the library's own, outside the lock (as creation already did).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsTmwWj9LVy4o3qDH52Jas
Signed-off-by: Impre-visible <[email protected]>
The module documentation of victory-gpu's shader_cache links to build(),
which is private, so RUSTDOCFLAGS='-D warnings' cargo doc --workspace
--no-deps fails with rustdoc::private_intra_doc_links. Commit 5864aab
fixed the same page's other link; this one arrived with the shader cache
keyed by the translator. It is written as code, as the other private
items are.

cargo doc --workspace --no-deps --locked with -D warnings now builds all
eleven crates.

Assisted-by: Claude Code (Claude Sonnet 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
C::Scatter was added once per run, so a call with two runs counted
twice; it is now added once per call, above the loop. C::ScatterMaps
in the per-page fallback sat after the failure check, so a failed
attempt went uncounted; it is now added before the call. The test
comment above the two-address unmap said three.
main now loads from the library outside the lock itself, so that half of
this branch is dropped in favour of main's. What remains is the empty
library created with a null blob.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsTmwWj9LVy4o3qDH52Jas
Signed-off-by: Impre-visible <[email protected]>
`rectangle_gs` previously marked every component of every register-allocated
`OSG1` element as used (`(1 << cols) - 1`) and left all geometry-shader output
`InterpolationMode` entries at `0` (`Undefined`).

1. When a vertex shader leaves declared output channels or an unused output
   semantic unwritten (`NeverWrites_Mask` in `OSG1` byte `at + 25`), reading
   those components in the generated geometry shader sets `ReadWriteMask` bits
   in `GS.ISG1` that `VS.OSG1` marks never-written, causing D3D12
   `CreateGraphicsPipelineState` to reject the rectangle-list pipeline with
   `E_INVALIDARG`. Derive each element's `usage` from `Mask & !NeverWrites_Mask`
   and emit `loadInput`, fourth-corner arithmetic, and `storeOutput` only for
   written channels (rejecting containers with no written outputs), keeping
   `GS.OSG1` identical to `VS.OSG1`.
2. Populate geometry-shader output interpolation modes with the same defaults
   as `emit()` (`LinearNoperspective` for `SV_Position`, `Linear` for float
   attributes/clip/cull, `Constant` for integers and `SV_IsFrontFace`) followed
   by `same_mode_per_row`, while keeping `GS` inputs at `Undefined` (`0`) and
   keeping corner `v0`'s value for flat float outputs as well as integers.
valu_tests.rs: both sides append tests at two places, each ending in the same closing lines;
both kept.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Windows 10's in-box D3D12 runtime stops at shader model 6.5, so `Host::new`
returns `Err` and the seven `emit::valu_tests` panic on `assert!(ran > 0)`.
The application has an opt-in for this (#463); the test binaries do not, so
`cargo test -p victory-shader` keeps running against the in-box runtime and
those seven tests keep failing on a Windows 10 host.

`build.rs` looks for the runtime where the application puts it,
`target/<profile>/D3D12/D3D12Core.dll`, mirrors it into
`target/<profile>/deps/D3D12/` because the loader resolves `D3D12SDKPath`
next to the running module and test binaries run from `deps`, then exports
`D3D12SDKVersion` and `D3D12SDKPath`. Both steps happen only when the file is
present, so a build without it behaves exactly as before.

The two symbols are exported with the linker's `/EXPORT:...,DATA` rather than
a `.def` file, because `.def` is not on the asset-policy allowlist.

Before: 62 passed; 7 failed
After:  69 passed; 0 failed

The version in `agility.rs` must match the shipped runtime's
`D3D12_SDK_VERSION`; with a mismatched pair the loader silently falls back to
the in-box runtime and the tests fail again with no warning.

Co-authored-by: Claude (claude-opus-5-5) <[email protected]>
The version in `agility.rs` has to equal the shipped runtime's
`D3D12_SDK_VERSION`, or the loader silently falls back to the in-box copy and
the tests fail again with no warning. Review suggested copying 1.620.2 in, so
use its constant (620) rather than 610.

Re-verified with that DLL on Windows 10 19045 + RTX 3080: 69 passed,
0 failed. The no-runtime path is unchanged — build.rs returns before emitting
anything, which is what the Wine run confirmed.

Co-authored-by: Claude (claude-opus-5-5) <[email protected]>
`twin::uav` previously accepted any view format in the twin plane's DXGI
family (`family(view) == own`) and required an explicit 2D or 2D-array
description (`words?`):

1. Depth (`D32_FLOAT` = 40, `D16_UNORM` = 55) and typeless (`R32_TYPELESS` = 39,
   `R16_TYPELESS` = 53, `R8_TYPELESS` = 60) formats belong to the twin plane's
   own family, so `family(view) == own` passed them straight into D3D12
   `CreateUnorderedAccessView`, which rejects depth and typeless UAV formats
   and removes the host device. Map typeless, depth, and `DXGI_FORMAT_UNKNOWN`
   (`0`) view formats to the plane's concrete UAV format (`R32_FLOAT`,
   `R16_UNORM`, or `R8_UINT`), while preserving explicit typed UAV formats
   (`R32_UINT`, `R16_FLOAT`, `R16_UINT`, `R8_UNORM`, etc.) and recognizing
   planar stencil formats (`22`, `47`) as integer.
2. Support null UAV descriptions (`words = None` -> mip 0, plane 0, full array
   span) and 1D / 1D-array depth UAV dimensions (`2`, `3`) instead of dropping
   the view.
The lowering emits the product rounded (and flushed) before the add,
which is what the ISA says, yet a driver folds the fmul into the fadd
behind it as an FMA though nothing carries a fast-math flag: on the
2070-class card here the tail of the product escapes one rounding where
two were due (2 of 2560 inputs on v_mad, 102 of 14440 on v_mac, WARP
none, the model none). An FMad over a zero signed by the operands'
signs rounds exactly like the plain product and hides the multiply
behind a call the fusion pass sees no other side of; with it the
arithmetic suite meets both backends word for word.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
IGameInput, IGameInputDevice and IGameInputReading shared one slot 0 that
always returned E_NOINTERFACE and never touched *out. Each object now
answers IID_IUnknown and its own interface GUID from GameInput.h, AddRefs
through its own slot 1 (so readings stay reference counted), clears *out on
failure and returns E_POINTER for null required pointers.

Add a test that exercises both paths on all three objects, including the
null-out and null-IID cases.

Addresses VIC-BT-020 from audit #1242.

Validation:
- cargo test -p victory-hle --locked -- --test-threads=1
- cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings
- cargo xtask policy
BaggyALPHA's follow-up on the v0 table review: the Windows SDK interface has
22 slots and the device table stopped at 21. IsForceFeedbackMotorPoweredOn
(0x38) and AcquireExclusiveRawDeviceAccess (0xa0) now answer false, and
ReleaseExclusiveRawDeviceAccess (0xa8) is a typed void no-op, so a title that
calls them gets an answer instead of E_NOTIMPL at the wrong slot.

Reported-by: BaggyALPHA <[email protected]>
RDNA2 saturates a 32-bit UINT channel of a d16 format load to 0xFFFF and
a SINT one to -32768..32767; d16_channels kept the low 16 bits (70000
loaded as 0x1170). Measured on gfx1031 (xcl-dev/xcl#1488, XCL-BT-020) and
gfx1036 (boykopovar/AnyPS5#22750). 8- and 16-bit formats never leave that
range, so they are unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A heap-buffer read of a slot that holds no view reads the host's null
views, which sit at the end of the whole HEAP_VIEWS-slot heap: a heap
the RTX 5070 laptop's driver refuses (Paramètre incorrect, its
shader-visible heaps stop at the million `victory-gpu` caps them to, the
game path short of the same limitation). The dispatch then died before
its first draw. The host now asks once whether the device takes the
whole heap, and a test whose views reach the heap's end says so and runs
where the slots exist; WARP and every other machine keeps the check.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
CreateUnorderedAccessView on a texture whose (final) format the host cannot
store to (the packed 16-bit B5G5R5A1 / B4G4R4A4 formats) is refused and, on
NVIDIA, takes the device with it. Check the format with typed_store() like
the other typed views do and make such a view null instead.

Seen running GTA VI on an RTX 5060 Ti.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A run of consecutive addresses was mapped in one XMemMapPhysicalPages call
even when it crossed two reservations; that call unmaps the whole range
first and then fails (the crash on anasssssssss1's machine logged os error
487), leaving pages past the failure unmapped where the old per-page path
left them alone. A run is now cut where its pages stop being consecutive
slices of one section, which is the most one call can map and always sits
inside one placeholder. The new test reserves two placeholders that are
adjacent and maps a page in each through one scatter call.
UuidFromStringA and UuidFromStringW document a null string pointer as writing the nil UUID and returning RPC_S_OK, and accept only the 36-character canonical 8-4-4-4-12 text form rather than braces, misplaced dashes, or trailing characters after a closing brace. Also return RPC_S_OUT_OF_MEMORY when UuidToStringA or UuidToStringW fails to allocate.
The DXGI output mode list was fixed at the console's 3840x2160, so hosts
smaller than that carried the 4K render targets and their VRAM cost. Read
VICTORY_MODE=<width>x<height> instead (both dimensions 1..=16384); an
unparseable or out-of-range value keeps the 4K default.

From the local patches @pfhandler posted under #1677 while running through
vkd3d-proton on an 8 GB card.

Validation:
- cargo test -p victory-gpu --locked -- --test-threads=1
- cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings
- cargo xtask policy
- rustfmt --edition 2024 --check on the changed file
v_floor_f32, v_ceil_f32 and v_fract_f32 gave the host the operand as it
was, so a host that keeps 32-bit denormals gave -1 for floor of a tiny
negative number, 1 for ceil of a tiny positive one, and almost 1 for fract.
An RTX 5080 on vkd3d-proton keeps them: its driver offers no
flush-to-zero control. rounding_matches_the_hardware failed there.
(cherry picked from commit 63111deb4d007dd0830864f4e22cd5264bd01275)
VOP3 abs and neg on v_lshl_add_u32, v_add_lshl_u32, v_alignbit_b32 and
v_alignbyte_b32 stopped translation as integer operand modifiers. RDNA2
applies them to a source's bit 31, as on a float: abs clears it, neg
flips it (boykopovar/AnyPS5#25964, all combinations on gfx1036 and
gfx1201; #25799 for the align ops). Other integer operations still
refuse them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	README.md
#	crates/victory-gpu/src/pipeline/host.rs
Two cases set both modifiers on the same source (add_lshl src0, lshl_add
src2): abs clears bit 31, then neg sets it. They fail if the two are applied
the other way round (checked by swapping them locally).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Suggested by YaBulochka in #491:

- A note in pending/ is named <key>@<stages and sizes>@<pid>-<n>, for
  example 4e296b1885c37b29@compute-2232@32-23, so pending/ can be read
  without the log. The same goes as a comment above the pipeline's line
  in crashed.txt.
- At start-up, the refused pipelines are listed with a warning that
  every draw and dispatch using one is dropped. How many is only known
  once the title asks for them; each is still logged once when first
  skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fromthemoonx found in #491 that a second instance opening the journal
refused the pipeline the first one was creating. Notes name their
process id; one whose process is still running is now skipped and kept.
The README says how to undo the refusal a quit during creation causes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
vccorlib140.dll imports OLEAUT32 ordinals #4 (SysAllocStringLen) and
#6 (SysFreeString), which match the host System32 exports.

Closes #811.
map_dll previously lowercased the imported DLL name before joining it to
the title folder, skipping mixed-case title DLLs (such as Bink2Scarlett.dll
or libHttpClient.GDK.dll) without error whenever the title directory sits
on a case-sensitive filesystem (Linux ext4/btrfs/xfs under Wine/Proton,
WSL-created NTFS folders with inherited case sensitivity, or WSL2 9P
mounts).

Check the exact spelling first and fall back to an ASCII case-insensitive
directory scan that skips colliding directories, while keeping the
lowercase key for deduplication and the caller-visible module list.

Fixes #762.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsTmwWj9LVy4o3qDH52Jas
Signed-off-by: Impre-visible <[email protected]>
# Conflicts:
#	crates/victory-gpu/src/capture.rs
#	crates/victory-gpu/src/texture.rs
No query ran on the host GPU. BeginQuery and EndQuery did nothing and
ResolveQueryData wrote stand-ins after the submission.

A title heap for occlusion, pipeline statistics or timestamps gets a
host heap on first use. Begin and end are recorded in order with draws.
Timestamps only end, duplicate begins and ends without a begin in the
same list are dropped, and close ends outstanding host queries.

The host resolves measured queries into mapped read-back memory owned
by the command list, in COPY_DEST throughout. It reuses arena chunks
on reset. Ordered bottom-of-pipe CPU writes put measured results and
stand-ins into title memory, including unaligned destinations. The
last resolve of a slot wins across all lists in the submission.
Timestamps are converted with the host queue's calibration onto the
title's 100 MHz clock, sampled before applying any deferred writes.

Main's shader copy-back is unchanged. A list that read title memory
with no host copy withholds its shader writes, and still runs the
deferred CPU writes. Subsequent GPU reads get the new title bytes
through main's normal host-copy refresh, as they do for stand-ins.

The CPU sees the query results after the resolving submission. GPU
commands later in that submission see the destination's previous
bytes. Main has no predication implementation.

Tests use synthetic title list, queue and heap calls with a small host
triangle. They cover measured queries, stand-ins, overlapping resolves,
timestamp ordering, the missed-list case, and the same buffer used as
a UAV before the resolve and refreshed on a later submission.

The full diagnostics suite passed on WARP after the rebase (153 passed,
2 ignored). Both workspace Clippy configurations passed. The earlier
RTX 5070 runs were before the rebase.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The emitted DXIL's `main` is read back from the container (the
unabbreviated records the writer makes) and counted: blocks, and
instructions by kind, a call by the function called. `translate --count`
prints the total, by stage and by kind; with `--list`, a line per
program. The report holds counts only.

So a change to the translation shows what it takes out of the code the
host's compiler is given, program by program, next to the validator's
verdict on each.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A title draw the host skips because its pipeline is unavailable, its
shader is unsupported or its indirect execution cannot run leaves any
surrounding occlusion query counting too few samples. The title can
then cull what the draw would have shown.

Mark active queries when a draw, mesh dispatch or indirect execution
is skipped. End marked occlusion and binary occlusion queries on the
host and write their stand-ins (2^20 samples or visible) through the
same deferred CPU write path as measured results. Pipeline statistics
keep what the host counted.

A synthetic title draw without a bound pipeline exercises the two
occlusion stand-ins. The query begun after the skipped draw measures
zero and the statistics include the host draw. The test passed on
WARP after the rebase. The earlier RTX 5070 run preceded the rebase.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
An ignored test that runs the submissions of a made-up world frame through
Host::execute on made-up title memory (write-watched pools, physical pages
shown through two views), at the per-frame volumes a title run published
on issue #400, and prints the parts next to the published numbers and the
cost of each mechanism on its own. No title, no hardware GPU needed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Wire the remaining six XGameSave provider, container, blob, and update
method-table slots in `crates/victory-hle/src/modules/xgamesave.rs`:

- `0x18` (`XGameSaveInitializeProvider`): blocking provider open with
  null-handle clearing on failure.
- `0x38` (`XGameSaveGetRemainingQuota`): blocking quota query.
- `0x50` (`XGameSaveDeleteContainer`): blocking container deletion with
  container-name validation.
- `0x78` (`XGameSaveEnumerateContainerInfoByName`): prefix-filtered
  container enumeration tolerating null/empty prefixes and early stop.
- `0x90` (`XGameSaveEnumerateBlobInfo`): unfiltered blob enumeration
  delegating to `enumerate_blobs`.
- `0xd8` (`XGameSaveSubmitUpdate`): blocking atomic update commit.
Without `--validate` the summary read "0 validated", and without
`--pipelines` "0 pipelines": zeros that a reader of a pasted report takes
for "none passed". The lines now say "validation not checked" and
"pipelines not made" for a check nobody asked for (review of #2115).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
pipelines_load_on_many_threads_at_once returned at "no shader compiler
here" under Wine: Wine's d3dcompiler_47 (vkd3d-shader) refuses
RWByteAddressBuffer.Load ("Method 'Load' is not defined") and stores to
structured buffers ("not yet implemented"), and does not keep a
[RootSignature] attribute in the code. The test never dispatches, so its
96 programs now differ by group size alone, with no resources, and the
empty root signature is serialised apart.

Under vkd3d-proton the test then reaches the library, and needs #1722
there (an empty library from a null blob).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The bindless and draw tests took the root signature from the compiled
shader. Wine's d3dcompiler_47 (vkd3d-shader) drops [RootSignature]
("W5302: Ignoring unknown attribute") and has no rootsig target, so
CreateRootSignature failed (E_FAIL) and the tests with it under Wine and
Proton.

test_root makes the root signature from the RS string each source
already defines, with D3D12SerializeRootSignature (version 1.0), and the
tests pass it with the pipeline, on every host. The sources are
unchanged.

Under Proton Experimental's Wine (11.0) with vkd3d-proton on an RTX 3050
Laptop, the victory-gpu lib tests go from 129 passed / 14 failed to 135
passed / 10 failed (four fixed, two new). Under Ubuntu's Wine 10.0 the
compiler gives SM 5.1 resources a garbage register space ("dxil-spirv:
Failed to remap SRV 17476:0"), so these tests still fail there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On some host/driver pairs the driver's compiler is not safe to call
from several threads at once: on AMD RDNA4 the amdxc64 compiler
crashes while pipelines compile in parallel, and one worker avoids it.
The variable sets the worker count (0 makes pipelines on the calling
thread); unset, half the logical processors, 2 to 8, as before.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Shared::rewrite marked the table up to date even when a copy got no view slots (HostHeap::pair returned None), so memory::prepare skipped the rewrite at every later submission until some copy came or went, and the copy kept reading as missing. A rewrite that left a copy out now leaves the generation stale, so the next submission tries again.
The repository does not name the console SDK or quote its headers. Rename
the three ids the way media.rs names its own (`INPUT_IID`, `DEVICE_IID`,
`READING_IID`), drop the header name from the doc comment, and describe
the typed stubs by what they do instead of by the methods' names.
Keep the state reached by the final payload byte of an unflushed fragment and account for the drain clock before requesting the next header.

AI-assisted using OpenAI Codex GPT-6.2 Astra (Ultra and High).
The issue's reproducer is offline: `translate --pipelines` crashed in
amdxc64 on RDNA4, and translate sizes its own scoped workers by --jobs,
so the env never reached it. An unset --jobs now falls to the same
VICTORY_PIPELINE_THREADS the pipeline workers read (0 means one worker
there, since translate cannot run without any), covering both paths with
one setting.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
`Staging::refresh_now` hashes the whole tiled memory of every untracked
sampled texture with BLAKE3 on every refresh, and asks VirtualQuery
region by region whether it is committed. In a world frame that was
about 156 MB hashed and ~380 ms per frame on an RTX 2070 SUPER, with
nothing changed.

- The digest is a 128-bit non-cryptographic one (four 64-bit lanes, 32
  bytes a step, a SplitMix-style finish). It only has to tell whether
  the bytes changed. On 160 MiB in release it runs at 13.9 GB/s against
  BLAKE3's 2.3 GB/s here (6.1x).
- A range made only of mapped views of physical pages (MEM_MAPPED) can
  only change through the runtime, which calls title_memory_remapped.
  That now advances a remap epoch, and a texture keeps "committed" for
  such a range until the epoch moves. Other ranges are asked every time,
  as before.
- xmem::unmap notifies before UnmapViewOfFile2. A refresh between the
  two could cache the still-mapped view under the new epoch (found by
  DrDarkDK on #916). title_memory_unmapped advances the epoch once more
  after the view is gone.

The content is still digested in full on every refresh, so pages
remapped under a stable address still show as a change.

Tests: the digest catches single-bit flips in every part of the input,
a swap and a length change. The epoch test walks xmem's order (notify,
still mapped, unmap, notify again) and fails without the second bump.
An ignored benchmark compares the two digests.

Closes #916.

Co-authored-by: BlueKaiman <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The two symbols the Agility SDK loader looks for have to be exported by the
host module. The `.drectve` section this used to carry does not achieve that:
`link.exe` answers `.drectve \`/EXPORT:D3D12SDKVersion,DATA
/EXPORT:D3D12SDKPath,DATA' unrecognized` and forwards only `/DEFAULTLIB`
entries, so the symbols stayed unpublishable and the tests kept falling back to
the in-box runtime (reported by @kotekompotek on Windows 10 + GTX 1050).

Publish them from the build script instead:

- MSVC hosts get `cargo:rustc-link-arg=/EXPORT:D3D12SDKVersion,DATA` and the
  same for `D3D12SDKPath`.
- GNU hosts get a `.def` file passed as `-Wl,<path>`, because `ld` reads
  `.drectve` sections out of MSVC objects only and treats `/EXPORT:...` as a
  file name (`CARGO_CFG_TARGET_ENV` picks the branch).

`cargo:rustc-link-arg` covers this package's test and bench binaries, which are
the ones that must export. It also means `guard_runs` is asked to export a
symbol it did not define, which is why `agility` is compiled for every target of
the crate (that part is already in the first commit): the bench then defines
what the export names. A
library archive member is only pulled into a binary that references it, so the
application that hosts the device (`apps/victory`) can keep its own copy of the
selectors without a second definition in the same binary.

Nothing is exported unless the runtime is staged: `cfg(agility_runtime)` still
guards the statics, so a build without `target/<profile>/D3D12/D3D12Core.dll`
opts out rather than exporting selectors the loader would refuse (0x887e0003).

Verified on Windows 10 (MSVC host), 1.620.2 staged:

- `cargo build -p victory-shader --benches` links, no LNK2001.
- The unit-test binary exports both names (PE export table read back).
- `cargo test -p victory-shader --lib`: 243 passed, 3 failed, 3 ignored - the
  same three that fail on `main` on this machine (`stride_tests` twice,
  `synthetic_tests::gathers_at_a_level_match_the_hardware`).

Co-authored-by: Claude (claude-opus-5-5) <[email protected]>
buffer_store_byte_d16_hi and buffer_store_short_d16_hi were refused by
name, so a program using one did not translate. They store bits 16-23 or
16-31 of their VGPR through the same two atomics on the dword as
buffer_store_byte and buffer_store_short.
Co-authored-by: borosf <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-authored-by: borosf <[email protected]>
Cancel paired SSA values and fold constants over s_xor_b32/s_xor_b64 in copy propagation so three-XOR register exchanges (including via vcc_lo/vcc_hi and 64-bit SGPR pairs) preserve root parameter and descriptor origins across control flow.

Co-authored-by: Machad3x <[email protected]>
Co-authored-by: borosf <[email protected]>
RegOpenKeyW and RegOpenKeyExW returned ERROR_FILE_NOT_FOUND for any
path below our stand-in for HKLM\...\CurrentVersion\OEM, including a
null or empty one. The documented behaviour, and the host's: RegOpenKeyW
gives back the key it was passed, RegOpenKeyExW a handle to the same
key. Other paths below it still are not found (it has no subkeys).

Test: both functions with a null and an empty subkey, on our key and on
a host key for comparison.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With a null phkResult and a subkey other than null or empty, open()
returned ERROR_FILE_NOT_FOUND for our OEM key before it looked at the
output pointer. The host checks the pointer first: on Windows 11 its
RegOpenKeyW and RegOpenKeyExW return ERROR_INVALID_PARAMETER for a null
phkResult whether the subkey is missing, empty or null. Microsoft's
pages do not name the error for this case, so the test asks the host
for the same calls on a host key and holds ours to the same answers.

Test: nowhere_to_put_the_key_is_an_invalid_parameter, ours and the
host's, for a missing, an empty and a null subkey.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Hardware compares the full VCC register. Masking with EXEC flipped the
branch when only inactive lanes held VCC bits. Synthetic test under a
narrowed EXEC with an explicit VCC write.

Co-authored-by: Matsvey Makushenka <[email protected]>
Match the compute bytecode used by production prebuilds and include the child process exit status and stage in failures.
Wire XAccessibility vtable slots 0x18, 0x20, 0x28, 0x30, 0x38, 0x88, 0x90, 0x98, and 0xa0 in speech.rs against the public API reference:
- 0x18 (XClosedCaptionGetProperties) and 0x20 (XClosedCaptionSetEnabled)
- 0x28 (XHighContrastGetMode), reporting XHighContrastMode::Off (0)
- 0x30 (XSpeechToTextSetPositionHint), 0x38 (XSpeechToTextSendString), and 0x88..=0xa0 (XSpeechToTextBegin/Update/Finalize/CancelHypothesisString)

ClosedCaptionProperties matches the public XClosedCaptionProperties layout (28 bytes, 4-byte aligned). Slot 0x18 writes the current enabled state and default appearance and returns S_OK whether captions are enabled or disabled (and E_INVALIDARG if out is null).

Closes #865
A fmul feeding a fadd is the FMA the drivers may make of it, even though
the stores carry no fast-math flag to bless one - and the NVIDIA driver
does fold these, rounding once where the console rounds its product and
its sum apart (123 inputs off on the three intersection tests here;
nothing an emitter can mark makes a driver keep them apart - DXC itself
drops `precise` before it writes DXIL).

So each multiply now goes out as an FMad over a zero that carries the
product's own sign (sign(a) ^ sign(b)): a sum the driver fuses rounds its
exact product plus zero once, which is the plain product's rounding,
signed zero included - the same bits on a driver that fuses (NVIDIA,
AMD's FMad) and on one that does not (WARP), and no way for a driver to
see two adds where the console wrote one.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
crashed.txt now starts with the translator its pipelines crashed under
(# translator <source hash>). When the translator has changed, or the list
has no such line, the listed pipelines are not refused: each becomes a
suspect, made alone, and is listed again (under the new translator) if it
ends the run again.

Found in Grand Theft Auto VI on Linux: CS_Prop_BatchNoCull and
CS_LaserLightShadowRaytracing overflowed the stack while being made under a
morning build, and the journal skipped them in every run after, including
builds where they are made fine (checked with a cold pipeline library and
vkd3d cache). Their dispatches were dropped for hours for nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One worker serialises amdxc64 calls but the RDNA4 reporter's run still
died with the same fault — the wording promised more than the knob does.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The writer test now runs each shared binary opcode it has in both forms
(add, sub, mul, udiv, sdiv, urem against fadd, fsub, fmul, fdiv), with
the float operands typed by a constant, a call's result, a field, a
cast, a load, a select and a phi, and integer ops after the floats so a
value id off by one would name one wrongly. It checks that the kinds
add up to the instruction total (22 in 2 blocks).

The record test adds a scalar half, an integer vector and a scalar
integer srem, which stay integer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The descriptor and memory tests assert a host heap of every slot a
shader indexes (HEAP_VIEWS, HEAP_SAMPLERS) and a copy's views in the
pair range past the dynamic slots — both gone where the host caps its
shader-visible heaps (NVIDIA, HostHeap::new's shortcut): the heap is
smaller and the pair range is empty, so the pairs come from the
dynamic slots and both tests failed on a machine the runtime itself
runs fine on (#1744). The size and pair-range assertions say so and
skip there; WARP and every other machine keeps them.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
Co-authored-by: borosf <[email protected]>
open_file used FILE_SHARE_READ only, so a path already open for write
failed with ERROR_SHARING_VIOLATION. It also formatted the path before
reading last_os_error(), which can clobber GetLastError on failure.

Share FILE_SHARE_READ|WRITE|DELETE and capture the OS error before any
heap work. Test opens alongside a writer and checks HRESULT_FROM_WIN32
for a missing path.

Co-authored-by: Matsvey Makushenka <[email protected]>
The console supplies reverb impulse responses as partitioned frequency-domain complex pairs. Decode that layout into a portable partitioned convolver so convolution streams return wet audio instead of silence. FFT/IFFT streams still return silence. Add seven unit tests for the convolver and an end-to-end test through XDspActivate and XDspSubmitCommand.
The descriptor and memory tests assert a host heap of every slot a
shader indexes (HEAP_VIEWS, HEAP_SAMPLERS) and a copy's views in the
pair range past the dynamic slots — both gone where the host caps its
shader-visible heaps (NVIDIA, HostHeap::new's shortcut): the heap is
smaller and the pair range is empty, so the pairs come from the
dynamic slots and both tests failed on a machine the runtime itself
runs fine on (#1744). The size and pair-range assertions say so and
skip there; WARP and every other machine keeps them.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
The reverb convolver's build carried five clippy warnings the check
turns into errors (clippy -D warnings): the reset and encode-IR helpers
have their only callers in the tests and are cfg(test) now, the block's
input and spectrum loops read through iterators, the IR slice's SAFETY
note sits next to its unsafe block, and a closure dropped a doubled cast
and its extra parentheses. The convolution itself is untouched: the
seven convolver tests and the two API end-to-end ones pass on Windows.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
Every range the benchmark declared was either marked (copied back by page)
or stayed out of title memory (root UAVs in lists that read memory with no
copy), so the byte merge of a declared range's copy-back never ran (the
#2134 review). Now one list a submission declares a two-page copy unmarked
and the shaders' part changes 8 bytes of one of its pieces, without marking
it: 33 pieces merged and written back a frame, a made-up volume. In its
place that list makes one refresh fewer, so the refresh count stays as it
was. The output prints the pieces changed, merged and the bytes written
back, the bytes compared, and a unit cost of one such copy-back.

A note at the top of the file and a line in the output say how to compare
builds: code layout alone moved `copying back` by about half in the
review, so check with the counters that the changed code runs and compare
several builds per side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With a stray `v18446744073709551615` folder next to a committed `v1`, the
next number `highest + 1` overflowed: a debug build panicked, and a release
build wrapped to 0, committed `v0` (not canonical, so never read), returned
S_OK and removed `v1`, losing the save. The number now comes from
`checked_add`; with none, the update returns NO_ACCESS, as for a container
with no readable version, before anything is written or removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The IR's renaming looked up every live register in its predecessor's
sorted live-out list by binary search, and again for every phi argument.
Both sides are in register order, so one walk along the list serves them
all; the live-out lists are also sized before they are filled.

New ir_build benchmark (synthetic, no title files or GPU), median:
  128 registers, 500 divergent ifs:   10.5 ms -> 7.6 ms
  128 registers, 2000 divergent ifs:  47.2 ms -> 36.0 ms

The built IR hashes the same as on main for the benchmark's programs.
Tested on Ubuntu only (cargo test -p victory-shader --lib: 144 passed).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A run hung at 0 % CPU with 9 suspects listed: pipeline creation holds the
gate until it returns, and a pipeline made inside another's creation (a
helper) took it again on the same thread. Held alone by a suspect, that
waits on itself; held shared while a suspect waits to hold it alone, the
second shared take waits behind the suspect (SRW locks give a waiting
writer priority). A thread now takes the gate once; nested creations are
still noted, so a crash inside one is still named.

Found in Grand Theft Auto VI on Linux: pipeline creation stopped at 1,721
pipelines being made, 0 % CPU, for minutes, with suspects.txt holding 9
pipelines from runs stopped mid-creation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Prebuild::prepare_graphics now rejects graphics pack records carrying both VS and GS stages instead of silently dropping GS via vs.or(gs) and writing a bogus VS+PS pipeline into the library.

Also keep all non-empty stages (including GS and ES/HS/LS/fetch) in shaders_of diagnostic output while preserving the existing VS+PS and MS+PS formatting, and add unit tests covering VS+PS, MS+PS, and VS+GS handling.
Removes the two indexed-buffer refusals in `emit::lower::Lower::buffer`
("a typed-format load by index" and "a byte or half buffer store by index"):

- `tbuffer_load_format_*` with `idxen` now handles:
  - Root views (`Source::Built` with `bits >> 30 == 0` and `words[0] == u32::MAX`):
    folds `index * stride` into the byte offset (since MTBUF carries its own format
    over raw/structured descriptors rather than requiring a typed buffer view).
  - Bindless heap descriptors (`ResourceDescriptorHeap`, `used.is_none()`):
    folds `index * view_stride(src)` into the byte offset via `VIEW_STRIDES`.
  - Declared `StructuredBuffer` SRVs and `RWStructuredBuffer` UAVs
    (`used.stride >= 4 && used.stride % 4 == 0`):
    routes `format_load` through `dx.op.rawBufferLoad.f32(handle, index, elementOffset, ...)`
    on `(12 | u, stride)`, supporting sub-dword (`total < 32`) aligned-dword extraction
    as well as 32/64/96/128-bit formats and `idxen + offen + offset + soffset`.
  - Tightens the raw-view byte count passed to `raw_view` to `total.div_ceil(32) * 4`
    (matching the exact dword count loaded by `format_load`).
- `buffer_store_byte` and `buffer_store_short` with `idxen` now route declared
  `RWStructuredBuffer` UAVs (`stride >= 4 && stride % 4 == 0`) through structured
  `dx.op.atomicBinOp.i32(handle, And/Or, index, at, undef, keep/val)` on
  `(12 | 0x1000, stride)`, preserving neighboring bytes/halves and `EXEC` guards.
- Unknown/non-dword-aligned strides and record-limited root views remain refused.
- Adds `View::StructuredUav` (test-only) in `emit::host` and 5 synthetic GPU/WARP/DXIL
  tests in `emit::stride_tests`.

Clean-room implementation from public RDNA2 ISA and DXIL specifications; no game
binaries, dumps, or copyrighted assets were used.
AI-assisted with Gemini 4 Neon (Extra High Mode).
The GPU probe suites failed instead of skipping on hosts without what
they need: a device below SM 6.6 (this Windows 10 machine reports 6.5 for
the RX 7800 XT and 6.2 for WARP), a device whose wave lanes cannot hold
32 (old WARP, Intel Xe-LP as in #1829), and the semantics suite asserted
a device exists at all. Every other suite in the crate already prints
"skipped" and returns.

Add Host::wave32 from D3D12_FEATURE_DATA_D3D12_OPTIONS1, skip the
permute test on a device that cannot run a wave of 32 while still failing
a device that claims it and refuses the pipeline, and turn the
"no device ran these cases" asserts into skips.

On the RX 7800 XT/Windows 10 host this makes
cargo test -p victory-shader --lib 247 passed, 0 failed (75 failed
before); CI keeps its SM 6.6 device, where the suites still run.
The zero-device path turned every "no device ran" assert into a silent
pass, which would also hide a runner image that loses SM 6.6. Route all of
them through `host::no_device`, which panics when `CI` is set and skips
with the `Host::new` errors otherwise; `semantics_tests` now keeps those
errors instead of discarding them with `.ok()`. Name the gather's skip for
what it is (it said "permute", copied from the permute test).
Only the test modules call it; a lib build saw dead code under -D warnings.
A suspect (a pipeline being created when an earlier run ended) is
created alone so that a crash in it is pinned on it. But other pipelines
then wait as long as it takes: minutes for a large compute shader on a
cold driver cache, or for ever if its creation waits on another thread
that itself needs the gate. The title waits for the pipelines queued
behind it, so the title screen ran at 500 ms per frame.

The gate is now a mutex and condition variable instead of an RwLock: a
suspect holds it alone (or waits to) for at most 5 s, then the others go
ahead. If the run ends after that, the suspect is one of several being
created and stays a suspect instead of being refused.

Found in Grand Theft Auto VI on Linux: the title screen at 500 ms per
frame with 1,714 pipelines being made and none finishing, the journal's
only note a suspect (compute-3360) pending since launch at 0 % CPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A loose copy of title memory for a null address covers 0..4 MiB, and
`runtime_pages` takes free memory for the runtime's (its `shortcut:`),
so free parts of the window are tracked and guarded once something is
committed there. On Windows nothing is. Under Wine the process heap is:
its pages became read-only, and a heap write by a thread holding the
guard lock (in `Tracked::take`, `writing` or the fault handler itself)
faulted into the handler, which waited for that lock forever: the title
stopped at the end of loading.

The region check now leaves free memory out, as it leaves out plain
committed memory and images; reserved memory still counts (the
shortcut keeps that part).

Test: a block reserved and released (free memory at a known address)
is not tracked. It fails without the change; it only counts if the
block is still free afterwards, since other tests allocate meanwhile.
f4f3364 restarted the window at every return while a suspect waited, so
a suspect waiting behind a busy queue held every pipeline up again and
again: in the title, 7 pipeline threads slept while 2,200 pipelines
waited, and the queue drained at about 80 a minute. Only the suspect's own
return now starts the next suspect's window.

The new test holds six pipelines, lets a suspect wait, and returns them
one by one: a new pipeline waited 601 ms before this change, under the
300 ms window plus scheduling after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What was wrong: XAsyncGetResultSize wrote the size only for a call that
succeeded. While a call was pending or after it failed, the caller's
variable was left as it was, and after the result was taken it still
read the old size. The public reference (libHttpClient's AsyncLib.cpp)
writes the size whatever the status: that of the result the call still
holds, 0 without one. A title that sizes a buffer from it before looking
at the status read whatever was on its stack, and every one of our
offline answers fails (network security information, user tokens), so
that is the path such a size query takes here.

What changed: XAsyncGetResultSize always writes the size: the result's
while the call holds one (it is filed until its result is taken), else
0. The status it returns is unchanged.

Evidence: `result_size_is_zero_without_a_result_to_take` fails on main
(a pending call leaves the caller's 0xdeadbeef in place) and checks the
pending, held, taken and failed cases. `cargo test -p victory-hle`
passes; clippy (with and without --all-features) is clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-authored-by: borosf <[email protected]>
image_words read descriptor[4] for both shader and unordered texture views, matching D3D12_SHADER_RESOURCE_VIEW_DESC (where Shader4ComponentMapping and 4-byte union alignment padding precede MostDetailedMip at dword 4), whereas D3D12_UNORDERED_ACCESS_VIEW_DESC places MipSlice directly at dword 2 (offset 8) for all 1D/2D/3D/array texture UAV variants. For Texture2DArray/Texture3D UAVs, dword 4 was ArraySize/WSize, corrupting first/last mip bounds. Read d[2] for unordered views, verify the D3D12 descriptor field offsets via compile-time offset_of! assertions, and test Texture2D, Texture2DArray, and Texture3D UAV word arrays with distinct d[2] and d[4] values.
Speed up XMA2 frame decoding without changing decoded bits:
- Bits::peek32 reads a single unaligned u64::from_be_bytes word on the hot
  path (>= 8 bytes left) with a 5-byte tail fallback.
- Vlc::new builds a 10-bit primary lookup table (Box<[(i32, u8); 1024]>)
  covering >99% of Huffman symbols in O(1), falling back to a prefix-bounded
  binary search for codes longer than 10 bits.
- quant_factor caches 10^(exp / 16) in a bit-exact OnceLock<[f32; 384]> LUT
  for exp in -128..256 (matching 10.0_f32.powf(exp as f32 / 16.0) to_bits).

Measured (--release vlc_and_quant_throughput):
- vlc coef0: 28.09 -> 6.30 ns/sym (4.46x)
- vlc coef1: 23.47 -> 5.86 ns/sym (4.00x)
- vlc vec4:  23.76 -> 5.58 ns/sym (4.26x)
- quant:     10.69 -> 1.18 ns/op  (9.05x)

Assisted-by: T3 Code (Antigravity, gemini-4-neon)
Round the sampled dimensions up because the PNG encoder keeps every other pixel starting at zero. The same pitched 3x5 fixture now reads as 2x3 with all six RGB samples.
# Conflicts:
#	crates/victory-gpu/src/descriptor/host.rs
Resolve the default buffer alignment on output. The same guest resource query reports zero on main and matches native D3D12 WARP at 65536 bytes after the change.
resource::make_texture makes a texture with its castable formats through
CreateCommittedResource3, which needs ID3D12Device10 (D3D12 1.7). On a
Windows 10 system runtime the interface is missing (E_NOINTERFACE), the
castable list is cleared silently, and every view in another format gets
its own host texture and a copy at the read. Say so once in the log:
without it a tester cannot tell why a window shows two textures per
memory (and why the placed-view test fails).

Host::device10() exposes the check, and the placed-view sharing test
skips with the reason when it is false, like the other capability skips:
what it checks cannot hold without the castable list.

Closes #1999.
The test's expectation is host-derived in #2251 (which covers the
memory paired-copy and heap-cap tests as well); this branch keeps only the
log for the missing D3D12 1.7 and `Host::device10`.
The log check and the castable-format creation each cast the device. Ask
once per texture and use the answer for both, which also drops the
`Host::device10` helper.
A debugging knob for issues like #917: VICTORY_PATCH=<module>:<rva>:<hex
bytes>,... writes bytes into a loaded module after the Windows loader has
mapped and relocated it, before TLS redirection and import binding. Each
write is logged with the bytes it replaced, so a run is reproducible from
its own log. Entries follow the other knobs' comma and hex conventions,
match the module file name case-insensitively, and malformed or
out-of-image entries are skipped with a warning.
What was wrong: a task submitted to a port reached only the monitors of
the queue it was submitted through. A composite queue made of another
queue's ports therefore never woke that queue's monitor. The GDK
documents both halves of the common setup: a monitor that wakes a manual
queue's dispatcher (XTaskQueueRegisterMonitor's example) and a library
that shares a queue through a composite queue made of its ports
(XTaskQueueCreateComposite's example). Together, on main, the library's
callbacks wait in the port while the dispatcher sleeps. In the public
reference (libHttpClient's TaskQueue.cpp, NotifyItemQueued), every port
context attached to a port hears of each item queued to it, so each
queue using the port calls its monitors, with its own handle and the
port it uses. The reference also calls them before an immediate port
runs the item; we called them after it had run.

What changed: a port keeps the queues using it (weakly, each with the
port it is to that queue; a composite queue may use one port as both of
its ports). Delivering a task calls the monitors of each of them, outside
any lock, and an immediate port runs the task after its monitors have
heard of it.

Evidence: `monitors_hear_of_tasks_submitted_through_a_composite_queue`
fails on main (the owner's monitor hears nothing) and
`monitors_hear_of_an_immediate_task_before_it_runs` fails on main (the
monitor hears of the task after it ran). `cargo test -p victory-hle`
passes; clippy (with and without --all-features) is clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When an archive stores a shader pack across zlib streams and the
final inflated stream decompresses beyond the pack's declared total
size (e.g. contains trailing bytes or padding from adjacent archive
records), pack.len() >= total evaluates to true, but the previous
equality check (pack.len() == total).then_some(...) evaluated to None.
Consequently, valid shader packs with trailing stream data were
discarded.

Truncate pack to total so valid shader packs inflate cleanly and are
returned as Some(Cow::Owned(pack)). Adds a synthetic regression test.
A scratch access with no VGPR and no SGPR address holds 0x7F, EXEC_HI's
code, in the SGPR field (LLVM writes it for exactly that case and prints
`off, off`). The decoder took it for an operand: the text named exec_hi
and the IR read it.

Test: `scratch_without_an_address_names_no_register`, encodings from
LLVM's flat-scratch-st-mode.s.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Avoid unconditionally building two full-program SipHash HashMaps (defs and
phis) in io::raise when Halves is only used for pixel-shader v_interp_p2_*
instructions. Build a single compact Vec<Def> lazily on the first
v_interp_p2_* instruction instead, and move inputs directly into Io without
cloning.

Measured on 13f91ca (--release io::tests::bench_io_raise, median of 3x200
runs, 4,000 instructions, identical Io output):
- CS (no v_interp_p2_*):          180.0 ->  7.9 us/run (22.8x, -95.6%)
- PS (16 v_interp_p1/p2 pairs):   195.2 -> 44.6 us/run ( 4.4x, -77.2%)

Assisted-by: T3 Code (Antigravity, gemini-4-neon)
AI-assisted (OpenAI Codex).
A geometry shader on gfx9+ always runs merged — the second half of ES+GS —
with eight system SGPRs before its user data (AMD's RDNA 2 ISA "Geometry
Shader (ES+GS)" initial-SGPR table; LLVM's SIMachineFunctionInfo::
getGITPtrLoReg: the first user-data SGPR "is passed in s8 rather than s0
for an LS+HS or ES+GS merged shader on gfx9+"). HwStage::user_sgpr already
returns index + 8 for HwStage::Gs; these tests pin that placement, which
previously had no geometry-stage coverage:

- a merged GS's table load resolves to its root parameter;
- a standalone-shaped program is refused with the root-parameter error
  rather than read through the s0-s1 GS user-data *address*;
- a root descriptor in user data resolves through the merged layout;
- a read of a system SGPR stays a system value and is not attributed to
  user data.

No production code changes.

AI-assisted: Kimi.
main rewrote texture refresh (per-subresource hashes of tracked textures,
shared staging, zeros for uncommitted memory). The change is re-applied
on top of it: the content digest replaces BLAKE3 at all three hashing
sites (the untracked whole-texture digest, the zero fill's, and the
tracked per-subresource digests), and the untracked path's commit check
is kept per remap epoch for ranges of mapped views.

Co-authored-by: BlueKaiman <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Validator 1.6 orders the rows of one register by semantic name offset
(DXC's `sort_sig`: stream, register, name). `signature` kept element
order, which is the same order except where a system value repeats: its
later elements share the first one's name, so they sort before an
arbitrary semantic declared between them. With SV_ClipDistance1 packed
into a row after a TEXCOORD, the validator refused the container
("Container part 'Program Output Signature' does not match expected for
module").

The key is the one #1022 proposed.

Test: `packed_signature_rows_follow_system_value_name_order`, both
declaration orders through dxil.dll.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
`s_dcache_discard` and `s_dcache_discard_x2` have no data operand but
do have an address; the text printed neither, because the address was
only written beside data. Export target 16 is `pos4` on GFX10 and was
printed as `<target 16>`.

Test: `discards_name_their_address_and_position_four_its_target`,
encodings from LLVM's gfx10_asm_smem.s and exp-gfx10.s.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A benchmark (ignored by default) and a check, in HLSL that does what
translated programs do when they store to title memory: look the address
up in the page table (an upload heap), set the bits of the pages written
in the list's bitmap with atomics, store into the host copy. Variants:
main's two unconditional atomics per store; a load first and an atomic
only for a clear bit (#2167's approach); one atomic per wave for lanes
sharing a bitmap word (#2755's); both; none. Each with the bitmap in
system memory, as now, and in video memory; four ways of writing.

RTX 5070 Ti, driver 621.24, ms per dispatch of 131,072 threads storing
16 dwords each (bitmap clear before the dispatch / already set):

                            one page      linear  page/lane  scattered
  main, system bitmap      79.8/76.5   75.8/75.0  1595/1583  336/337
  test-first, system         1.6/0.33   11.5/0.35    21/20    13.0/6.7
  wave, system               1.7/0.33   11.4/0.36    22/22    13.5/6.8
  main, video bitmap        0.31/0.31   0.32/0.32    20/20     6.4/6.5
  test-first, video         0.30/0.30   0.32/0.32    20/21     6.8/6.7
  no marks                  0.30/0.29   0.32/0.32    20/19     6.5/6.5

Atomics on a bitmap in system memory are what cost: up to 250 times the
dispatch without marks. Loading first removes them once a page is marked;
one atomic per wave adds nothing on this GPU. A bitmap in video memory
costs nothing even with main's unconditional atomics, first marks
included. What is left in "page per lane" and "scattered" is the stores
into the host copy in system memory.

`every_variant_marks_the_pages_main_marks` checks every variant, in both
places, sets exactly main's bits. `dxc.exe` comes from the Windows SDK;
without it or a GPU both tests do nothing.

    cargo test -p victory-gpu --release --lib marks_bench -- --ignored --nocapture
Two 256.5 KiB copies, the bitmap into read-back memory and zeros over
it, as the video-memory bitmaps of #2175 and #2465 record at a list's
end or after a submission: 12.2 µs on an RTX 5070 Ti (median of 20).
The translator does a console f16 operation in f32 and rounds each result
with an integer sequence (`narrow16`), widening the sources with
`f16tof32`; a packed instruction does it for both halves. A benchmark
(ignored by default) runs a chain of packed FMAs that way, with the host's
`f32tof16` instead of the sequence, and with native `half2` math.

RTX 5070 Ti, driver 621.24, 262,144 threads x 1,024 packed FMAs:

  narrow16    1.457 ms     369 G f16 FMAs/s
  f32tof16    0.117 ms   4,608 G f16 FMAs/s   12.5x
  half2       0.042 ms  12,643 G f16 FMAs/s   34.3x

`narrow16_rounds_fused_results_to_nearest_even` checks the narrow16
shader against a CPU reference: normal, denormal and tie cases, overflow,
underflow and NaN. It fails with either rounding path made to truncate.

The bench helpers of marks_bench (dxc, buffers, a timed queue) are shared.
The comparison bit was OR-ed into a filter that already holds the
reduction in bits 7-8, which turned a minimum sampler (0x100) into a
maximum one (0x180). StaticSampler::make_comparison replaces the
reduction; comparison_replaces_the_reduction covers standard, minimum and
maximum reductions. immediate_sampler_slots_distinguish_comparison_uses
builds its expectation with it too.

Split out of #1483.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The one ID3D12Device10 query per texture now keeps its Result, so the
info log can name the HRESULT without asking a second time. Requested by
@AlanQiang0418 on #2005.
What was wrong: the `neg` source modifier was lowered as `-0.0 - x`.
IEEE 754 leaves the sign of a NaN out of a subtraction to the host, and
WARP keeps it: a negated NaN reached the instruction with the sign it
had. The console's modifier flips bit 31 alone, NaN or not. The floor
conversions show it, as they saturate a NaN by its sign:
`v_cvt_rpi_i32_f32 -v1` and `v_cvt_flr_i32_f32 -v1` of 0x7fc00000 gave
0x7fffffff on WARP, 0x80000000 on an RX 7900 XTX (RDNA3) and the model.
Found by the VALU fuzzer of #1614 with VICTORY_FUZZ_MODS=1 (20 and 9 of
200 inputs differed, all NaNs).

`neg` is now an integer XOR of the sign bit (`fneg`), the same on every
host, for f32 sources, v_fma_mix sources, f16 sources read as f32 and
packed f16 sources. The 16-bit and select paths already flipped the bit.

New test: source_modifiers_set_the_sign_of_a_nan checks both floor
conversions with abs, neg and -|x| against the model on the hardware
adapter and WARP; without the fix it fails on WARP only.

Checked on Windows 11, RX 7900 XTX (driver 32.0.32029.2010) and WARP:
cargo test --workspace --locked passes (780), both CI clippy runs are
clean, and the fuzzer with modifiers on the four float-to-integer
conversions shows 0 of 400 inputs differing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Assisted-by: OpenAI Codex
Assisted-by: OpenAI Codex
AI-authored and verified by Gemini 4 Neon (High Mode) — zero game data used.

Fixes VIC-BT-004 (P0) and VIC-BT-012 (P1) from #1242:
- `crates/victory-gpu/src/descriptor/host.rs`: when a typed console texture was
  promoted to a typeless host copy (`host_texture` for sRGB+UAV or
  shader-readable depth targets), `fits()` previously rejected NULL-desc and
  `DXGI_FORMAT_UNKNOWN` SRV/UAVs, replacing them with null views. Now resolves
  the promoted view format (shader-readable depth plane 0 format for depth SRVs,
  linear twin for sRGB UAVs, title format for sRGB SRVs) and synthesizes a
  dimension-matched default SRV/UAV description when `desc` is `None`.
- `crates/victory-gpu/src/descriptor.rs`: `RtvRecord::desc()` and
  `RtvRecord::depth_desc()` previously hardcoded `TEXTURE_2D` for NULL-desc
  RTV/DSVs on promoted-typeless targets; now inspect the host texture's
  `Dimension`, `DepthOrArraySize`, and `SampleDesc.Count` to emit the exact
  `1D`, `1DArray`, `2D`, `2DArray`, `2DMS`, `2DMSArray`, or `3D` view desc.
- Adds unit tests plus a real D3D12 hardware test verifying NULL/UNKNOWN views
  on promoted sRGB+UAV and 2D-array depth textures on the host GPU.
Microsoft's GameInput documentation for IGameInputReading::GetKeyState
states: "New keys are added at the end of the array, and when a key is
released, everything shifts down to fill in the gap." Previously,
host::Host::keys rebuilt the held-key list on every poll in ascending
virtual-key order, so holding Z and then pressing A reported [A, Z]
instead of [Z, A].

Remember the previous poll's held virtual keys on host::Host and order
each poll's result with a pure press_order helper that keeps still-held
keys in their prior order and appends newly pressed keys at the end.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/victory-shader/src/emit/host.rs
A multisample depth texture got a twin created with its sample count
and only ALLOW_UNORDERED_ACCESS, which D3D12 rejects (a multisample
resource needs the render target or depth stencil flag) and the debug
layer reports as an error. Such a texture now gets no twin: make()
logs it once and returns before creating anything.

A 16- or 32-bit depth texture that denies shader reads stays in its
typed format on the host (D16_UNORM, D32_FLOAT), so its copyable
footprint format no longer equalled the twin plane's typeless one
(R16_TYPELESS, R32_TYPELESS) and the twin was refused as needing a
conversion. The bytes are the same, so the footprint now names the
typeless format and the plane is copied straight through. Formats with
stencil keep their per-plane footprints and are unaffected.
Title textures of one memory share a host texture when it has their
uses and a view format of their family. A depth texture made with
D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE keeps the flag and its typed
depth format (D32_FLOAT, D16_UNORM) on the host, and the uses checked
leave the flag out: a later texture or placed view of the same memory
that shaders read took that host texture, the host refused its shader
view, and the read saw zeros. Both shared one host texture, so no
alias copy ran either.

A host texture made without shader access (denied, or typed depth)
now only serves descriptions that deny shader access too. A readable
one gets a new host texture, which becomes the memory's; a placed view
reads what the GPU wrote through the old one by the existing alias
copy.

A test clears a D32_FLOAT depth texture that denies shader access and
reads the depth back through a placed view of its memory. The tests
that make alias copies now run one at a time, as one counts them.
copystat.rs: both sides added to the enum and the per-frame line, so the
two are kept side by side (COUNTERS 57 -> 64), main's heap slot and
view-wait times stay before the compare, and the scatter counts stay at
the end next to their arguments. xmem.rs merged cleanly.
A pixel program's DPP8 was always a cross-lane operation outside
compute, so a shader using one was refused, even where every lane picks
a lane of its own quad (the case quad reads can serve, helper lanes
included). Such a DPP8 now takes the quad path, as quad_perm already
does; DPP8 that reads across quads stays refused.

Quad reads (pixel and mesh programs) read each of the four lanes and
selected among them. A pattern every quad uses alike now takes one
operation: the identity none, a broadcast of one lane one
QuadReadLaneAt, and an exchange across x, across y or the diagonal one
QuadOp.

New tests (emit/quad_tests.rs): every quad permutation through
ds_swizzle_b32 and DPP, and an in-quad DPP8, translate and pass the DXIL
validator, and a cross-quad DPP8 is refused; two triangles sharing a
diagonal, drawn on the hardware adapter and WARP, read helper lanes'
coordinates through broadcasts and exchanges as the console's whole-quad
mode does.

Ported from DexNom/VIctory@921d8d3b43
(recorded there under the author name "Codex"), whose quad-pattern
lowering this is; the tests are reworked from that commit's for this
tree's harness, the exchange case added.

Co-authored-by: DexNom <[email protected]>
`describe` still queried `texture::committed` (`VirtualQuery`) and formed a
raw slice over live title memory for `<= 64`-byte buffer SRV and UAV ranges,
walking pool regions on every noted draw and dispatch while exposing a TOCTOU
window against concurrent unmapping or page protection changes. Read `4..=64`
byte spans into a 64-byte stack buffer with `host::read_into`, matching the
constant-view path.

Closes #913.
Loose windows were keyed to their exact (start, length): a memory range a wider window already spanned made its own host buffer and its own copy anyway, although one measured run saw most asks covered by a wider neighbour (36,611 reuses, 153 GB not copied). A miss now takes the first window that covers it - the shared segment these buffers fill is the one that dies (measured: its budget hit 103-104% while the card's own stayed at 50%, and the run ended in a Close() failure the old message mislabeled as an invalid command). A reuse is counted and printed with the periodic lines; a hardware-gated test pins the covering reuse and the ask past the window.
The loose windows are the shared segment's own content and are never freed; a run could not see how many there were or what they weighed. Their count and bytes join the reuse count in the periodic lines, so the next lever (freeing or merging them) starts from a measured size.
`victory inspect` printed section characteristics only in hex. It now
follows them with the section's access as rwx and its other named
flags (code, initialized-data, uninitialized-data, discardable,
not-cached, not-paged, shared); bits without a name, such as the
alignment field object files use, are shown in hex rather than dropped.

The constants go in victory-pe's layout::section_flags, next to the
DLL characteristics.
When VirtualAlloc2 refused an XMemVirtualAlloc, the refusal was logged
before returning: a refused commit through commit_refused, which appends
a crash record (CreateFileW with OPEN_ALWAYS on an existing crashes.log
sets ERROR_ALREADY_EXISTS), anything else through tracing, whose writer
can do the same. The title then read the logger's last error, not the
host's reason (ERROR_COMMITMENT_LIMIT, ERROR_INVALID_ADDRESS, ...). The
code is now taken right after the allocation and put back before
returning.

Test: with a subscriber whose events set ERROR_ALREADY_EXISTS, a
reservation over an existing one returns null with ERROR_INVALID_ADDRESS
(183 before the change).

From DexNom/VIctory@570a941e9b, which
saves and restores the error the same way.

Co-authored-by: DexNom <[email protected]>
# Conflicts:
#	crates/victory-gpu/src/descriptor/host.rs
# Conflicts:
#	crates/victory-gpu/src/host.rs
Scan PE inputs once, index direct exports (rva.is_some()) of title DLLs
by directory and lowercase name, and classify imports served by a
same-directory title DLL as title instead of missing while keeping host-
and HLE-served DLLs out of title resolution.

Closes #838
Compute source and destination subresource mip dimensions for full and
region MSAA resolves, and cover selected-mip region selection and pixel
readback across array slices and expanded mip chains.
`victory translate` prints how many of the translated programs'
instructions work on 16-bit floats and how many of those are packed, so
the game's share of f16 math can be read in one run (#2384, #2825). The
count is of instructions in the code, not as run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Carry the rectangle regression from Marvisak/VIctory#2264. Test both a NaN input and an infinity subtraction in the rectangle fallback while retaining the converter fix from Marvisak/VIctory#1732.
The non-local segment - half the system's RAM - is the ceiling every long run dies at, and the loose windows are its bulk (measured: 878 of them, 3,926 MB, never freed, against a 7,465 MB budget; the card's own memory sat half empty). VICTORY_LOOSE_IN_GPU_UPLOAD puts each new loose window in a GPU upload heap (write-combined, CPU-mapped) where the host has one, falling back to the system-memory buffer a card without the heap keeps. The CPU reads of such a window (snapshots, copy-backs) are uncached bus traffic: they are counted and warned of once, and the periodic line carries the count.
The poke wrote the byte with a raw volatile store, so listing an rva in
the title's read-execute .text (e.g. nopping an assert's int3) raised an
access violation in the host itself before the title ran. The write now
goes through a loader helper that makes the page writable for the write,
restores its protection, and flushes the instruction cache on executable
pages.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
`range::build` built the program with every relative move at its full
range, and its structure, before trying to prove bounds, though it uses
them only where no bound is proven (and to give up at once where that
structure fails). For any program with a `v_movrel*` or `v_swaprel`, that
made `range::build` nearly three times the work of the same program
without one, since the bounded rounds build the program and its structure
again (synthetic 256-block program: 20.7 ms against 7.2 ms).

The moves are now found in the decoded instructions, and the program at
full range is built only after the rounds prove nothing. The code is
decoded once: `ir::build_decoded` takes the decoded list, so a program
without relative moves decodes and builds once as before, and each round
saves a decode. On the first round only the moves the program reaches
are kept, as when they were taken from the built program.

One case changes: a program whose full-range structure fails but whose
bounded form proves every bound now translates instead of being refused
(the bounds hold by the same induction; only the fallback was refused).

Measured with synthetic wave32 compute programs, release build, three
rounds each: range::build with a relative move 20.7-22.9 ms -> 14.8-15.7
ms (256 blocks), 3.5-4.4 -> 2.3-2.8 ms (64 blocks); without one,
unchanged (same allocations, times within noise). The DXIL is
byte-identical for every program (FNV hash of the output).
XUserGetGamertag documents E_INVALIDARG for an invalid gamertagComponent
(XUserGamertagComponent: Classic 0, Modern 1, ModernSuffix 2,
UniqueModern 3). Any value other than the modern suffix was answered with
the gamertag; values past 3 are now refused, and 0-3 answer as before
(the offline gamertag fits every documented size).

The new test asks for components 4, 5 and u32::MAX through both slots
that serve the call.
`emit::host::Host::fuses_fmad` (run once as the host is made, to tell
whether the GPU fuses `mad`) records its dispatch with the root signature
a translated program gets, which indexes the sampler heap directly, but
bound only a view heap. D3D12 requires a sampler heap bound before such
a root signature is set; the debug layer reports it on every start (id
1419, "SetDescriptorHeaps must be called to bind a sampler descriptor
before setting a root signature with
D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED"), the first
error of the run, which the debug layer's report of a later failure can
lead with. The other probes in the file bind one already.

It now binds a one-slot sampler heap with its view heap.

Tests can now run under the debug layer: `host::rerun_with_debug_layer`
runs a test again in a child process with `VICTORY_D3D12_DEBUG=1`
(diagnostics builds; the host is made once per process), and the errors
`Host::log_messages` reads are kept for the test.
`host::tests::making_the_host_leaves_no_debug_layer_errors` makes the
host there and finds no errors; without the fix it fails with the one
above.
`XMemAllocDefault` asked the host allocator for `size + align` bytes at
alignment `align`, to fit its header below an aligned pointer. Above 16
bytes of alignment, Rust's Windows `System` allocator pads an over-aligned
layout by the alignment itself (`HeapAlloc` of size + align), so the
block cost `size + 2 * align`: 192 KiB for a 64 KiB-aligned one, 12 KiB
for a 4 KiB block at 4 KiB.

The block is now asked for at the heap's own 16-byte alignment, `size +
align` bytes, and the pointer is the first aligned address past the
header (at most `align` bytes in). The header keeps the block's size and
the pointer's offset in it, which `XMemFreeDefault` uses. Alignments of
16 and below are unchanged.

The new test checks, through `HeapSize`, that the block under an aligned
pointer is the process heap's own block of `size + align` bytes.
Review (#2022): the test checked the pointer's alignment before reading
the header below it, and a null pointer passes an alignment check, so a
failed allocation would reach the unsafe read instead of failing cleanly.
It now asserts the block is allocated first, and writes and reads back
the payload's first and last bytes before freeing, so the aligned
address is shown to leave the whole requested span usable.
Review (#2041): `making_the_host_leaves_no_debug_layer_errors` passed
without having read the debug layer's messages when the child process
had no device or no layer, so a green result did not show the check had
run.

The child now prints its outcome: `checked` once it has read the
layer's messages, or `skipped:` and why. The parent prints a skip as
one, fails when the child says neither, and fails a skip when
`VICTORY_REQUIRE_DEBUG_LAYER=1` asks for the check to run (for a
deliberate debug-layer verification). Checked on an RTX 5070 Ti with
the layer installed (checked), and with the layer test forced off
(skipped, and failed with the switch set).
`gfx10::decode` follows the control flow from offset 0 and kept every
instruction it found in a `BTreeMap` by offset: a lookup per instruction
to stop at one already found, an insertion per instruction, a range
lookup per instruction for the far-jump check, and a walk of the tree to
put them in order. On synthetic programs that was a large part of
decoding, and decoding about 8% of a translation (sampled).

While every offset it reaches is a dword's, it now records the index of
the instruction starting at each dword in a table, keeps the
instructions in a vector, and sorts them by offset once at the end. The
far-jump check only needs the instruction that ends exactly where the
`s_setpc_b64` starts; the nearest one found below it, within the longest
instruction's reach (5 dwords), is the tree's answer wherever that can
end there. An offset that is no dword's (only a far jump's literal can
give one) leaves the whole decode to the tree, as before, so every result
and error is the same.

Measured on an RTX 5070 Ti host (release, best of 30): 32,001
instructions (compares, saveexec, branches, VOP3, buffer stores, scalar
loads) decode in 2.4 ms instead of 6.1 ms.

The new test decodes branches both ways, a loop, data after the end, far
jumps both ways and bad code with both, and checks that a far jump to an
unaligned offset falls back to the tree.
Bytes past the code (data, padding) no longer cost a table entry each:
a short program followed by 32 KiB of padding filled 8,192 entries
up front (about 0.2 us).
Grown entry by entry, a short program's table was reallocated several
times: up to 4,096 entries (16 KiB) are reserved, still none filled, so
padding past the code costs nothing. A 25-instruction program decodes
in 1.32 us here, from 1.45.
Issue #2586 measured about 20 us a list call on a fork, with nothing on
main to compare against. This records command lists the way a title's
render threads do, from several threads at once, through the device and
list method slots the title calls, and times each call: per draw a
constant buffer view written into the shader-visible heap and bound as a
table, root constants, a root view and an indexed draw; texture views
copied into the heap, barriers, a compute pass, then the list is closed
and the main thread submits every list. Draws and dispatches run real
host pipelines made from hand-assembled GFX10 shaders that read
descriptor tables (the conformance title's, branch
tests/gpu-frame-workload), so binding does what it does for a title; the
test fails if a draw does not run on the host.

Defaults are near the issue's shape: 5 threads x ~8,300 calls a frame.
It reports ns a call per method and each thread's time in calls.

RTX 5070 Ti, release: 1,119 ns a call on average, 9.3 ms a thread a
frame; DrawIndexedInstanced 4.5 us (78 %), CreateConstantBufferView
1.0 us (17 %); diagnostics builds 1,390 ns a call.

cargo test --release -p victory-gpu --lib list_calls -- --ignored --nocapture
The title's exit, abort, terminate and TerminateProcess of itself go
through exports of ours that log the call and its caller; ExitProcess
was bound to the host's kernel32 one, so a title ending the process that
way left no line saying so. It now has an export that logs the code and
the caller, then calls the host's ExitProcess with the title's code
(not the CRT's exit, whose exit table would run on the calling thread
while the title's other threads live).

Tests: exit_process_resolves_to_hle (kernel32, kernelbase and the
processthreads API set resolve to it) and
a_title_exit_process_ends_as_windows_does_with_its_code (a child process
holding a lock an atexit function wants, with another thread alive,
ends with the title's code).

From DexNom/VIctory@570a941e9b (the
kernel module's ExitProcess and both tests).

Co-authored-by: DexNom <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
LoadLibrary and GetModuleHandle: "If the string specifies a module name
without a path and the file name extension is omitted, the function
appends the default library extension .dll to the module name. To
prevent the function from appending .dll to the module name, include a
trailing point character (.) in the module name string."

find_module kept the dot as part of the name, so "foo." never matched
a title image or module named "foo" and was refused instead. The dot
is now dropped and no extension added; "foo" still means foo.dll.

Test: a_module_name_with_a_trailing_dot_gets_no_dll_appended (fails
before: "plain." returned NULL instead of the extensionless image).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every worker read a file through the one handle the title's open made.
That handle is opened for synchronous reads, and the host does the reads
of such a handle one after the other, so the workers queued behind each
other on every file. Each worker now reads through a handle of its own,
made from the title's with ReOpenFile when it first reads that file (the
title's handle if the host makes none).

48 KiB reads at random, 24 threads: 185 MB/s through one handle and
990 MB/s through a handle each, from an archive not in the file cache
(the fork's measurement); from the cache on this machine, 4.2 GB/s and
6.6 GB/s (read_bench, ignored, on any file named by VICTORY_BENCH_FILE).
VICTORY_DSTORAGE_HANDLES=0 reads through the title's handle alone, as
before.

From avatarmanz/VIctory-7900XTX fbc1830 (its handles mode; the
overlapped and unbuffered modes and the xmem lock changes are left out).

Co-authored-by: local <local@localhost>
XMemMapPhysicalPages maps consecutive page runs one view at a time after unmapping the requested range. If a later run fails (unknown page or host map failure), previously mapped runs in the same call were left mapped in physical.views/physical.shown and the process address space. Unmap any runs mapped earlier in the call before returning null, and document the unmapped failure state.
Import entries previously checked only that each 8-byte IAT slot ended within SizeOfImage, accepting null (RVA 0), header RVAs (such as 0x40), and gaps between sections, which would cause victory-loader/src/windows.rs to patch the image headers instead of an IAT slot. Check that every 8-byte IAT slot lies within one file-backed section as well as within SizeOfImage, and test null regular/delay IAT RVAs and a non-zero header IAT RVA.
The clamp of indirect arguments is HLSL compiled at run time by the
system's compiler. Under Wine and Proton that is vkd3d-shader's, which
has no methods on byte address buffers and ignores the RootSignature
attribute, so the clamp is never made and every indirect execution is
dropped (#170, #909, #2744).

The buffers become structured buffers of uint, indexed in words (the
caller already refuses addresses and strides that are not multiples of
4), and the root signature is serialized beside the shader, in the
order the caller sets it. The bounds, the budget and its order are
unchanged.

Carries #1279, rebased onto the clamp that charges records in order.

Co-authored-by: Mumogg <[email protected]>
The clamp tests read back only each record's first word. They now
read whole records, and one test checks every word of two records of
each kind.
Review: the benchmark spawned the SDK's dxc.exe. It now loads the SDK's
dxcompiler.dll and compiles through IDxcCompiler3 in the test process
(D3DCompile has no shader model 6, which the wave variant needs), signed
by the SDK's dxil.dll where there is one. Without the SDK the tests still
do nothing.

The benchmark also times each case as four submissions of a quarter of
the groups, summed: main's slowest case takes about 1.6 s for all of
them, near the host's 2 s device reset, and a busy GPU pushed it over.
# Conflicts:
#	crates/victory-gpu/src/marks_bench.rs
16-bit depth written through unordered views reaches the host's depth
texture through a compute converter compiled at run time. Wine's and
Proton's built-in d3dcompiler_47 refuse it (no methods on byte address
buffers) and ignore its RootSignature attribute, so the converter is
never made and that depth stays clear (#1860).

The buffer becomes a structured buffer of uint indexed in words (every
offset and pitch is a placed footprint's, a multiple of 4), and the
root signature is serialized beside the shader. A test runs the
conversion both ways, after #1872's.

Co-authored-by: BastienRdz <[email protected]>
The public DirectStorage documentation for the console queue says an
Enqueue submits the queue once it has filled more than half of its
capacity since the last submission; the queue submitted at exactly half.
A queue of 8 holding 4 entries since its last submission now leaves them
pending until Submit or a fifth entry.

A queue holds one entry fewer than its capacity (one slot stays free), so
a queue of 2 holds one entry and could never pass half: it submits once
full, or its next Enqueue would wait forever.
Match victory-hle's lifecycle::fit in host.rs::make_window: shrink oversized fallback host windows proportionally to SPI_GETWORKAREA, honor VICTORY_WINDOW_MAX=WIDTHxHEIGHT, and center them without adding a second window-sizing env var.
On AMD's D3D12 compiler (RX 6950 XT, driver 32.0.21045.29003; also
reported on RDNA3 and a gfx1036 iGPU), a double built from dwords 1 and 2
of one uniform 4-dword load (the root constants here) reads its low dword
as both halves, alone or when two sources share a dword. WARP and NVIDIA
are right.

Each dword of a register-pair f64 source is now XORed with the lane index
shifted right by 31, a zero the compiler cannot fold. With it the doubles
come out right on the RX 6950 XT and WARP. Inline constants and literals
are unchanged. Cost: one lane index and one shift per program, one XOR
per dword of a register-pair source.

New test f64_reads_uniform_pairs_at_odd_dwords, 4 inputs: add, mul, fma,
max, min, cvt_f32/i32/u32_f64 and two compares on v[2:3] and on sources
sharing a dword; a disjoint-pair add and v_cvt_f64_f32 as controls; and
64-bit integer shifts and v_mad_u64_u32 on v[2:3], which were right on
AMD without the change. Without the lowering change it fails with 45
wrong hardware results (WARP none); with it, it passes on both backends.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In resource.rs, Tracer::lane_value already checked Tracer::runs to ensure every active lane at a use site executed a guarded VALU write, but vorigin, vadd, carried (v_add_co_ci_u32), lane_term, and sum followed guarded v_mov_b32 / v_add_co_u32 / v_add_nc_u32 / v_add_co_ci_u32 definitions without checking EXEC guards.

When a shader modifies a VGPR offset or address pair under narrowed EXEC (for example via s_and_saveexec_b32), restores EXEC, and performs a global_load / global_store / global_atomic, flat_address folded the guarded offset statically or attributed the high half to a root parameter, causing lanes whose EXEC bit was clear during the guarded write to read or write the wrong offset.

Thread the use site's lane conditions into vorigin, vadd, carried, lane_term, and sum via Tracer::site_known and Tracer::runs_value, and cache entries in Tracer::sums only when tracing relied on no EXEC guards so guarded and unguarded consumers of the same SSA value do not poison each other.
`Layout::detile` and `Layout::tile` copy a subresource as the contiguous
runs its columns make, the same runs on every row. Each run was a slice
copy through a closure, bounds-checked on both sides: a 4K RGBA8 texture
in a 64 KiB standard swizzle is about two million 16-byte runs.

The runs are now kept with what a row of them reaches (`Runs`): the
furthest tiled byte from the row's start, and the linear row's bytes,
which they cover. Each row's tiled and linear bytes are bounds-checked
once as slices, and its runs copied from them without further checks
(at the fixed widths #603 added, as before). `Runs::new` asserts that every
run lies in the linear row; every run lies in the tiled span by
construction. Linear layouts are one run per row through the same path.

Measured on a Ryzen 9 7900X (release; old and new
alternating 40 times in one binary, best of each; same bytes out):

| texture (64 KiB S unless noted) | before | after |
|---|---|---|
| RGBA8 3840x2160 | 5.71 ms | 3.93 ms (x1.45) |
| RGBA8 3840x2160, 64 KiB D | 5.77 ms | 4.11 ms (x1.40) |
| RGBA8 2048x2048, 256 B S | 1.50 ms | 1.31 ms (x1.14) |
| R8 2048x2048 | 207 us | 157 us (x1.32) |
| RGBA16F 3840x2160 | 10.17 ms | 8.23 ms (x1.24) |
| BC1 4096x4096 | 506 us | 405 us (x1.25) |
| BC7 4096x4096 | 1.96 ms | 1.66 ms (x1.18) |
| RGBA32F 2048x2048 | 10.47 ms | 8.22 ms (x1.27) |

Copying rows in bands (each run for several rows at once, to stay in a
micro-tile) was slower at every band size tried (4, 8, 16) and is not
done.
Review (#2026) asked for the linear layout's cost and the row bounds.

Timing (release, synthetic textures, detiling every mip, best of five):
the linear path's one-entry run list, allocated per call, made small
linear textures slower than main: 16x16 RGBA8 393 against 219 ns, 4x4
68 against 35 ns. A single run is now kept inline (`Runs::one`), and a
row of one run is copied as one slice: 16x16 221-222 ns, 4x4 35 ns
(main 219-227 and 35-41). 1024x1024 linear stays within the runs'
spread; 64 KiB D 1024x1024 stays slightly faster than main.

`Runs::copy` takes the row's two slices and checks, once per row, that
they are the row's `span` tiled and `bytes` linear bytes; the runs are
then copied unchecked as before, and the callers need no unsafe block.

New test `rows_are_copied_exactly_at_their_bounds`: linear memory
exactly as long as its last row (no slack), tiled memory exactly the
layout's size, rows ending in a shorter run (asserted to occur), pitch
padding between rows untouched, and tile leaving every tiled byte
outside its subresource untouched; tiled and linear layouts, all mips.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`ValueWait::holds` returns `None` both for a comparison we do not know and
for memory that cannot be read, and `Held::pump` counted every `None` as
an unknown comparison, while the doc comment said unreadable memory was
"taken as not holding" (#2604). Whether titles make waits on memory not
yet readable, and whether it becomes readable later, could not be seen.

The pump now counts them apart (`Pumped::unreadable`, summed in the
frame's `Account` and named in its warning next to `forced`) and still
lets the work run, as `main` does; an `ALWAYS` wait never reads and is
not counted. The doc comment says so. Holding such work back can follow
once runs show the memory becomes readable.

Test: `unreadable_waits_are_counted_apart_and_do_not_hold_work`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the title resets a list that a queue still holds part of (a wait
the queue has not seen hold yet), restart() replaces each held host list
with a spare or a new one. When none could be made (CreateCommandList or
CreateCommandAllocator failing once system memory for the GPU ran out),
it kept the held one in place: the title then recorded into a list that
was closed and the queue's, closing it again failed (E_FAIL, "a host
command list did not close"), a later submission would have run it a
second time, and leave() did not get it, so the title list's uploads
and state could be freed while it ran.

Now the title list's host lists end before that one: it and any held
after it are the queue's, and leave() gets the last held one; the
closed ones after it go back to the spares once no queue holds them,
and those not recorded since the last reset (still open: resetting them
would fail) are dropped. A title list without a host list records
nothing until its next reset, which takes a spare or makes one if it
can. A wait that starts a new segment also takes a spare before making
a list, and a list that cannot be made is logged ("no host command
list").

In the prologue's intro on a 16 GB machine, once the shared buffers
began failing with E_OUTOFMEMORY, making a host list failed 41 times in
one run of this change alone ("no host command list"), and no Close
failed then. The run still stopped
34 s later, as runs without it do, at a Close that itself returned
E_OUTOFMEMORY: that failure is the allocation's, not this one.

Tests: early_reset_without_a_new_host_list_does_not_keep_the_closed_one
(no host list is left, closing does not fail, the next reset gets one);
a_reset_that_cannot_replace_a_held_host_list_cuts_the_list_there (three
segments made, reset, then two recorded so the third is still open, and
both held: the last held one keeps what the title list owned; again with
only the first held: the closed one cut off goes back to the spares and
the open one is dropped, which a reset of it would not survive).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
find() reads the shader pack an archive holds as a run of zlib streams
of at most 64 KiB, each inflated through miniz_oxide. It now inflates
each through zlib-rs (pure Rust, runtime SIMD dispatch; the version
#1355 proposes for DirectStorage), in inflate_one.

600 streams of 64 KiB, release build, Ryzen 9 7900X (inflate_bench,
ignored; medians of 5 rounds each): miniz_oxide 19.7 ms, zlib-rs 10.0
ms.

Tests: one_stream_inflates_alone (output and bytes taken with data
after the stream; truncated, too large for the chunk and not a stream
give nothing); finds_a_pack_inside_an_archive as before.

From DexNom/VIctory@570a941e9b (find()
with zlib_rs::Inflate). #1355 converts DirectStorage and the other users
but predates this function.

Co-authored-by: DexNom <[email protected]>
The console reads f32 denormals as zeros, but DXIL floor/ceil/fract
leave that to the host. vkd3d on NVIDIA does not advertise FP32 denorm
flush, so both adapters returned the unfloored result. Flush on the
bits first, as the other denormal-sensitive lowerings do.
write() received a slice already offset to the patch's rva yet indexed it
at rva again, panicking for every rva > 0; it now writes at the start of
the target slice. apply() lifts protection to PAGE_EXECUTE_READWRITE
(code stays executable), restores it through a drop guard, and flushes
the instruction cache, like the TLS redirection. hex() no longer accepts
a leading '+'.
From review: `press_order` appended a key as often as a reading listed
it (scripted VICTORY_KEYS in diagnostics builds can). It now appends each
key once. The test also releases a key in the middle of the held ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
used_bytes followed directory links (DirEntry::metadata reports the
target on junctions) and recursed without a bound: a junction into its
own parent overflows the stack, and one pointing elsewhere charges
foreign bytes to the title's quota. Walk an explicit stack instead and
skip anything whose file_type is a link. VIC-BT-040.
Main's 315cea18 made the clamp read the title's records through a root
view and write the clamped ones into an argument buffer of the list's
own: `indirect::bound` takes no title buffer and returns that buffer,
and the title's copy is never transitioned or written. The test now
passes the returned buffer to `indirect::done`, checks the title's
records are as written, and is named for what it checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lower ds_permute_b32 via wave lane reads (preserving RDNA2 half-wave semantics on Wave64 per ISA 10.4.4) and ds_nop as a no-op, with hardware/WARP/DXIL regression tests.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main's 286a00e9 writes only instructions with effects and what they
read. The tests' last values were read by nothing, so the writer left
them out with all they read. Both tests now store them, and count the
stores, to keep every instruction they name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up. When a reset could not replace a held first host list,
the title list was left with none, yet Reset and Close returned S_OK and
a bottom-of-pipe write recorded next was done on the CPU at once (the
path for no host GPU), telling the title the list had run. A wait that
could not start a new host list (memory ran out) was dropped, and what
followed it ran without it.

Now, as D3D12 does, Reset and Close return E_OUTOFMEMORY for a list with
no host list to record into, and its bottom-of-pipe writes are not done.
A wait that finds no host list to go on in closes the one being recorded
and loses the recording until the next reset: nothing more is recorded,
Close returns E_OUTOFMEMORY and a submission of it runs nothing. The
next reset starts again in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep reading a finished lane’s declared payload, then stop it from taking a new fragment header. Exercise both the independent one-block schedule and an untrimmed terminal refill.

AI-assisted using OpenAI Codex GPT-6.2 Astra (Ultra and High).
Validators before 1.8 reject gradient operations outside the pixel
stage; declare 1.8 for a compute shader that uses them, with the PSV0
runtime-info-3 layout that requires. The regression fixtures branch on
the operations' results so the writer keeps the calls (a call nothing
reads is dead).
Review on #2902: GetModuleHandleW("kernel32.dll..") on Windows 11 returns
kernel32.dll, so the loader strips all trailing dots, not one. The test
now also looks up "plain.." and "plain.dll..".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`sgd5::records` only fell back to marker scanning when `databases(file)`
returned zero parsed databases. In an archive holding multiple SGD5
databases where at least one table parses cleanly and another fails
`parse()` (for example, due to an effect-table mismatch or truncation
after its shader records), all recoverable shader records from the
unparsed database were silently dropped.

Track whether any `SGD5` magic occurrence failed `parse()` during
`scan_databases`. When all databases parse cleanly, keep the fast table
path unchanged; when an archive mixes parsed and unparsed databases, also
scan for markers strictly outside parsed `[db.start..db.end)` spans and
merge all records in file order without duplicates.
Each draw's descriptor tables went through two lookups per entry where
one does, on the per-draw path (`tables`, `readable`):

- `tables` looked every entry's heap and slot up to find tables to make
  afresh, then again to make each entry. Tables are made afresh only past
  a host heap smaller than its title heap (Heap::capped: a host's cap, a
  paged heap's); with no such heap bound, as on most hosts, each entry is
  made directly.
- A constant view's copy was found for its first byte, then again for the
  range up to that copy's end, which finds the same copy (the innermost
  buffer, or the same window of loose memory). One lookup now.

the_copy_holding_a_views_first_byte_holds_it_to_its_end checks the
second: in an inner buffer, in its outer one, past the inner one's end,
and in loose memory.

Measured with `cargo demo` (CrossOver, M5 Max, 720p, no overlay): the
title's recording time fell from 5.14-5.16 to 4.93-4.94 ms a frame at
scale 64 (4,047 draws, -4%); at scale 128 the runs overlap (9.97-10.01
before, 9.87-10.09 after). victory-gpu's draw and descriptor tests give
the same results as before under Wine.
Two 64 KiB ranges 8 MiB apart only show whether a batch keeps one span:
every change that keeps ranges apart keeps these apart. Pages 0 and 2
are asked for as well, with page 1 written and not asked for, so the
bytes checked and copied also show whether ranges a page apart are
joined (copying page 1) or kept as asked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run in parallel, victory-gpu's shadow and watch tests failed now and then
(about one run in three), each passing alone:

- A test can leave a tracker of its pool behind (a host copy or a
  texture's staging something global still holds) and then free the
  pool. Its pages stay in the guard set, and a pool another test got at
  the same addresses counts as guarded already: its writes never fault,
  so nothing is seen changed or saved (armed_ranges_keep_..., the
  partial-refresh tests). watch::tests::free now decommits the pool and
  keeps its addresses reserved, so no allocation lands there again.
- copy_back_marks takes every mark set in the bitmaps, and a test
  submitting alongside took the marks a mark test had just set
  (marked_pages_go_back_..., marks_of_shaders_using_title_memory_...).
  Those tests now hold the submission lock while they run, as the
  read-mark tests do (host::tests::no_submissions).
In console UMA-to-discrete shadow buffer synchronization, merge_writeback scans memory ranges byte-by-byte to merge GPU writes back to title RAM. For the majority of memory in typical frames, the GPU has not modified the contents (host_word == old_word).

- Process 8-byte chunks (u64) with chunks_exact_mut(8).

- Fast-skip unchanged 8-byte chunks in a single comparison, syncing host to title only when needed.

- Process byte-level lane logic only for altered 8-byte chunks and trailing remainder bytes.

- Matches writeback_merge_matches_bytewise_oracle across all lengths and strides.
partial_refresh_under_marked_range_updates_saved_bytes failed now and then
in parallel: page 0 came back whole from the copy over the title's later
writes, or the copy's writes did not come back at all, as if a submission
of a test running alongside had worked through the copy first. It does no
submission of its own, so it holds the submission lock.
ExitProcess went straight to the host's: the other threads ended, but
the title images, which Windows' loader does not know, got no
DLL_PROCESS_DETACH. The CRT exit path gives them one (the loader's
detach_all, from its exit table). Windows' ExitProcess ends the other
threads and detaches every DLL before the process ends, so ExitProcess
now runs the loader's detach_all (victory_loader::detach_for_exit_process)
and then the host's ExitProcess with the title's code. It still runs
no exit function.

The test that spawned a child copy of the test binary is replaced by
a_title_exit_process_detaches_then_ends_with_its_code. Stand-ins for
the two steps check that the detach comes before the exit and that the
exit gets the title's code, without ending or spawning a process.
Keep the AND of Step::GpuWrite's marked flag when merging declared ranges in Host::execute, skip whole-range drop_withheld for withheld ranges whose steps are all marked (and whose copy has all mark bits below the bitmap's cleared last dword), and drop pages filtered as withheld in shadow::copy_back_marks one by one after the marked copy-backs complete.
A denormal coordinate still reads as a zero where the major axis and the
signs are chosen (#1766). The result is different: v_cubesc_f32 and
v_cubetc_f32 return the chosen coordinate's own bits, negated by
flipping the sign bit, and v_cubema_f32 returns +0 when the major axis
is a zero or a denormal. Measured on RDNA2 (gfx1035, gfx1036) with IEEE
mode off and 32-bit denormals flushed, as recorded in the AnyPS5
hardware-oracle tables.

The pick and the negation work on the bits, so the result does not
depend on how the host treats denormals. A probe checks seven measured
rows, and the cube() model follows the same rule.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
low_guards::retry previously released only one guard at a time and re-guarded it immediately on failure before trying the next guard. When a 32-bit XMemVirtualAlloc request needs a contiguous span crossing two or more guards — such as guards split by an earlier allocation that was later freed, strictly adjacent guards, or a 2 MiB-aligned (PAGES_2M) window straddling a guard boundary — every single-guard attempt fails and returns ERROR_NOT_ENOUGH_MEMORY even though the combined span is free.

Preserve the single-guard fast path first, then fall back to releasing each cluster of base-sorted guards bridged exclusively by MEM_FREE space simultaneously. After the allocation attempt, re-guard only the remaining free portions of the released guard intervals (coalescing strictly adjacent guard intervals while never claiming unguarded free gaps between non-adjacent guards), and preserve the allocation error across VirtualQuery and re-guard calls.
A negative Z face negates X by changing its sign bit alone. Selecting the signed values directly lost the subnormal payload on the RTX 4090 Laptop. Select the operand and its sign mask separately, then apply one integer XOR. Check both Z faces and both signs at the endpoints of the subnormal range.
The measured RDNA2 SC and TC clamp rows retain a selected positive subnormal without an output multiplier. Preserve that bit pattern while using the ordinary saturate for other values. Leave output multipliers on their existing path.
texture_state previously masked only four buffer-only bits out of pc_state, letting reserved bits (0x4000/0x8000/0x100000), video-queue bits (0x10000..=0x800000), raytracing acceleration-structure bits (0x400000), and shading-rate bits (0x01000000) reach host CreateCommittedResource, CreatePlacedResource, and direct-queue ResourceBarrier calls. legal_for also preserved combined write+read and multi-write state masks (such as DEPTH_WRITE | DEPTH_READ or DEPTH_WRITE | PIXEL_SHADER_RESOURCE), which D3D12 rejects with errors #522, #526, and #537, failing texture creation or failing ID3D12GraphicsCommandList::Close with E_INVALIDARG.

Restrict texture_state to the ten direct-queue texture read and write states, and update legal_for to sanitize through texture_state, strip flag-forbidden bits first, and collapse any remaining write-state combination to a single exclusive write state while preserving valid read-only combinations.
They load pipelines from the title's precompiled native cache. On failure
the title makes the same pipeline from its ordinary description, which we
translate; native-only pipelines we cannot.
Shaders: preserve subnormal cube coordinates on negative Z and through clamp
Consecutive slices of one section at consecutive addresses can still cross
two reservations: the pages say nothing about where a placeholder ends, so
a batched call was refused (os error 487) and, worse, the whole range had
already been unmapped. One VirtualQueryEx at the run's first address now
clips the run to the room left in that placeholder; an address that is not
a reserved placeholder (already shown, or the title's own memory) maps page
by page as before.
HostList::prelude recorded its submission transitions on a single
(allocator, list) pair. A submission naming the same list twice called
prelude twice; the second call reset the pair the first had just
recorded, so the first use's barriers were destroyed before
ExecuteCommandLists ran them.

The pair is now a pool: prelude pops a free pair or makes one, records
it, and moves it to a flight list; execute moves flight pairs back to
free once every group is waited for. A regression test records two
uses' preludes and checks they are different command lists.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Two queries for an interface, three locks and a name looked up at every
change of pipeline; now one lookup by address, the first time the list
binds that host pipeline. The set is cleared with the rest of the list's
deferred state, so a reset binds them again.

From avatarmanz/VIctory-7900XTX ab86ef7f3, after Belobug
92d353f8 (romainhedouin), GPL-3.0.

Co-authored-by: avatarmanz <[email protected]>
Every draw of a pipeline whose shader reads the view-stride table kept the
table again: a QueryInterface on the host resource, the deferred lock, a
push into the list's kept objects, and a Release for each of them when the
list resets. The pipeline and root signature beside it are already kept
only when the binding changed.

A list cut into a fresh host list after a wait forgot its kept objects but
not the remembered table, so the next segment skipped the keep and could
name a table nothing holds. host_state_lost() forgets it too, with a test.
D3D12CreateDevice(None, …) takes the adapter DXGI calls the default, which is
the one driving the primary output: the integrated GPU on a hybrid laptop,
and on a machine with a remote-desktop or emulator display driver an adapter
that cannot create a device at all. The title needs shader model 6.6 and, for
the world, mesh shaders, so neither is a safe default, and when none of them
worked the failure was a bare E_FAIL that named nothing.

Enumerate and probe every adapter — a device, SHADER_MODEL, D3D12_OPTIONS7's
mesh tier, the software flag — then choose: hardware, SM 6.6, mesh shaders
first, then the most dedicated memory, then the lowest LUID so the choice
does not depend on enumeration order. A software adapter is not probed at
all: runs_the_title never picks one, and a WARP device (one per adapter and
process) is the very device that code asking for WARP on purpose holds. WARP
stays the explicit VICTORY_D3D12_WARP switch. When nothing qualifies, the
error lists every adapter with what it offers.

Measured on the machine this was written on (Core Ultra 9 185H, Intel Arc
iGPU, plus a remote-desktop and an emulator display driver): four adapters,
the same GPU listed three times — once per display path, so which one is the
default is not stable — and the Basic Render Driver passing a naive SM 6.6 +
mesh test, which is why the software flag is checked before the features.

Rebased onto main 63bcca4.
cargo test -p victory-gpu: 237 passed, 2 failed, 1 ignored; both failures
reproduce on unmodified main on this Intel iGPU (heap-size assertions).
cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
(cherry picked from commit 1d717d57fabf1ce0234ad50658b99ff62a908108)
First step for #2586. A list made while VICTORY_DEFER_LISTS=<workers> is
set gets method tables that copy each call's arguments into a log; worker
threads run the existing methods from it, in order, one list at a time.
Lists made without it keep today's tables.

Methods that return what the title reads stay on its thread. Reset,
ResetX and the last Release wait for the list's logged calls first, as do
ExecuteCommandLists (before it takes the held-work lock) and host
libraries recording into the list. The 5-second report gets a line with
the calls workers translated and how long title threads waited.

Tests: log ordering on workers, and the two-queue test with deferred
lists (it clears an argument after the call to catch uncopied ones).
every_inline_command_falls_back_to_the_table now resets through the
table, as a title does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The used_bytes_skips_junctions test made its junctions by shelling out
to cmd /c mklink /J. Make them through the reparse-point API instead
(CreateFileW + FSCTL_SET_REPARSE_POINT with IO_REPARSE_TAG_MOUNT_POINT),
which the crate's windows-sys already supports; no child process, no
cmd dependency.
A one-list host submission is timed with VICTORY_GPU_TIMING but was excluded from gpu_times. Read the fps line counters in the five-second block so it covers the same frames as GPU timing.
texture_at put its resource into the map before the host texture was
known to exist, and current() answers a cached resource whose host
texture never was — so a slot that failed once answered every later
ask with nothing.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The lock exists because WARP can end the test process with an access
violation, and because two tests dispatching at once can have one read back
what the other wrote: that is the shape of #1882, where
memory_tests::title_memory_is_read_and_written_at_computed_addresses failed
now and then in a full workspace run and reported thousands of pages set
instead of three, while passing when run alone.

diff_tests was the only module that makes a Host without taking it: three
tests there (translated_shaders_draw_as_pc_ones,
translated_mesh_shaders_draw_as_pc_ones, float_semantics_are_the_consoles)
dispatched beside whatever else the test threads were running. They take it
now, through one helper, and the lock's own documentation says the rule the
audit found written nowhere: a module that makes a Host without it is how
the failure comes back.

Audited all nine GPU test modules of the crate: each makes its Host under
the lock.
`image_atomics_of_64_bits` built a pipeline on an `R32G32_UINT` typed UAV
and panicked on the adapter's `E_INVALIDARG` — here on Intel Xe-LPG, and on
WARP as well, neither of which has atomics on that format. The panic reads
as a bad module rather than as a capability the device does not have, and
because it panics the test never reaches its WARP half.

`Host::uav_atomic_support` now asks `D3D12_FEATURE_FORMAT_SUPPORT` for the
format's `Support2`, and the test skips with the mask printed when the
atomics it needs (exchange, compare-swap, unsigned min/max) are absent. On
this Arc the mask is `0x3c0` — the typed load and store bits, no atomic
bits — so the test cannot run there at all; where an adapter does offer
them, it runs exactly as before.

Measured on Intel Arc (Xe-LPG, driver 32.0.101.6127), main `63bcca4`:

  cargo test -p victory-shader --lib
  296 passed, 6 failed, 3 ignored     (was 295 / 7 / 3)

cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
`descriptor::make_read` resolved every read slot twice: `mirror` (the
made keys' lock, the global views' lock, a clone of the view, and the
kept lock when a texture view needs remaking) and then `stamp_read`,
which looked the same slot up again -- the same two locks and a second
clone -- only to stamp the texture the view holds.

`mirror` already has the view in hand and returns it, so the stamp takes
it: `stamp_read_view(&view)`. `stamp_read` had no other caller and is
gone. Per read slot that is one lookup instead of two, and the stamps are
unchanged: the slots `mirror` refuses are the ones `stamp_read` found no
key for and returned on.

Verified on an Intel Arc B580, Windows 11:
- `cargo test -p victory-gpu --lib --locked -- --test-threads=1`: 229
  passed, 2 failed -- the known Intel heap-cap pair (#1744/#1829) that
  pristine main also fails on this card.
- `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with
  and without the `diagnostics` feature.

No game data used; synthetic tests only.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review from oni-swr on #3203: WARP reports no atomic bits for `R32G32_UINT`
(`Support2 0x3c0`) and still runs these atomics, so asking the capability
question up front skipped a test that passes on WARP — CI coverage lost for
a check that had been asserting every value.

The question is now `D3D12_FEATURE_DATA_D3D12_OPTIONS9`'s
`AtomicInt64OnTypedResourceSupported`, which is the flag the debug layer's
message names ("Shader uses atomic int64 on typed resources, but the device
does not support this"), and it is consulted only after `compute_pipeline`
has already failed:

- an adapter with the flag clear that creates the pipeline runs the test as
  before — WARP, which passes;
- one that refuses it (Intel Xe-LPG here) skips with the reason and the
  driver's own message in the log.

Measured on Intel Arc (Xe-LPG, driver 32.0.101.6127), `63bcca4`:

  hardware: no 64-bit atomics on typed resources; skipped: 参数错误。
  VICTORY_WARP=1: runs, passes (no skip line)

cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.
Grand Theft Auto VI's suspend routine calls the command queue's
SuspendX(0) at 0xb8, which had no method: every window close or
relaunch logged "method not implemented" for the command queue and the
call answered E_NOTIMPL (noted in #1080). SuspendX and ResumeX now
succeed. On the console they stop and restart the queue's GPU work; here
submissions have run when Execute returns, work held for a wait runs
once the wait is met, and a suspended title is never resumed, so there
is nothing to stop.

They sit at 0xa8/0xb0 in the older queue layout, so newer queues have
them at 0xb8/0xc0, where the title calls them.

New test: queue::tests::queues_suspend_and_resume.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first part of #1905, measured instead of argued: what the title does to
memory the GPU is meant to read in place, tried against the model this module
already keeps.

The guard page half holds. A 16 KiB PAGE_NOACCESS change inside a live range
that physical pages are mapped into is accepted, the pages on both sides keep
their bytes across it and across the change back, and the run model still
sees the run as one.

The remap half does not, and that is the finding:

  MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER on half of a live range  ->  0

A range that physical pages are mapped into is no longer a placeholder, so
the title's "free half, reserve it again, map new pages there" step is
refused before any GPU read happens. Nothing moves and the range still reads
as one run of four pages, which is exactly why nothing in the runtime notices
it: the bytes are fine, and the remap simply did not happen.

This is the test #1905 needs before #407 (the GPU reading memory in place) can
be judged, and it is written down as the finding rather than as a failure so
the next change to the memory model has something to turn green.
translate --pipelines reported every one of the title's 8,214 mesh programs
as 'pipeline: Unspecified error' on an adapter whose D3D12_OPTIONS7 mesh tier
is not supported (an integrated GPU, WARP): 8,214 identical rows that read as
a translator defect and bury the real refusal reasons. The runtime already
knows this (host::mesh_shaders and the refusal at host.rs:324); the offline
path did not ask.

Host::mesh_shaders() answers the same question for the offline device, and
the census asks it once per worker: a mesh program then fails with 'pipeline:
the host has no mesh shaders', one bucket that names the host, and the same
count otherwise. On an adapter with mesh shaders nothing changes: the same
8,214 pipelines are created on the RTX 4090 as before.
`Changed::save` keeps a page's bytes from before its first write (the
copy-back of marked pages compares against them). It zeroed a fresh 64 KiB
buffer and then had `ReadProcessMemory` overwrite all of it, holding the
tracker's lock throughout. The read now goes into an uninitialised buffer
(`host::read_into_uninit`): a read that succeeds writes every byte, one
that fails keeps none of it. The read stays under the tracker's lock, so the
bytes belong to the arming that is checked (an earlier version read outside
it; the page could be disarmed and armed again meanwhile, found in review).

What is saved is unchanged: still the page's own bytes before the write,
read by the kernel (so an unmapped page fails instead of faulting), as the
review of #3241 requires.

Measured with 64 armed, already-written pages and 20 rounds of `save` in
the test harness (release, RTX 4070 machine, i7-13700F): median 21.1-21.7
us a page before, 16.0-17.2 after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The seven `choose` tests build their own `Facts`, so nothing ran the real
enumeration — the part that meets a hybrid laptop's integrated GPU or an
indirect display adapter (mercuryVM's review of #967).

`the_real_enumeration_names_every_adapter_and_never_chooses_software` calls
`enumerate()`, then asserts what holds on any host: every adapter appears in
the report, and `choose` never returns a software adapter or one that cannot
run the title, and does not pass one over. It prints the pick and skips where
there is no DXGI adapter.

This machine, which has an Intel Arc iGPU, two indirect display adapters and
Oray/MuMu virtual ones:

  chose 0 of 4: Intel(R) Arc(TM) Graphics

cargo test -p victory-gpu --lib: 238 passed, 2 failed, 1 ignored. Both
failures are this host's view-heap cap and are not from this change: one is
`descriptor::host::tests::dynamic_slots_are_held_until_released`, which #3191
fixes, and the other `memory::tests::lists_share_a_table_and_copies_keep_their_views`
asserts `pairs.0 >= 1 << 18` on the same assumption.

cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.
On Windows 10 without the Agility SDK (#2460) the host's D3D12 runtime
stops at shader model 6.5 and has no ID3D12Device10. Three tests then
failed on every such PC, and the suite took a minute more:

- compute_view_marks_rebind_after_depth_twin_conversion and
  depth_bounds_control_a_title_draw: the runtime refuses the root
  signature ("Unsupported bit-flag set (root signature flags c00)",
  E_INVALIDARG): CBV_SRV_UAV / SAMPLER_HEAP_DIRECTLY_INDEXED need 6.6.
  The depth bounds test waited 60 s for the pipeline before failing.
- a_texture_written_in_one_format_reads_in_another_through_a_placed_view:
  with no CreateCommittedResource3 the R32_UINT texture is not castable,
  and the R9G9B9E5 view's own texture with unordered access is refused
  (E_INVALIDARG); texture_at gives nothing ("round 0: a placed texture").
  #1999 reports the same test on another Windows 10 PC.

Host::agility_runtime (tests only) checks both, says why, and the three
tests are skipped where it is false, as the placed UAV test already does
for 6.6. Where the runtime has them nothing changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pops_wait_loop_exits_immediately_for_inactive_lanes took a WARP device
for granted (`expect("WARP host")`). Windows 10's WARP stops at shader
model 6.2, with or without the Agility SDK, so it failed there on every
run. It now skips as the other WARP tests do ("no SM 6.6 warp device;
skipped").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Console mesh shaders receive `SV_GroupID.x` in `v5` multiplied by
`max(threads, max_vertices, max_primitives)` and divide by that stride to
recover the group index.

In `emit_with`, `mesh_stride` had two bugs:
- From `PSV0` runtime info v2+ (`size >= 48`), it read only `NumThreadsX`
  at offset `4 + 36` and ignored `NumThreadsY` (`4 + 40`) and
  `NumThreadsZ` (`4 + 44`). Valid 2D/3D HLSL mesh shaders (such as
  `[numthreads(8, 8, 1)]` or `[numthreads(4, 4, 4)]`, where `X * Y * Z =
  64` exceeds `max_vertices` and `max_primitives`) received a truncated
  stride, corrupting `SV_GroupID.x` for every non-zero mesh group.
- When `PSV0` was absent or older than v2, `threads.map_or(ms.threads, ...)`
  returned raw `ms.threads` without taking `.max(ms.max_vertices)` and
  `.max(ms.max_primitives)`, under-multiplying `SV_GroupID.x` whenever
  output counts exceeded the lane count (e.g. 32 or 64 threads with 64-256
  vertices/primitives).

Extract `mesh_stride` to multiply `NumThreadsX * NumThreadsY * NumThreadsZ`
with overflow/zero checks, falling back to `ms.threads`, and always apply
`.max(ms.max_vertices).max(ms.max_primitives)`. Add unit tests covering
1D/2D/3D `PSV0` v2/v3, fallback, zeroed, and overflow cases, plus an
end-to-end DXIL validation, disassembly, and hardware/WARP mesh draw test.
The title's acceleration-structure builder (`XboxBvhBuilder.dll`) builds
and refits the ray-tracing structures in title memory every frame through
some fifty compute dispatches. A dispatch without a host pipeline is
dropped on its own (`State::dispatch`, `execute_indirect`), and some of
the builder's lack one for a long time or for good: refused on hosts of
32-lane waves (they ask for 64-lane waves), not translated, or still being
made. The stages that do run then work on data the missing ones never
wrote, and write the result into title memory. On fxceless/victory-fork,
where this happened, the builder wrote garbage bounds that crashed the
title; that fork's rule is the one taken here.

Its dispatches now run only in frames where every pipeline the builder
has created has its host pipeline; otherwise none run, and the structures
keep what they held. The decision is made once per frame, so a frame
never runs part of the builder. Its pipelines are known by origin: bytecode
in the builder's image, or a return address in it on the stack when the
pipeline is created (`run` passes the DLL's range as it maps it, at start
and when the title loads it). They are started at once, so no frame's
wait budget holds the builder back.

New tests (no game data):
- `pipeline::builder::tests::the_builder_runs_only_with_every_pipeline_made`
- `pipeline::builder::tests::builder_pipelines_are_known_by_their_origin`
- `pipeline::tests::builder_dispatches_wait_for_every_builder_pipeline`:
  a compute pipeline created from bytecode in the registered image is the
  builder's, is started at once, is refused (no shader container), and
  holds back builder dispatches; another pipeline is not held back.
The builder's gate counted only pipelines that are missing. With all of
them made, a builder dispatch can still be dropped at dispatch time:
`State::bind` fails (a root view's offset it cannot place, no dynamic
slots, no view heap), or an indirect dispatch's arguments, count or
signature are not there. The builder then ran without that stage, which
is what the gate is for.

Such a drop now holds the builder back at once: the rest of the frame's
builder dispatches are held, and, if the dropped pipeline is made, the
builder stays held while the title keeps that pipeline (the next frame's
check would not see it otherwise). The drops seen so far recur every
frame, and a retry would run another partial frame, so the hold is not
retried on a timer; it is lifted when the title releases the pipeline.
A builder pipeline not made yet when its dispatch comes (one created
after the frame's decision) holds only the rest of the frame; the next
frame's check sees it as missing. The first drop is logged with its
reason.

`State::bind`'s reasons for not running a dispatch are now kept outside
diagnostics builds too, so the log can say why.

New test (no game data):
- `pipeline::tests::a_dropped_builder_dispatch_holds_the_builder`: a
  made builder pipeline runs; once a dispatch of it is dropped, the
  builder is held back in that frame and later ones, and runs again
  once the pipeline is released.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3327/head:github-bot/gh-3327'
git switch 'github-bot/gh-3327'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3327'
git switch 'github-bot/gh-3327'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3327'
git switch 'github-bot/gh-3327'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3327'
git switch 'main'
git merge --squash 'github-bot/gh-3327'
git switch 'main'
git merge --ff-only 'github-bot/gh-3327'
git switch 'main'
git merge 'github-bot/gh-3327'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3327
No description provided.