Tracking & Static Audit: 45 New Source-Level Bugs + 150 Prioritized Backlog Items [Part 1/2] #1242

Open
opened 2026-11-26 04:24:42 +00:00 by github-bot · 10 comments
Owner

@⁠hyperland956-lgtm on GitHub · 2026-11-24 16:45 UTC · original

Multi-Part Series (1/2): Part 1/2 (this issue) | Part 2/2: https://github.com/Marvisak/VIctory/issues/1249

Tracking & Static Audit: 45 New Source-Level Bugs (Shader IR/ISA, GPU Runtime, Tiling, HLE) + 150 Prioritized Backlog Items

Tracking & Audit Issue: This tracking issue groups 45 newly identified, non-duplicate source-level findings alongside a prioritized index of 150 existing canonical open issues/PRs (195 total work items) to help contributors pick up high-impact, separable fixes without opening duplicates.

Scope, Testing & Policy Disclosure: AI-assisted static code audit (prepared with Gemini). All findings are strictly source-level and synthetic (zero proprietary game bytes, disassembly, extracted shaders, or screenshots). Algorithmic/numeric reproducers (thick 3D mip-tail depth, f16 single-rounding ties, v_mad_f16 vs v_fma_f16, MUBUF OOB_SELECT=3 SOFFSET, physical-page double-free counter, FMT_INFO clamping, and singular BVH inverse) were verified via Python reference checks on Linux; cargo test on Windows MSVC / D3D12 GPU has not yet been run on these fixes.

  • Repository: https://github.com/Marvisak/VIctory
  • Audited Revision: d2a4bae (main, 2026-11-24)
  • Date: 2026-11-24

1. Highest-Impact Active Bottlenecks (Existing Canonical Issues/PRs — Do Not Duplicate)

  1. Untranslated World Compute/Mesh Shaders & Dark World Scene — Tracked in #752 (533 of 2,679 shaders untranslated in reported Linux/RDNA4 run; world mostly black).
  2. Unbound / Placed Texture UAV Faults & Device Removal — Tracked in #508 (prior PR #552 closed unmerged — still unresolved on main).
  3. Indirect Argument Clamping & Async Host Fence Timeline — Active open PRs #583 (indirect count buffer & u32 budget wrap) and #595 (async fence timeline & CopyMemoryToMemoryX ordering).
  4. Wave32 / Wave64 Cross-Lane Support & Intel VEH Hardening — Active open PRs #189 / #192 (Wave32 cross-lane ops) and #216 (page-end clwb & VEH hardening).

2. Newly Identified, Non-Duplicate Findings (45 Separable Tasks)

Each item below was checked against all existing open, merged, and closed issues/PRs and comments, and can be implemented and tested in its own focused PR.

# ID Priority Location Summary
1 VIC-BT-001 P0 crates/victory-gpu/src/host.rs lines 504-511, 582, 931-963 Host::execute() clobbers HostList::prelude command allocator/list when the same HostList appears twice in runs
2 VIC-BT-002 P0 crates/victory-shader/src/ir.rs lines 139-143, 198, 217-264, 343-352, 594-601 SSA construction inserts NONE (Value(u32::MAX)) into phi.args for unreachable predecessors, panicking remove_trivial_phis in release builds
3 VIC-BT-003 P0 crates/victory-gpu/src/list.rs lines 160-230, 261-277 create_list() and create_list_x() ignore the pInitialState pipeline parameter, dropping initial draws/dispatches
4 VIC-BT-004 P0 crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/resource.rs lines descriptor/host.rs:599-611, 648-696; resource.rs:827-836 fits() rejects NULL-desc and DXGI_FORMAT_UNKNOWN SRV/UAVs on typed textures promoted to typeless by host_texture()
5 VIC-BT-005 P0 crates/victory-hle/src/modules/lifecycle.rs lines 296-310 lifecycle.rs: Missing RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification in api-ms-win-core-psm-appnotify-*
6 VIC-BT-006 P0 crates/victory-shader/src/structure.rs lines 946-965 s_cmp_eq/lg_u32/u64 comparing two lane masks is lowered to per-lane equality instead of wave-wide uniform reduction
7 VIC-BT-007 P1 crates/victory-shader/src/emit/lower.rs lines 6793, 6866-6881, 6903-6906 Critical-edge map overwrites first edge block when LaneExit::Branch has taken == not_taken, emitting invalid DXIL PHIs
8 VIC-BT-008 P1 crates/victory-shader/src/emit/lower.rs lines 3626-3727 DPP16/DPP8 ignores fi (fetch-inactive) and source-lane EXEC activity for bound_ctrl
9 VIC-BT-009 P1 crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/shader.rs lines lower.rs:3325-3343; shader.rs:241-264, 405-431 Immediate sampler used non-comparison first then comparison later emits mismatched annotateHandle vs dx.resources metadata
10 VIC-BT-010 P1 crates/victory-shader/src/emit/lower.rs lines 4172-4204, 4894-4907, 4953 Integer VOP3 clamp (unsigned saturation) silently ignored on carry-out and non-carry add/sub ops
11 VIC-BT-011 P1 crates/victory-shader/src/emit/lower.rs lines 6496-6506 Pixel shader export discards on !guard of DONE instead of tracking last exp VM (Valid Mask) and per-MRT color masks
12 VIC-BT-012 P1 crates/victory-gpu/src/descriptor.rs lines 197-238 RtvRecord::desc() and depth_desc() hardcode TEXTURE_2D for NULL-desc RTV/DSVs, breaking MSAA, 2DArray, 3D, and 1D targets
13 VIC-BT-013 P1 crates/victory-gpu/src/draw.rs lines 422-435, 450 State::prepare() compares raw title heap pointers (host_heaps != heaps), creating an ABA bug on heap release and reallocation
14 VIC-BT-014 P1 crates/victory-formats/src/texture.rs lines 406-412 Thick 3D mip-tail predicate omits mip_depth(i) <= fixed[2]
15 VIC-BT-015 P1 crates/victory-shader/src/emit/lower.rs lines 6454-6475 buffer_load_format_d16_x/xyz zeroes high 16 bits of destination VGPR and converts integer formats via legacyF32ToF16
16 VIC-BT-016 P1 crates/victory-gpu/src/descriptor.rs lines 432-438 create_cbv() silently ignores NULL desc instead of writing a null CBV descriptor, leaving stale views active
17 VIC-BT-017 P1 crates/victory-shader/src/emit/lower.rs lines 6082-6110, 6329-6346 d16 image_load corrupts 32-bit integer texels and zeros high 16 bits on odd-channel loads
18 VIC-BT-018 P1 crates/victory-shader/src/emit/lower.rs lines 2088-2128, 2009-2040 ds_swizzle_b32 reads undefined/stale VGPRs from inactive source lanes instead of returning 0
19 VIC-BT-019 P1 crates/victory-shader/src/emit/lower.rs lines 3156-3166, 3219-3241 format_load (tbuffer_load_format_*) drops high byte on unaligned 16-bit dword-straddling loads, fills missing channels with (0,0,0,1) instead of 0, and quiets f16 sNaNs
20 VIC-BT-020 P1 crates/victory-hle/src/modules/gameinput.rs lines 576-579 gameinput.rs: IGameInput/IGameInputDevice/IGameInputReading QueryInterface unconditionally returns E_NOINTERFACE without supporting IID_IUnknown or clearing *out
21 VIC-BT-021 P1 crates/victory-shader/src/emit/lower.rs lines 4315-4342, 4556-4567, 4629-4670, 5387-5399 half_src reads inline float constants as f16 bits instead of f32 bits for 16-bit integer instructions
22 VIC-BT-022 P1 crates/victory-gpu/src/resource.rs lines 815-864 host_texture() passes non-null pOptimizedClearValue without ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL flags
23 VIC-BT-023 P1 crates/victory-hle/src/modules/net.rs lines 540-606 net.rs: getaddrinfo / GetAddrInfoW / GetAddrInfoEx{A,W} fail with WSAHOST_NOT_FOUND without setting *result = NULL
24 VIC-BT-024 P1 crates/victory-shader/src/resource.rs lines 172-190, 261-269, 360-385 resource::track() iterates blocks in index order instead of RPO, missing waterfall offset loads in split_irreducible copies
25 VIC-BT-025 P1 crates/victory-shader/src/emit/lower.rs lines 2834-2873 s_buffer_load_dword* adds unaligned base, soffset, and offset before dword-truncating instead of truncating each term independently
26 VIC-BT-026 P1 crates/victory-shader/src/structure.rs lines 1010-1021 s_cbranch_vccz and s_cbranch_vccnz AND vcc with exec instead of testing raw VCC
27 VIC-BT-027 P1 crates/victory-gpu/src/resource.rs lines 1153-1178 texture_at() caches failed host textures (host == None) in PLACED_TEXTURES before checking host.is_some()
28 VIC-BT-028 P1 crates/victory-shader/src/emit/lower.rs lines 4110-4121, 4147-4153 (vs 4486-4504) v_cvt_f32_f16 drops abs/neg and v_cvt_f16_f32 drops clamp on default low-half VOP3 (op_sel == 0)
29 VIC-BT-029 P1 crates/victory-shader/src/emit/lower.rs lines 5541-5559 v_interp_p2_f16 lowering ignores VOP3 op_sel[3] (high destination half), clamp, and omod modifiers
30 VIC-BT-030 P1 crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/wave.rs lines lower.rs:4205-4232, wave.rs:321-333 v_readlane_b32 and v_writelane_b32 do not mask lane index to S1[4:0] (Wave32) / S1[5:0] (Wave64)
31 VIC-BT-031 P1 crates/victory-shader/src/emit/lower.rs lines 4217-4232 v_writelane_b32 gates its destination write with EXEC, silently dropping SGPR spills to inactive lanes
32 VIC-BT-032 P1 crates/victory-hle/src/modules/xgameruntime.rs, crates/victory-hle/src/modules/dstorage.rs, crates/victory-hle/src/modules/xasync.rs, crates/victory-hle/src/modules/xuser.rs, crates/victory-hle/src/modules/xgamesave.rs lines dstorage.rs:239,264,299,986; xasync.rs:991; xuser.rs:273; xgamesave.rs:908 xgameruntime.rs & COM HLE vtables: Slot 0 (QueryInterface) wired to missing::<0> returning E_NOTIMPL across all GDK and DirectStorage COM objects
33 VIC-BT-033 P1 crates/victory-hle/src/modules/xgameui.rs lines 216-229 xgameui.rs: dialog::procedure dereferences GWLP_USERDATA without null check on WM_COMMAND
34 VIC-BT-034 P1 crates/victory-hle/src/modules/xpackage.rs lines 270-284 xpackage.rs: XPackageUnregisterInstallationProgressChanged (slot 0x50) wired to missing::<10> returning HRESULT instead of bool
35 VIC-BT-035 P2 crates/victory-gpu/src/host.rs, crates/victory-gpu/src/queue.rs lines host.rs:500-543; queue.rs:114-128 Host::execute() calls ID3D12CommandQueue::ExecuteCommandLists with 0 lists when runs is empty
36 VIC-BT-036 P2 crates/victory-hle/src/modules/xmem.rs lines 433-464 XMemAllocatePhysicalPages never recycles freed page numbers (monotonic next_page growth)
37 VIC-BT-037 P2 crates/victory-hle/src/modules/dstorage.rs lines 125-143 dstorage.rs: open_file clobbers GetLastError() via heap allocation before last_os_error() and omits FILE_SHARE_WRITE / FILE_SHARE_DELETE
38 VIC-BT-038 P2 crates/victory-shader/src/emit/lower.rs lines 5811-5826 image_get_resinfo returns 1 instead of 0 for unused depth channels on 1D / 2D / 1D-Array views
39 VIC-BT-039 P2 crates/victory-hle/src/modules/net.rs lines 179-192 net.rs: resolvable() blocks the local machine's own hostname (gethostname) with WSAHOST_NOT_FOUND
40 VIC-BT-040 P2 crates/victory-hle/src/modules/storage.rs lines 90-102 storage.rs: used_bytes() follows symlinks and Windows directory junctions via e.metadata(), risking infinite recursion or quota escape
41 VIC-BT-041 P2 crates/victory-shader/src/emit/lower.rs lines 4071-4098 v_fma_mixlo_f16 / v_fma_mixhi_f16 double-rounds through binary32 instead of single-rounding to binary16
42 VIC-BT-042 P2 crates/victory-shader/src/emit/lower.rs lines 4538-4541 v_mad_f16 / v_mac_f16 conflated with fused v_fma_f16 and double-rounded through binary32
43 VIC-BT-043 P2 crates/victory-shader/src/emit/lower.rs lines 3925-3960 v_mad_f32 / v_mac_f32 / v_mad_legacy_f32 omit unconditional subnormal flush before and after omod
44 VIC-BT-044 P2 crates/victory-shader/src/emit/lower.rs lines 1792-1799 write_f omod (mul:2/mul:4/div:2) preserves -0.0 instead of flushing -0.0 to +0.0 per RDNA2 hardware
45 VIC-BT-045 P2 crates/victory-hle/src/modules/xsystem.rs lines 105-115 xsystem.rs: XSystemGetAnalyticsInfo reports family as 'Xbox' instead of GDK-documented 'Windows.Xbox'

Technical Details for All Newly Identified Findings

1. VIC-BT-001 — Host::execute() clobbers HostList::prelude command allocator/list when the same HostList appears twice in runs (P0)

  • Location: crates/victory-gpu/src/host.rs lines 504-511, 582, 931-963
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for list.prelude() clobbering on duplicate list in runs).
  • Root Cause: In crates/victory-gpu/src/host.rs (lines 504-511), Host::execute() iterates for list in runs, calls list.prelude(), and pushes the returned ID3D12CommandList into lists before calling self.queue.ExecuteCommandLists(&lists) at line 532. Each HostList owns only a single reusable (prelude_allocator, prelude_list) pair, and HostList::prelude() (lines 931-963) unconditionally calls allocator.Reset() and list.Reset() before recording barriers and closing it. If runs contains the same HostList twice (e.g., [L, L] or [L, M, L]), the second list.prelude() resets the allocator and command list while the first occurrence's COM pointer is still sitting in lists[] awaiting ExecuteCommandLists. Both entries in lists[] now point to the second prelude's barriers (and the first prelude's barriers are lost, leaving textures in the wrong D3D12 resource state for the first execution of L).
  • Edge-Case / Verification Note: Verified at host.rs:582 that VIctory explicitly anticipates duplicate lists in a single submission ('a submission may name a list twice'). Also verified that prelude() returns a clone of the same underlying ID3D12CommandList COM object (self.prelude_list.cast().ok()) after resetting self.prelude_allocator.
  • Synthetic Reproducer: Record a closed command list L that transitions texture T from COPY_DEST to RENDER_TARGET and draws. Submit [L, L] in one ExecuteCommandLists call while T starts in COMMON. The first list.prelude() records COMMON->COPY_DEST into prelude_list; the second list.prelude() resets prelude_allocator/prelude_list and records RENDER_TARGET->COPY_DEST. ExecuteCommandLists executes [prelude_list, L, prelude_list, L], attempting RENDER_TARGET->COPY_DEST when T is actually in COMMON.
  • Proposed Fix & Risk: - Fix: Allocate preludes from a per-submission pool on Host (or split runs into separate ExecuteCommandLists batches whenever a HostList pointer repeats in runs) so two queued entries in lists[] never alias the same underlying prelude allocator/command list.
  • Regression Risk: Low; splitting on duplicate HostList pointers (or pooling prelude lists on Host) preserves exact barrier ordering with zero overhead in the common non-duplicate case. (Estimated size: M)

2. VIC-BT-002 — SSA construction inserts NONE (Value(u32::MAX)) into phi.args for unreachable predecessors, panicking remove_trivial_phis in release builds (P0)

  • Location: crates/victory-shader/src/ir.rs lines 139-143, 198, 217-264, 343-352, 594-601
  • Prior-Work Check: 0% overlap across all 3,661+ records in Marvisak_VIctory (issues_and_prs.json, pulls.json, issue_comments.json, review_comments.json); checked remove_trivial_phis, unreachable phi, NONE phi, u32::MAX phi.
  • Root Cause: In crates/victory-shader/src/ir.rs, leader discovery (lines 139-143) creates basic blocks for instructions immediately following s_branch/s_endpgm, and link() (line 198) populates block.preds from ALL blocks including unreachable ones. However, reverse_postorder(), liveness(), and SSA renaming (lines 217-264, 343-352) visit only blocks reachable from block 0. Consequently, outs[unreachable_pred] remains empty, so when filling phi.args for a reachable merge block that has an unreachable predecessor in block.preds, lookup(&outs[p], phi.reg) returns NONE (Value(u32::MAX)). In debug builds this trips debug_assert! at line 261; in release builds NONE flows into remove_trivial_phis() (lines 594-601), which indexes replaced[v.0 as usize] with u32::MAX and panics with an out-of-bounds slice index.
  • Edge-Case / Verification Note: Checked whether link() or split_blocks() prunes unreachable blocks before SSA construction: neither does, and reverse_postorder() is only computed inside ssa() without filtering block.preds. Because AMD's console shader compiler frequently emits unreachable padding/tail blocks or dead jump-table fallthroughs before reachable labels, reachable merge blocks legitimately inherit unreachable predecessors in block.preds.
  • Synthetic Reproducer: Construct a GFX10 shader where block 0 unconditionally jumps via s_branch to block 2 (a merge block using s0), while dead block 1 (immediately after s_branch) writes s0 and falls through to block 2. Call ir::build() in release mode: block 2 gets a phi for s0 with preds [0, 1], outs[1] is empty, phi.args receives NONE (Value(u32::MAX)), and remove_trivial_phis panics indexing replaced[u32::MAX as usize].
  • Proposed Fix & Risk: - Fix: Filter unreachable predecessors out of block.preds (or prune unreachable blocks from the CFG / skip preds with rpo[p] == usize::MAX when inserting and populating phis) before SSA renaming and phi placement in ir.rs.
  • Regression Risk: Low; pruning unreachable predecessors from CFG edges and phi operand lists strictly restores SSA invariants without affecting reachable control flow. (Estimated size: S)

3. VIC-BT-003 — create_list() and create_list_x() ignore the pInitialState pipeline parameter, dropping initial draws/dispatches (P0)

  • Location: crates/victory-gpu/src/list.rs lines 160-230, 261-277
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for pInitialState, create_list pipeline, create_list_x pipeline, new_list pipeline).
  • Root Cause: In crates/victory-gpu/src/list.rs, both create_list() (line 165: _pipeline: This) and create_list_x() (line 187: _pipeline: This) discard the pInitialState parameter and call new_list(), which initializes state: Default::default() (line 227) with pipeline: null. By contrast, reset() (line 272) properly calls state.reset(pipeline) to bind the initial pipeline state. Per D3D12 specification, CreateCommandList opens the command list with pInitialState already bound (if non-null), just like Reset.
  • Edge-Case / Verification Note: Verified in draw.rs that State::default() sets pipeline to null and that draw/dispatch paths check pipeline::host_pipeline(self.pipeline) and drop the draw when pipeline is null. Also verified that pipeline::bound(pipeline) is not called on initial state during create_list/create_list_x.
  • Synthetic Reproducer: Call CreateCommandList(0, DIRECT, allocator, valid_pso, IID, &list), set root arguments/targets, and immediately call DrawInstanced or Dispatch without an intervening SetPipelineState. Because state.pipeline is null, the draw/dispatch is silently dropped.
  • Proposed Fix & Risk: - Fix: Pass pipeline into new_list(), call crate::pipeline::bound(pipeline) if non-null, and initialize state with state.reset(pipeline) (matching reset() at line 272).
  • Regression Risk: Low; brings CreateCommandList / CreateCommandListX into exact parity with Reset(). (Estimated size: S)

4. VIC-BT-004 — fits() rejects NULL-desc and DXGI_FORMAT_UNKNOWN SRV/UAVs on typed textures promoted to typeless by host_texture() (P0)

  • Location: crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/resource.rs lines descriptor/host.rs:599-611, 648-696; resource.rs:827-836
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for fits() rejecting view == 0 on typeless-promoted textures; #392 comment is about Host::rtv on B5G5R5A1/B4G4R4A4).
  • Root Cause: In crates/victory-gpu/src/resource.rs (lines 827-836), host_texture() promotes typed console textures to *_TYPELESS on the host in two common cases: (1) depth textures without DENY_SHADER_RESOURCE, and (2) sRGB textures with ALLOW_UNORDERED_ACCESS. On the console, the title's resource is still typed, so D3D12 allows the title to pass pDesc == NULL or pDesc->Format == DXGI_FORMAT_UNKNOWN (0) to CreateShaderResourceView / CreateUnorderedAccessView to inherit the resource's format. However, in descriptor/host.rs:599-611, fits() inspects the host texture's promoted typeless format (typeless == true) and sees view == 0, returning !typeless (false). make() then returns None and null_for() silently writes a null descriptor into the host heap.
  • Edge-Case / Verification Note: Checked descriptor.rs:220-235 (RtvRecord::host_desc) which explicitly calls crate::resource::view_format(self.resource) to recover the title's original typed format when creating NULL-desc RTVs/DSVs on typeless-promoted resources. descriptor/host.rs make()/fits() never performs that lookup for SRV/UAVs.
  • Synthetic Reproducer: Create a 2D texture with DXGI_FORMAT_R8G8B8A8_UNORM_SRGB (29) and ALLOW_UNORDERED_ACCESS (0x4): host_texture() creates it as DXGI_FORMAT_R8G8B8A8_TYPELESS (27). Call CreateShaderResourceView(tex, NULL, handle) or CreateUnorderedAccessView(tex, NULL, NULL, handle): fits() computes typeless=true, view=0, returns false, and the host heap receives a null view.
  • Proposed Fix & Risk: - Fix: When desc is None or desc.Format == DXGI_FORMAT_UNKNOWN (0) on a typeless-promoted host texture, resolve the title's original format via crate::resource::view_format(resource) (mapping sRGB to linear for UAVs and depth formats to their SRV format such as R32_FLOAT/R24_UNORM_X8_TYPELESS) and construct the explicit host view description before calling CreateShaderResourceView / CreateUnorderedAccessView.
  • Regression Risk: Low; matches the exact pattern already used by RtvRecord::host_desc and eliminates silent null-view substitution on valid D3D12 calls. (Estimated size: S)

5. VIC-BT-005 — lifecycle.rs: Missing RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification in api-ms-win-core-psm-appnotify-* (P0)

  • Location: crates/victory-hle/src/modules/lifecycle.rs lines 296-310
  • Prior-Work Check: Verified 0 hits across Marvisak_VIctory issues_and_prs.json, pulls.json, issue_comments.json, and review_comments.json for RegisterAppConstrainedChangeNotification / UnregisterAppConstrainedChangeNotification.
  • Root Cause: lifecycle::module() claims the wildcard DLL pattern 'api-ms-win-core-psm-appnotify-*' (lines 296-310) but only exports RegisterAppStateChangeNotification and UnregisterAppStateChangeNotification. The static PE32+ import table of game_scarlett_master.exe explicitly imports RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification from api-ms-win-core-psm-appnotify-l1-1-1.dll.
  • Edge-Case / Verification Note: On Windows desktop hosts, api-ms-win-core-psm-appnotify-l1-1-1.dll may not be present or may fail outside an AppContainer/UWP package; because VIctory intercepts api-ms-win-core-psm-appnotify-* via HLE, omitting these two exports leaves them unresolved or silently stubbed.
  • Synthetic Reproducer: Resolve RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification against the lifecycle HLE module for api-ms-win-core-psm-appnotify-l1-1-1.dll; lookup returns None.
  • Proposed Fix & Risk: - Fix: Export RegisterAppConstrainedChangeNotification(routine, context, registration) (storing/returning a non-null registration token and returning 0/ERROR_SUCCESS) and UnregisterAppConstrainedChangeNotification(registration) in lifecycle.rs, mirroring the existing AppStateChangeNotification implementation.
  • Regression Risk: Low; purely additive exports matching the Win32/Xbox PSM notification ABI. (Estimated size: S)

6. VIC-BT-006 — s_cmp_eq/lg_u32/u64 comparing two lane masks is lowered to per-lane equality instead of wave-wide uniform reduction (P0)

  • Location: crates/victory-shader/src/structure.rs lines 946-965
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (issues #434/#145/#131 address MaskData::Host wave32 ballot upper-half in lower.rs, not structure.rs scc_lane lowering two-mask s_cmp_eq/lg to per-lane !(a ^ b) / a ^ b).
  • Root Cause: In crates/victory-shader/src/structure.rs (lines 946-965), scc_lane() handles s_cmp_eq_u32, s_cmp_eq_u64, s_cmp_lg_u32, and s_cmp_lg_u64 when both operands are tracked lane masks (a, b) by returning !(a ^ b) for eq and (a ^ b) for lg as a per-lane Bool. On GFX10/RDNA2 hardware, s_cmp_eq_u32/u64 sets the uniform scalar condition code SCC = 1 iff ALL 32/64 bits of mask a equal mask b across the entire wave (i.e., WaveActiveAllTrue(a == b)), and s_cmp_lg sets SCC = 1 iff ANY bit differs (WaveActiveAnyTrue(a != b)). Lowering this to per-lane !(a ^ b) turns a uniform wave-wide branch (s_cbranch_scc0/1) into a divergent per-lane branch where lanes that happen to agree take one path while disagreeing lanes take the other.
  • Edge-Case / Verification Note: Verified whether scc_lane() is only called when comparing against 0 or -1: lines 946-965 explicitly match two arbitrary tracked masks (Some(a), Some(b)). Comparing against 0 (a == 0 -> all lanes false) is already handled separately as uniform via ballot/SCC, whereas two non-zero masks (such as vcc vs exec in WaveActiveAllTrue) hit the per-lane XNOR/XOR branch and silently diverge.
  • Synthetic Reproducer: In a compute shader, compute a per-lane predicate into vcc (true on lane 0, false on lane 1), execute s_cmp_eq_u32 vcc, exec followed by s_cbranch_scc0 skip, and write a sentinel value. Hardware sets SCC=0 for the entire wave so all lanes skip; VIctory lowers SCC to per-lane !(vcc ^ exec), so lane 0 executes the body while lane 1 skips.
  • Proposed Fix & Risk: - Fix: Do not lower two-mask s_cmp_eq/lg_u32/u64 to a per-lane Bool in scc_lane(). Leave SCC as a uniform scalar comparison (Atom::Uniform) evaluated via wave-wide ballot equality in lower.rs (or emit WaveActiveAllTrue(a == b) / WaveActiveAnyTrue(a != b)).
  • Regression Risk: Medium; shaders using s_cmp_eq/lg on two masks will require wave-ops ballot/reduction support in lower.rs, which is already implemented for compute/graphics via waveActiveBallot. (Estimated size: M)

7. VIC-BT-007 — Critical-edge map overwrites first edge block when LaneExit::Branch has taken == not_taken, emitting invalid DXIL PHIs (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 6793, 6866-6881, 6903-6906
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for self.edges.insert, taken == not_taken, duplicate phi edge).
  • Root Cause: In crates/victory-shader/src/emit/lower.rs, exit() (line 6793) handles LaneExit::Branch { when, taken, not_taken } by calling self.edge(b, taken) and self.edge(b, not_taken) and emitting Term::CondBr(cond, e1, e2). Inside edge() (lines 6866-6881), each call allocates a new DXIL edge block e and executes self.edges.insert((from, to), e). When taken == not_taken, both calls share the exact same map key (b, taken), so the second insert overwrites e1 with e2. Later, fill_phis() (lines 6903-6906) looks up self.edges.get(&(q, b)) for each predecessor, emitting duplicate incoming entries for e2 and zero entries for e1, even though the DXIL CFG has CondBr(cond, e1, e2) with both e1 and e2 branching to the merge block.
  • Edge-Case / Verification Note: Checked whether structure.rs guarantees taken != not_taken on all LaneExit::Branch exits: structure.rs constructs LaneExit::Branch from conditional branches and loop-exit rewrites where degenerate or folded targets can point to the same block, and ir.rs preserves duplicate edges in block.preds. Moreover, even a single unconditional branch optimization in exit() when taken == not_taken is absent.
  • Synthetic Reproducer: Emit a shader where a conditional branch has both taken and not_taken pointing to the same join block B with a live register phi (e.g., s_cbranch_scc1 +0 / folded branch). lower.rs emits CondBr(cond, e1, e2) where both e1 and e2 jump to B, while fill_phis populates B's phi with (val, e2) and omits e1, failing DXIL validation ('PHI node entries do not match predecessors').
  • Proposed Fix & Risk: - Fix: In exit() (lower.rs:6793), collapse LaneExit::Branch { taken, not_taken, .. } when taken == not_taken into a single unconditional edge self.edge(b, taken) and Term::Br(e), or key self.edges by (from, to, branch_arm) when both arms must be preserved.
  • Regression Risk: Low; collapsing identical branch targets to an unconditional branch is semantically identical and simplifies the emitted DXIL CFG. (Estimated size: S)

8. VIC-BT-008 — DPP16/DPP8 ignores fi (fetch-inactive) and source-lane EXEC activity for bound_ctrl (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 3626-3727
  • Prior-Work Check: Searched all 3,661 VIctory records for bound_ctrl, fetch-inactive, dpp8, dpp16, and fi in lower.rs (0 hits).
  • Root Cause: Measured across 14,412 hardware oracle cases on RDNA2 gfx1031 (ProjectLeonidaL/leonida design.md:266, crosslane_fuzz.py --dpp-sweep --oracle hw), DPP16/DPP8 must check whether the source lane is active (EXEC[src]) in addition to row/bank bounds: when fi == 0 and the source lane is inactive, bound_ctrl == 1 returns 0 and bound_ctrl == 0 disables writing the destination VGPR (preserving old vdst). lower.rs:3626-3727 never reads the fi bit for DPP16 or DPP8 and never checks EXEC[src], unconditionally reading stale/undefined VGPR values from inactive lanes.
  • Edge-Case / Verification Note: Alternative hypothesis: shaders might only use DPP under full-wave EXEC masks. Falsification: divergent fragment quads and subgroup reductions routinely run DPP16 (row_shr, quad_perm, row_bcast) and DPP8 under partial EXEC; any inactive neighbor returns stale garbage instead of 0 or preserving vdst.
  • Synthetic Reproducer: Wave32 compute shader: v_mov_b32 v0, 0x12345678; v_mov_b32 v1, 0xAAAA5555; s_mov_b32 exec_lo, 0x55555555; v_add_u32_dpp v1, v0, v0 row_shr:1 bound_ctrl:1 fi:0. On RDNA2 hardware, active lane 2 reads inactive lane 1 as 0 (v1 = v0 + 0); VIctory reads 0x12345678 from inactive lane 1.
  • Proposed Fix & Risk: - Fix: Decode the fi bit for both DPP16 and DPP8; compute the active-lane mask via waveActiveBallot(true) (or tracked EXEC), treat (!in_bounds || (!fi && !src_active)) as out-of-bounds, and apply bound_ctrl (0 when bound_ctrl == 1, preserve old vdst when bound_ctrl == 0).
  • Regression Risk: Low-medium; adds one ballot + bit-test per DPP instruction and preserves vdst when bound_ctrl == 0. (Estimated size: M)

9. VIC-BT-009 — Immediate sampler used non-comparison first then comparison later emits mismatched annotateHandle vs dx.resources metadata (P1)

  • Location: crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/shader.rs lines lower.rs:3325-3343; shader.rs:241-264, 405-431
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for cmp_samplers or sampler_handle).
  • Root Cause: In lower.rs:3337-3342, when a static sampler at index n is used with a comparison instruction (props.0 & 0x8000 != 0), it sets self.s.cmp_samplers |= 1 << n and calls self.s.sampler_handle(self.cur, n). In shader.rs:258-263, sampler_handle() immediately emits dx.op.annotateHandle with properties 14 | cmp based on the CURRENT value of self.cmp_samplers. If sampler n was first used by a non-comparison sample, that earlier annotateHandle was emitted with properties 14 (non-comparison SamplerState). When a later comparison sample sets bit n in self.cmp_samplers, Shader::finish() (shader.rs:411-420) declares sampler n in dx.resources as kind = 1 (SamplerComparisonState). The earlier annotateHandle(14) now contradicts dx.resources (kind = 1), which DXIL validation rejects.
  • Edge-Case / Verification Note: Checked whether lower.rs pre-scans for comparison sampler uses before lowering instructions: it does not; self.samplers and self.s.cmp_samplers are populated lazily during instruction lowering. Also note that if n >= 64, 1u64 << n overflows.
  • Synthetic Reproducer: Translate a shader with one immediate sampler constant (Source::Constant) used first by image_sample and second by image_sample_c. Inspect the emitted DXIL: the first annotateHandle has ResourceProperties {14, 0}, the second has {0x800E, 0}, and dx.resources declares s0 with SamplerKind=1 (Comparison).
  • Proposed Fix & Risk: - Fix: Allocate distinct static sampler slots for (words, is_comparison) pairs (which also eliminates the shortcut comment at lower.rs:3338-3339 and matches D3D12's requirement that comparison and non-comparison samples use matching sampler bindings), or patch earlier annotateHandle constants in Shader::finish() as fix_user_data_size() does.
  • Regression Risk: Low; separating (words, is_comparison) into distinct static sampler slots is cleaner, DXIL-valid, and bounded by the small number of immediate samplers per shader. (Estimated size: S)

10. VIC-BT-010 — Integer VOP3 clamp (unsigned saturation) silently ignored on carry-out and non-carry add/sub ops (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 4172-4204, 4894-4907, 4953
  • Prior-Work Check: Searched all 3,661 VIctory records for v_add_co_u32 clamp, v_add_nc_u32 clamp, add_sub_carry (0 hits).
  • Root Cause: None of v_add_co_u32, v_sub_co_u32, v_subrev_co_u32, *_ci_u32, v_add_nc_u32, v_sub_nc_u32, v_subrev_nc_u32, or v_add3_u32 inspect v.clamp. Measured on RDNA2 gfx1035 silicon (Leonida/tools/int_hw_probe.py), VOP3 clamp saturates unsigned overflow to 0xFFFF_FFFF and underflow to 0 while keeping the true carry/borrow out in sdst.
  • Edge-Case / Verification Note: Alternative hypothesis: DXC-compiled console shaders rarely emit integer clamp. Falsification: synthetic VOP3 v_add_co_u32 ... clamp test.
  • Synthetic Reproducer: v_add_co_u32 v0, vcc_lo, 0xFFFFFFF0, 0x20 clamp -> expected v0 = 0xFFFF_FFFF, vcc_lo = 1; currently wraps to v0 = 0x10.
  • Proposed Fix & Risk: - Fix: When v.clamp is true, saturate r using the carry/borrow bit (select(carry, 0xFFFF_FFFF, r) for add, select(borrow, 0, r) for sub; widen to i64 for v_add3_u32).
  • Regression Risk: Low; gated strictly on v.clamp. (Estimated size: S)

11. VIC-BT-011 — Pixel shader export discards on !guard of DONE instead of tracking last exp VM (Valid Mask) and per-MRT color masks (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 6496-6506
  • Prior-Work Check: Searched all 3,661 VIctory records for valid mask, exp vm, e.done, and discard in lower.rs:6496 (0 hits).
  • Root Cause: Measured across 18 pixel shader programs on RDNA2 gfx1036 (ProjectLeonidaL/leonida design.md:267, ps_oracle.py), pixel survival is governed by the EXEC mask of the last exp with VM=1 (Valid Mask), MRT color exports are per-MRT last-write masked, and exp null done vm under partial EXEC kills only inactive lanes while keeping active lanes alive if a prior color export wrote them. lower.rs:6496-6506 ignores e.vm, discards solely on !guard of e.done, and rejects conditional non-done exports.
  • Edge-Case / Verification Note: Alternative hypothesis: simple pixel shaders have a single exp mrt0 ... done vm at shader exit where done and vm coincide. Falsification: multi-MRT shaders with early-out exp null ... done vm or separate exp mrt0 + exp mrtz ... done vm (alpha-to-coverage, depth-only discard, G-buffer deferred shaders) decouple VM, DONE, and per-MRT masks.
  • Synthetic Reproducer: Pixel shader exporting exp mrt0 ... under full EXEC, then narrowing EXEC to half the quad and running exp mrt1 ... done vm (or exp null ... done vm). Hardware uses the last VM=1 export's EXEC mask for pixel survival and preserves MRT0 for surviving pixels; VIctory mis-discards or rejects the conditional non-done export.
  • Proposed Fix & Risk: - Fix: Track a per-lane vm_live boolean updated on every exp with vm == 1 (overwriting with current EXEC), emit discard at shader exit based on !vm_live, and allow conditional non-done MRT exports by latching per-MRT output variables under EXEC.
  • Regression Risk: Medium; requires routing pixel shader discard through a unified exit block after all exports. (Estimated size: M)

12. VIC-BT-012 — RtvRecord::desc() and depth_desc() hardcode TEXTURE_2D for NULL-desc RTV/DSVs, breaking MSAA, 2DArray, 3D, and 1D targets (P1)

  • Location: crates/victory-gpu/src/descriptor.rs lines 197-238
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for RtvRecord/host_desc/depth_desc hardcoding TEXTURE_2D; #796/#450/#16/#55 are about null RTV handles in OMSetRenderTargets).
  • Root Cause: In crates/victory-gpu/src/descriptor.rs (lines 197-238), when a title passes pDesc == NULL to CreateRenderTargetView or CreateDepthStencilView (self.described == 0), RtvRecord::desc() and depth_desc() call host_desc(TEXTURE_2D) with a hardcoded dimension (4 for RTV_DIMENSION_TEXTURE2D, 3 for DSV_DIMENSION_TEXTURE2D) and zeroed union fields. Whenever crate::resource::view_format() returns Some(fmt) (e.g., for typeless-promoted depth or sRGB+UAV textures), host_desc() emits a TEXTURE2D view description regardless of the underlying resource's actual dimension, sample count, or array size. D3D12 rejects TEXTURE2D views on MSAA textures (requires TEXTURE2DMS), 1D/3D textures, and 2D array textures.
  • Edge-Case / Verification Note: Verified in descriptor.rs:220-237 that host_desc() only queries crate::resource::view_format(self.resource) and never queries the resource's ResourceDesc (dimension, depth_or_array, samples). In D3D12, NULL-desc RTV/DSV is the standard way titles bind MSAA render targets and cascaded shadow map arrays.
  • Synthetic Reproducer: Create a 4x MSAA depth texture (D32_FLOAT, SampleDesc.Count=4, without DENY_SHADER_RESOURCE so host_texture promotes it to R32_TYPELESS), then call CreateDepthStencilView(tex, NULL, handle) and ClearDepthStencilView(handle, ...). RtvRecord::depth_desc() emits D3D12_DSV_DIMENSION_TEXTURE2D (3) instead of D3D12_DSV_DIMENSION_TEXTURE2DMS (5), causing D3D12 to reject the DSV.
  • Proposed Fix & Risk: - Fix: Query the title ResourceDesc (dimension, depth_or_array, samples) in RtvRecord::host_desc() and select the matching D3D12_RTV_DIMENSION / D3D12_DSV_DIMENSION (1D, 1DArray, 2D, 2DArray, 2DMS, 2DMSArray, 3D) with ArraySize/WSize set to depth_or_array.
  • Regression Risk: Low; strictly aligns NULL-desc RTV/DSV synthesis with the D3D12 specification. (Estimated size: S)

13. VIC-BT-013 — State::prepare() compares raw title heap pointers (host_heaps != heaps), creating an ABA bug on heap release and reallocation (P1)

  • Location: crates/victory-gpu/src/draw.rs lines 422-435, 450
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for host_heaps ABA / as_raw; #59 comment is about resetting host_heaps after ExecuteIndirect).
  • Root Cause: In crates/victory-gpu/src/draw.rs (lines 422-435), State caches self.host_heaps: [This; 2] (raw pointers to title Heap objects) and only calls list.list.SetDescriptorHeaps(&bound) when self.host_heaps != self.heaps. Notice that for pipelines right below (line 450), State specifically avoids this ABA hazard by comparing the underlying host COM pointer (host.pso.as_raw()). For descriptor heaps, however, if a title destroys a heap and creates a replacement heap that the Rust allocator places at the same This address, self.host_heaps == self.heaps evaluates true even though the underlying host ID3D12DescriptorHeap COM object is completely different, so SetDescriptorHeaps is skipped.
  • Edge-Case / Verification Note: Verified in draw.rs:422-455 that self.host_heaps stores [This; 2] (the title COM pointer) rather than [*mut c_void; 2] (the host ID3D12DescriptorHeap::as_raw() pointers). Even within a single command list (or across dynamic heap recreation between draws), ABA on Box<Heap> reuse silently skips binding the new host descriptor heap.
  • Synthetic Reproducer: Bind shader-visible heap H1 on a command list and draw; release H1 and create H2 (same size/type, allocated at H1's freed address); call SetDescriptorHeaps([H2]) and draw. self.host_heaps == self.heaps is true, so the host command list never calls SetDescriptorHeaps with H2's host ID3D12DescriptorHeap.
  • Proposed Fix & Risk: - Fix: Store [usize; 2] of the host ID3D12DescriptorHeap::as_raw() as usize pointers in self.host_heaps (matching self.host_pipeline at line 450) and compare against the resolved host heap COM pointers before skipping SetDescriptorHeaps.
  • Regression Risk: Low; trivial comparison change that eliminates pointer-reuse ABA on descriptor heaps. (Estimated size: S)

14. VIC-BT-014 — Thick 3D mip-tail predicate omits mip_depth(i) <= fixed[2] (P1)

  • Location: crates/victory-formats/src/texture.rs lines 406-412
  • Prior-Work Check: Searched all 3,661 VIctory records for first_tail_mip, fixed[2], tail_max[2], mip_depth (0 hits).
  • Root Cause: Lines 377-382 compute thick 3D tail_max (including halving tail_max[2] when block_log2 % 3 == 2), but line 408 checks only w <= fixed[0] && h <= fixed[1] && d.mips - i <= max_in_tail, omitting mip_depth(i) <= fixed[2]. Deep narrow 3D textures (e.g. 16x16x64) falsely enter the 1-block mip tail at mip 0.
  • Edge-Case / Verification Note: Alternative hypothesis: game volume textures might all be wider than fixed[0] when deep. Falsification: unit test with 16x16x64, 4 mips, Sw64KbS immediately fails Layout::new invariant (offset overlaps / tail overflow).
  • Synthetic Reproducer: Unit test in victory-formats/src/texture.rs: Desc { dimension: Tex3d, width: 16, height: 16, depth: 64, mips: 4, element_bytes: 4, swizzle: Sw64KbS } -> mip 0 has tail.is_some() despite 64 slices > block depth.
  • Proposed Fix & Risk: - Fix: Change line 408 to if w <= fixed[0] && h <= fixed[1] && (!thick || mip_depth(i) <= fixed[2]) && d.mips - i <= max_in_tail.
  • Regression Risk: Very low; strictly corrects thick 3D mip-tail boundary per AMD addrlib. (Estimated size: XS)

15. VIC-BT-015 — buffer_load_format_d16_x/xyz zeroes high 16 bits of destination VGPR and converts integer formats via legacyF32ToF16 (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 6454-6475
  • Prior-Work Check: Searched all 3,661 VIctory records for buffer_load_format_d16. PR #169 only added tbuffer_load_format_d16_* packing and still zeroes odd-channel high halves; 0 hits for buffer_load_format_d16_x/xyz high-half preservation or integer format handling at lower.rs:6454-6475.
  • Root Cause: Measured on RDNA2 gfx1031 silicon (ProjectLeonidaL/leonida shader_validation.md:1642,1658-1665, d16_format_probe.py), buffer_load_format_d16_x and buffer_load_format_d16_xyz preserve vdst[31:16] on the odd trailing VGPR, and integer buffer formats (UINT/SINT) saturate to 16-bit integer rather than converting as float. lower.rs:6454-6475 unconditionally runs legacyF32ToF16 on every channel (corrupting UINT/SINT formats) and writes the odd trailing channel directly to vdst with vdst[31:16] = 0.
  • Edge-Case / Verification Note: Alternative hypothesis: register allocation might not keep live values in the high 16 bits of vdst before buffer_load_format_d16_x. Falsification: RDNA2 16-bit register packing routinely allocates two independent 16-bit values to the low and high halves of one VGPR, and d16_format_probe.py confirms hardware preserves the high half.
  • Synthetic Reproducer: Pre-load v0 = 0xDEAD_0000, execute buffer_load_format_d16_x v0, v1, s[0:3], 0 idxen on a 32_UINT buffer containing 70000. Hardware produces v0 = 0xDEAD_FFFF (high half preserved, integer saturated to 0xFFFF); VIctory produces 0x0000_7C00 (high half zeroed, float-converted to +inf).
  • Proposed Fix & Risk: - Fix: Merge the odd trailing channel with (old_vdst & 0xFFFF_0000) | (lo & 0xFFFF) via low_half(), and branch on the descriptor numeric format so UINT/SINT saturate to [0, 65535]/[-32768, 32767] instead of calling legacyF32ToF16.
  • Regression Risk: Low; matches d16_format_probe.py hardware behavior. (Estimated size: S)

16. VIC-BT-016 — create_cbv() silently ignores NULL desc instead of writing a null CBV descriptor, leaving stale views active (P1)

  • Location: crates/victory-gpu/src/descriptor.rs lines 432-438
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for create_cbv null or CreateConstantBufferView null).
  • Root Cause: In crates/victory-gpu/src/descriptor.rs (lines 433-438), create_cbv() wraps record() inside if let Some([lo, hi, size, _]) = words(desc). Under D3D12, passing pDesc == NULL to ID3D12Device::CreateConstantBufferView is explicitly valid and initializes a null CBV descriptor (BufferLocation = 0, SizeInBytes = 0) that returns 0 on all reads. Because create_cbv() returns early when desc is null, neither the title slot nor the mirrored host descriptor heap slot is updated, leaving whatever View (and host descriptor) previously occupied that slot intact.
  • Edge-Case / Verification Note: Verified in descriptor/host.rs:781-785 that View::Constant(0, 0) is already handled cleanly (shadow::find(0, 0) returns None -> null_for() calls CreateConstantBufferView with a zeroed D3D12_CONSTANT_BUFFER_VIEW_DESC). By contrast, create_srv() and create_uav() always call record() even when desc is null.
  • Synthetic Reproducer: Write a valid CBV or SRV to shader-visible heap slot 0, then call CreateConstantBufferView(NULL, slot0). Call descriptor::view(slot0): it still returns the previous CBV/SRV instead of View::Constant(0, 0), and the host heap still points to the previous resource.
  • Proposed Fix & Risk: - Fix: In create_cbv() (descriptor.rs:433-438), when words(desc) is None, call record(handle, View::Constant(0, 0)) so the slot is overwritten and mirrored as a null CBV on the host heap.
  • Regression Risk: Low; one-line change that matches D3D12 semantics and reuses the existing null_for(View::Constant) path. (Estimated size: S)

17. VIC-BT-017 — d16 image_load corrupts 32-bit integer texels and zeros high 16 bits on odd-channel loads (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 6082-6110, 6329-6346
  • Prior-Work Check: Searched all 3,661 VIctory records for d16 integer / high half. PR #169 covers tbuffer_load_format_d16 packing; PR #632/#571 cover LDS d16; none fix image_load d16 integer saturation or odd-channel high-half preservation.
  • Root Cause: Verified on RDNA2 gfx1036 (Leonida/tools/image_d16_probe.py): (1) image_load d16 of 32-bit UINT/SINT texels saturates to [0, 65535] / [-32768, 32767], whereas line 6088 unconditionally runs legacyF32ToF16; (2) odd-channel d16 loads preserve the upper 16 bits of the destination VGPR, whereas lines 6094-6109 write p[0] directly with high 16 bits zeroed.
  • Edge-Case / Verification Note: Alternative hypothesis: destination high half is dead after 1-channel d16 load. Falsification: packed f16/u16 register allocation routinely keeps live data in the upper 16 bits.
  • Synthetic Reproducer: Pre-load v0 = 0x5A5A_0000, run image_load v0, v[1:2], s[0:7] dmask:0x1 d16. Expected v0[31:16] == 0x5A5A; observed 0x0000.
  • Proposed Fix & Risk: - Fix: Merge odd trailing channel with (old & 0xFFFF_0000) | (lo & 0xFFFF) via low_half(), and use integer textureLoad.i32 + 16-bit saturation when descriptor numeric format is UINT/SINT.
  • Regression Risk: Low; requires reading old VGPR value for odd trailing channel (already supported via low_half). (Estimated size: M)

18. VIC-BT-018 — ds_swizzle_b32 reads undefined/stale VGPRs from inactive source lanes instead of returning 0 (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 2088-2128, 2009-2040
  • Prior-Work Check: Searched all 3,661 VIctory records for ds_swizzle_b32, quad_pick, read_lane. PR #606 covers rotate/FFT modes (0xC000+); PR #189/#192 cover Wave32/64 lane indexing; none mask inactive source lanes to 0.
  • Root Cause: On RDNA2, ds_swizzle_b32 returns 0 when the source lane src is inactive (EXEC[src] == 0). VIctory emits bare waveReadLaneAt.i32 / quadReadLaneAt.i32 without checking whether src is active. In DXIL, reading an inactive lane is undefined behavior and returns stale VGPR values on NVIDIA/AMD/Intel.
  • Edge-Case / Verification Note: Alternative hypothesis: shaders might only call ds_swizzle_b32 under uniform full-wave EXEC. Falsification: divergent compute/pixel quad reductions execute with partial EXEC masks; synthetic test with EXEC = 0x55555555 and v0 = 0xDEADBEEF proves stale reads.
  • Synthetic Reproducer: Wave32 kernel: set v0 = 0xDEADBEEF, mask EXEC = 0x55555555, execute ds_swizzle_b32 v1, v0 offset:swizzle(SWAP,1). Expected v1 == 0 on active even lanes; observed stale/undefined bits.
  • Proposed Fix & Risk: - Fix: Compute active-lane ballot (waveActiveBallot(true) or tracked EXEC mask), test bit src, and select(src_active, read_val, 0) before writing dst_reg.
  • Regression Risk: Low; adds 1 ballot + bit-test + select per ds_swizzle_b32. (Estimated size: S)

19. VIC-BT-019 — format_load (tbuffer_load_format_*) drops high byte on unaligned 16-bit dword-straddling loads, fills missing channels with (0,0,0,1) instead of 0, and quiets f16 sNaNs (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 3156-3166, 3219-3241
  • Prior-Work Check: Searched all 3,661 VIctory records for format_load, tbuffer_load_format, legacyF16ToF32 NaN, and dword-straddling 16-bit load (0 hits).
  • Root Cause: Cross-auditing lower.rs:3156-3166, 3219-3241 against measured RDNA2 hardware contracts (ProjectLeonidaL/leonida buffer_formats.md:50-52, shader_validation.md:1671-1711 f16_widen_probe.py, design.md:278,344) reveals three distinct bugs: (1) 16-bit element loads at off & 3 == 3 shift a single 32-bit dword right by 24 bits without fetching the next dword, silently zeroing the high byte; (2) missing channels beyond the format's channel count return (0, 0, 0, 1) instead of 0 (before DST_SEL swizzling; DST_SEL supplies 1 only when explicitly set to SEL_1); (3) 16_FLOAT/10_11_11_FLOAT/11_11_10_FLOAT widening uses legacyF16ToF32, which quiets signaling NaNs and canonicalizes payloads instead of preserving unquieted sign | 0x7F800000 | (payload << 13).
  • Edge-Case / Verification Note: Alternative hypothesis: vertex/typed buffers are mostly 4-byte aligned and rarely carry sNaN payloads. Falsification: packed 3-byte or byte-offset vertex streams hit off & 3 == 3, and 1/2/3-channel formats with DST_SEL_W = SEL_W expose the (0,0,0,1) vs 0 bug immediately.
  • Synthetic Reproducer: (1) tbuffer_load_format_x of 16_UINT at byte offset 3 from [0x00, 0x00, 0x00, 0x34, 0x12] -> hardware reads 0x1234, VIctory reads 0x0034. (2) tbuffer_load_format_xyzw of 32_UINT with DST_SEL = XYZW -> hardware returns (x, 0, 0, 0), VIctory returns (x, 0, 0, 1) in W. (3) 16_FLOAT value 0x7C01 (sNaN) -> hardware widens to 0x7F802000, legacyF16ToF32 quiets bit 22 to 0x7FC02000.
  • Proposed Fix & Risk: - Fix: Fetch (lo >> 24) | (hi << 8) when off & 3 == 3 for 16-bit elements; zero-fill absent raw channels before applying DST_SEL; preserve raw f16 NaN sign and payload bits on NaN widening.
  • Regression Risk: Low; localized to format_load helper. (Estimated size: S)

20. VIC-BT-020 — gameinput.rs: IGameInput/IGameInputDevice/IGameInputReading QueryInterface unconditionally returns E_NOINTERFACE without supporting IID_IUnknown or clearing *out (P1)

  • Location: crates/victory-hle/src/modules/gameinput.rs lines 576-579
  • Prior-Work Check: Verified 0 hits across Marvisak_VIctory issues_and_prs.json, pulls.json, issue_comments.json, and review_comments.json for no_interface / gameinput QueryInterface.
  • Root Cause: no_interface() at gameinput.rs:576-579 is wired as slot 0 (QueryInterface) for all three GameInput COM vtables (IGameInput, IGameInputDevice, IGameInputReading). It ignores riid and out completely and unconditionally returns E_NOINTERFACE without checking IID_IUnknown or the object's own IID, and without setting *out = null on failure as required by the COM IUnknown::QueryInterface specification.
  • Edge-Case / Verification Note: While titles that directly use the pointer returned by GameInputCreate without calling QueryInterface are unaffected, C++ smart pointers (Microsoft::WRL::ComPtr, winrt::com_ptr) and engine wrappers routinely QI for IID_IUnknown (for COM identity comparison) or versioned IGameInput IIDs.
  • Synthetic Reproducer: Call IGameInput::QueryInterface(this, &IID_IUnknown, &out) with out initialized to a non-null sentinel; returns E_NOINTERFACE and leaves out unchanged instead of returning S_OK with AddRef'd this.
  • Proposed Fix & Risk: - Fix: Implement per-object QueryInterface functions that validate out (returning E_POINTER if null), write *out = null on error, and return S_OK with AddRef when *riid matches IID_IUnknown or the object's own interface IID.
  • Regression Risk: Low; aligns GameInput COM objects with standard COM identity and refcounting rules. (Estimated size: S)

21. VIC-BT-021 — half_src reads inline float constants as f16 bits instead of f32 bits for 16-bit integer instructions (P1)

  • Location: crates/victory-shader/src/emit/lower.rs lines 4315-4342, 4556-4567, 4629-4670, 5387-5399
  • Prior-Work Check: Searched all 3,661 VIctory records for half_src, f16_operand, and inline float constants on 16-bit integer ops (0 hits; PR #78 only covered v_fma_mix).
  • Root Cause: Measured on RDNA2 silicon (ProjectLeonidaL/leonida shader_validation.md:2053, Kajcsi/G6Recomp docs/shaders.md:805-808), inline float constants (240..=248, e.g. 0.5, 1.0, 2.0, 4.0) only decode to 16-bit f16 bit patterns (0x3C00 for 1.0) when the instruction's source operand type is F16; for 16-bit integer instructions (v_cvt_f16_u16, v_cvt_f16_i16, v_add_nc_u16, v_sub_nc_u16, v_mul_lo_u16, v_lshlrev/lshrrev/ashrrev_*16, v_min/max_u16/i16, v_cmp_*_u16/i16), hardware decodes them as 32-bit F32 bits (0x3F800000, so low 16 bits = 0x0000 and high 16 bits = 0x3F80). lower.rs:4315-4342 unconditionally calls f16_operand inside half_src for all 16-bit ops regardless of whether the operand is float or integer.
  • Edge-Case / Verification Note: Alternative hypothesis: DXC might rarely encode inline float constants 240..=248 as operands to 16-bit integer ops. Falsification: LLVM/DXC frequently exploits op_sel + inline 1.0/2.0/4.0 constants as compact encodings for 0x3F80, 0x4000, 0x4080 bit masks or constants in 16-bit integer ops to avoid a 32-bit literal dword.
  • Synthetic Reproducer: Assemble v_add_nc_u16 v0, 1.0, v1 (operand code 242, op_sel:[0,0], v1 = 5). Hardware decodes 1.0 as 0x3F800000 -> low half 0x0000, yielding v0 = 5; VIctory decodes 1.0 via f16_operand as 0x3C00, yielding v0 = 0x3C05.
  • Proposed Fix & Risk: - Fix: Split half_src into half_src_f16 (using f16_operand) and half_src_i16 (using 32-bit s() + 16-bit op_sel extraction), and route all 16-bit integer operands (u16/i16/b16) through half_src_i16.
  • Regression Risk: Low; clean separation between f16 and i16/u16/b16 operand decoding. (Estimated size: S)

22. VIC-BT-022 — host_texture() passes non-null pOptimizedClearValue without ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL flags (P1)

  • Location: crates/victory-gpu/src/resource.rs lines 815-864
  • Prior-Work Check: 0% overlap across Marvisak_VIctory (0 hits for clear_value without ALLOW_RENDER_TARGET/ALLOW_DEPTH_STENCIL; #735 comment only discusses clearing unsupported flag combinations).
  • Root Cause: In crates/victory-gpu/src/resource.rs (lines 839-864), host_texture() unconditionally constructs clear_value whenever the title's clear pointer is non-null and forwards it to host.device.CreateCommittedResource(..., clear_value.as_ref()...). Under PC D3D12, passing a non-null pOptimizedClearValue when Desc.Flags has neither D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET (0x1) nor D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL (0x2) — or when Desc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER — is strictly illegal and fails with E_INVALIDARG. Xbox/console D3D12.X titles can pass non-null clear values on resources whose console-specific flags are masked off by d.flags &= PC_FLAGS at line 815.
  • Edge-Case / Verification Note: Verified lines 815-864 in resource.rs: d.flags is masked with PC_FLAGS and DEPTH/UNORDERED adjusted, but clear_value is never gated on d.flags & (0x1 | 0x2) != 0 before calling CreateCommittedResource.
  • Synthetic Reproducer: Call CreateCommittedResource with a 2D texture desc having Flags = 0 (or Flags = ALLOW_UNORDERED_ACCESS) and a non-null pOptimizedClearValue: host_texture() forwards the non-null clear_value to PC D3D12 CreateCommittedResource, which returns E_INVALIDARG and logs 'no host texture'.
  • Proposed Fix & Risk: - Fix: Gate clear_value on !clear.is_null() && d.dimension != BUFFER && (d.flags & (0x1 | 0x2)) != 0 in host_texture() (resource.rs:839).
  • Regression Risk: Low; strictly satisfies D3D12's CreateCommittedResource contract without affecting valid RT/DS clear values. (Estimated size: S)

23. VIC-BT-023 — net.rs: getaddrinfo / GetAddrInfoW / GetAddrInfoEx{A,W} fail with WSAHOST_NOT_FOUND without setting *result = NULL (P1)

  • Location: crates/victory-hle/src/modules/net.rs lines 540-606
  • Prior-Work Check: Verified 0 hits across Marvisak_VIctory corpus for getaddrinfo *result / WSAHOST_NOT_FOUND null.
  • Root Cause: In net.rs:540-606, when resolvable() rejects a hostname, getaddrinfo, GetAddrInfoW, GetAddrInfoExA, and GetAddrInfoExW immediately return WSAHOST_NOT_FOUND without writing null to the out-pointer (*result = std::ptr::null_mut()). Windows Winsock guarantees *ppResult is set to NULL on failure.
  • Edge-Case / Verification Note: Callers that zero-initialize addrinfo* res = nullptr; before calling getaddrinfo do not crash, but C/C++ code relying on the documented Win32 Outptr_result_maybenull guarantee (including common HTTP/TLS libraries) leaves res uninitialized.
  • Synthetic Reproducer: Initialize let mut res = 0xDEAD_BEEF as *mut c_void; and call getaddrinfo(c"example.com", null, null, &mut res); returns WSAHOST_NOT_FOUND while res remains 0xDEAD_BEEF.
  • Proposed Fix & Risk: - Fix: Write if !result.is_null() { unsafe { *result = std::ptr::null_mut(); } } before returning WSAHOST_NOT_FOUND in all four resolver hooks.
  • Regression Risk: Low; strictly improves Win32 Winsock ABI conformance. (Estimated size: S)

Continue Series: Part 1/2 (this issue) | Part 2/2: https://github.com/Marvisak/VIctory/issues/1249

**@⁠hyperland956-lgtm** on GitHub · 2026-11-24 16:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242) > **Multi-Part Series (1/2):** **Part 1/2 (this issue)** | Part 2/2: `https://github.com/Marvisak/VIctory/issues/1249` # Tracking & Static Audit: 45 New Source-Level Bugs (Shader IR/ISA, GPU Runtime, Tiling, HLE) + 150 Prioritized Backlog Items > **Tracking & Audit Issue:** This tracking issue groups **45 newly identified, non-duplicate source-level findings** alongside a prioritized index of **150 existing canonical open issues/PRs** (**195 total work items**) to help contributors pick up high-impact, separable fixes without opening duplicates. > > **Scope, Testing & Policy Disclosure:** AI-assisted static code audit (prepared with Gemini). All findings are strictly source-level and synthetic (zero proprietary game bytes, disassembly, extracted shaders, or screenshots). Algorithmic/numeric reproducers (thick 3D mip-tail depth, `f16` single-rounding ties, `v_mad_f16` vs `v_fma_f16`, MUBUF `OOB_SELECT=3` `SOFFSET`, physical-page double-free counter, `FMT_INFO` clamping, and singular BVH inverse) were verified via Python reference checks on Linux; `cargo test` on Windows MSVC / D3D12 GPU has not yet been run on these fixes. - **Repository:** `https://github.com/Marvisak/VIctory` - **Audited Revision:** `d2a4bae (main, 2026-11-24)` - **Date:** `2026-11-24` ## 1. Highest-Impact Active Bottlenecks (Existing Canonical Issues/PRs — Do Not Duplicate) 1. **Untranslated World Compute/Mesh Shaders & Dark World Scene** — Tracked in [`#752`](https://git.gtahub.st/github/Marvisak--VIctory/issues/752) (533 of 2,679 shaders untranslated in reported Linux/RDNA4 run; world mostly black). 2. **Unbound / Placed Texture UAV Faults & Device Removal** — Tracked in [`#508`](https://git.gtahub.st/github/Marvisak--VIctory/issues/508) (prior PR `#552` closed unmerged — still unresolved on `main`). 3. **Indirect Argument Clamping & Async Host Fence Timeline** — Active open PRs [`#583`](https://git.gtahub.st/github/Marvisak--VIctory/pulls/583) (indirect count buffer & u32 budget wrap) and [`#595`](https://git.gtahub.st/github/Marvisak--VIctory/pulls/595) (async fence timeline & `CopyMemoryToMemoryX` ordering). 4. **Wave32 / Wave64 Cross-Lane Support & Intel VEH Hardening** — Active open PRs [`#189`](https://git.gtahub.st/github/Marvisak--VIctory/pulls/189) / [`#192`](https://git.gtahub.st/github/Marvisak--VIctory/pulls/192) (Wave32 cross-lane ops) and [`#216`](https://git.gtahub.st/github/Marvisak--VIctory/pulls/216) (page-end `clwb` & VEH hardening). ## 2. Newly Identified, Non-Duplicate Findings (45 Separable Tasks) Each item below was checked against all existing open, merged, and closed issues/PRs and comments, and can be implemented and tested in its own focused PR. | # | ID | Priority | Location | Summary | |---:|---|---|---|---| | 1 | `VIC-BT-001` | **P0** | `crates/victory-gpu/src/host.rs` lines `504-511, 582, 931-963` | Host::execute() clobbers HostList::prelude command allocator/list when the same HostList appears twice in runs | | 2 | `VIC-BT-002` | **P0** | `crates/victory-shader/src/ir.rs` lines `139-143, 198, 217-264, 343-352, 594-601` | SSA construction inserts NONE (Value(u32::MAX)) into phi.args for unreachable predecessors, panicking remove_trivial_phis in release builds | | 3 | `VIC-BT-003` | **P0** | `crates/victory-gpu/src/list.rs` lines `160-230, 261-277` | create_list() and create_list_x() ignore the pInitialState pipeline parameter, dropping initial draws/dispatches | | 4 | `VIC-BT-004` | **P0** | `crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/resource.rs` lines `descriptor/host.rs:599-611, 648-696; resource.rs:827-836` | fits() rejects NULL-desc and DXGI_FORMAT_UNKNOWN SRV/UAVs on typed textures promoted to typeless by host_texture() | | 5 | `VIC-BT-005` | **P0** | `crates/victory-hle/src/modules/lifecycle.rs` lines `296-310` | lifecycle.rs: Missing RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification in api-ms-win-core-psm-appnotify-* | | 6 | `VIC-BT-006` | **P0** | `crates/victory-shader/src/structure.rs` lines `946-965` | s_cmp_eq/lg_u32/u64 comparing two lane masks is lowered to per-lane equality instead of wave-wide uniform reduction | | 7 | `VIC-BT-007` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `6793, 6866-6881, 6903-6906` | Critical-edge map overwrites first edge block when LaneExit::Branch has taken == not_taken, emitting invalid DXIL PHIs | | 8 | `VIC-BT-008` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `3626-3727` | DPP16/DPP8 ignores fi (fetch-inactive) and source-lane EXEC activity for bound_ctrl | | 9 | `VIC-BT-009` | **P1** | `crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/shader.rs` lines `lower.rs:3325-3343; shader.rs:241-264, 405-431` | Immediate sampler used non-comparison first then comparison later emits mismatched annotateHandle vs dx.resources metadata | | 10 | `VIC-BT-010` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `4172-4204, 4894-4907, 4953` | Integer VOP3 clamp (unsigned saturation) silently ignored on carry-out and non-carry add/sub ops | | 11 | `VIC-BT-011` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `6496-6506` | Pixel shader export discards on !guard of DONE instead of tracking last exp VM (Valid Mask) and per-MRT color masks | | 12 | `VIC-BT-012` | **P1** | `crates/victory-gpu/src/descriptor.rs` lines `197-238` | RtvRecord::desc() and depth_desc() hardcode TEXTURE_2D for NULL-desc RTV/DSVs, breaking MSAA, 2DArray, 3D, and 1D targets | | 13 | `VIC-BT-013` | **P1** | `crates/victory-gpu/src/draw.rs` lines `422-435, 450` | State::prepare() compares raw title heap pointers (host_heaps != heaps), creating an ABA bug on heap release and reallocation | | 14 | `VIC-BT-014` | **P1** | `crates/victory-formats/src/texture.rs` lines `406-412` | Thick 3D mip-tail predicate omits mip_depth(i) <= fixed[2] | | 15 | `VIC-BT-015` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `6454-6475` | buffer_load_format_d16_x/xyz zeroes high 16 bits of destination VGPR and converts integer formats via legacyF32ToF16 | | 16 | `VIC-BT-016` | **P1** | `crates/victory-gpu/src/descriptor.rs` lines `432-438` | create_cbv() silently ignores NULL desc instead of writing a null CBV descriptor, leaving stale views active | | 17 | `VIC-BT-017` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `6082-6110, 6329-6346` | d16 image_load corrupts 32-bit integer texels and zeros high 16 bits on odd-channel loads | | 18 | `VIC-BT-018` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `2088-2128, 2009-2040` | ds_swizzle_b32 reads undefined/stale VGPRs from inactive source lanes instead of returning 0 | | 19 | `VIC-BT-019` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `3156-3166, 3219-3241` | format_load (tbuffer_load_format_*) drops high byte on unaligned 16-bit dword-straddling loads, fills missing channels with (0,0,0,1) instead of 0, and quiets f16 sNaNs | | 20 | `VIC-BT-020` | **P1** | `crates/victory-hle/src/modules/gameinput.rs` lines `576-579` | gameinput.rs: IGameInput/IGameInputDevice/IGameInputReading QueryInterface unconditionally returns E_NOINTERFACE without supporting IID_IUnknown or clearing *out | | 21 | `VIC-BT-021` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `4315-4342, 4556-4567, 4629-4670, 5387-5399` | half_src reads inline float constants as f16 bits instead of f32 bits for 16-bit integer instructions | | 22 | `VIC-BT-022` | **P1** | `crates/victory-gpu/src/resource.rs` lines `815-864` | host_texture() passes non-null pOptimizedClearValue without ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL flags | | 23 | `VIC-BT-023` | **P1** | `crates/victory-hle/src/modules/net.rs` lines `540-606` | net.rs: getaddrinfo / GetAddrInfoW / GetAddrInfoEx{A,W} fail with WSAHOST_NOT_FOUND without setting *result = NULL | | 24 | `VIC-BT-024` | **P1** | `crates/victory-shader/src/resource.rs` lines `172-190, 261-269, 360-385` | resource::track() iterates blocks in index order instead of RPO, missing waterfall offset loads in split_irreducible copies | | 25 | `VIC-BT-025` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `2834-2873` | s_buffer_load_dword* adds unaligned base, soffset, and offset before dword-truncating instead of truncating each term independently | | 26 | `VIC-BT-026` | **P1** | `crates/victory-shader/src/structure.rs` lines `1010-1021` | s_cbranch_vccz and s_cbranch_vccnz AND vcc with exec instead of testing raw VCC | | 27 | `VIC-BT-027` | **P1** | `crates/victory-gpu/src/resource.rs` lines `1153-1178` | texture_at() caches failed host textures (host == None) in PLACED_TEXTURES before checking host.is_some() | | 28 | `VIC-BT-028` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `4110-4121, 4147-4153 (vs 4486-4504)` | v_cvt_f32_f16 drops abs/neg and v_cvt_f16_f32 drops clamp on default low-half VOP3 (op_sel == 0) | | 29 | `VIC-BT-029` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `5541-5559` | v_interp_p2_f16 lowering ignores VOP3 op_sel[3] (high destination half), clamp, and omod modifiers | | 30 | `VIC-BT-030` | **P1** | `crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/wave.rs` lines `lower.rs:4205-4232, wave.rs:321-333` | v_readlane_b32 and v_writelane_b32 do not mask lane index to S1[4:0] (Wave32) / S1[5:0] (Wave64) | | 31 | `VIC-BT-031` | **P1** | `crates/victory-shader/src/emit/lower.rs` lines `4217-4232` | v_writelane_b32 gates its destination write with EXEC, silently dropping SGPR spills to inactive lanes | | 32 | `VIC-BT-032` | **P1** | `crates/victory-hle/src/modules/xgameruntime.rs, crates/victory-hle/src/modules/dstorage.rs, crates/victory-hle/src/modules/xasync.rs, crates/victory-hle/src/modules/xuser.rs, crates/victory-hle/src/modules/xgamesave.rs` lines `dstorage.rs:239,264,299,986; xasync.rs:991; xuser.rs:273; xgamesave.rs:908` | xgameruntime.rs & COM HLE vtables: Slot 0 (QueryInterface) wired to missing::<0> returning E_NOTIMPL across all GDK and DirectStorage COM objects | | 33 | `VIC-BT-033` | **P1** | `crates/victory-hle/src/modules/xgameui.rs` lines `216-229` | xgameui.rs: dialog::procedure dereferences GWLP_USERDATA without null check on WM_COMMAND | | 34 | `VIC-BT-034` | **P1** | `crates/victory-hle/src/modules/xpackage.rs` lines `270-284` | xpackage.rs: XPackageUnregisterInstallationProgressChanged (slot 0x50) wired to missing::<10> returning HRESULT instead of bool | | 35 | `VIC-BT-035` | **P2** | `crates/victory-gpu/src/host.rs, crates/victory-gpu/src/queue.rs` lines `host.rs:500-543; queue.rs:114-128` | Host::execute() calls ID3D12CommandQueue::ExecuteCommandLists with 0 lists when runs is empty | | 36 | `VIC-BT-036` | **P2** | `crates/victory-hle/src/modules/xmem.rs` lines `433-464` | XMemAllocatePhysicalPages never recycles freed page numbers (monotonic next_page growth) | | 37 | `VIC-BT-037` | **P2** | `crates/victory-hle/src/modules/dstorage.rs` lines `125-143` | dstorage.rs: open_file clobbers GetLastError() via heap allocation before last_os_error() and omits FILE_SHARE_WRITE / FILE_SHARE_DELETE | | 38 | `VIC-BT-038` | **P2** | `crates/victory-shader/src/emit/lower.rs` lines `5811-5826` | image_get_resinfo returns 1 instead of 0 for unused depth channels on 1D / 2D / 1D-Array views | | 39 | `VIC-BT-039` | **P2** | `crates/victory-hle/src/modules/net.rs` lines `179-192` | net.rs: resolvable() blocks the local machine's own hostname (gethostname) with WSAHOST_NOT_FOUND | | 40 | `VIC-BT-040` | **P2** | `crates/victory-hle/src/modules/storage.rs` lines `90-102` | storage.rs: used_bytes() follows symlinks and Windows directory junctions via e.metadata(), risking infinite recursion or quota escape | | 41 | `VIC-BT-041` | **P2** | `crates/victory-shader/src/emit/lower.rs` lines `4071-4098` | v_fma_mixlo_f16 / v_fma_mixhi_f16 double-rounds through binary32 instead of single-rounding to binary16 | | 42 | `VIC-BT-042` | **P2** | `crates/victory-shader/src/emit/lower.rs` lines `4538-4541` | v_mad_f16 / v_mac_f16 conflated with fused v_fma_f16 and double-rounded through binary32 | | 43 | `VIC-BT-043` | **P2** | `crates/victory-shader/src/emit/lower.rs` lines `3925-3960` | v_mad_f32 / v_mac_f32 / v_mad_legacy_f32 omit unconditional subnormal flush before and after omod | | 44 | `VIC-BT-044` | **P2** | `crates/victory-shader/src/emit/lower.rs` lines `1792-1799` | write_f omod (mul:2/mul:4/div:2) preserves -0.0 instead of flushing -0.0 to +0.0 per RDNA2 hardware | | 45 | `VIC-BT-045` | **P2** | `crates/victory-hle/src/modules/xsystem.rs` lines `105-115` | xsystem.rs: XSystemGetAnalyticsInfo reports family as 'Xbox' instead of GDK-documented 'Windows.Xbox' | ### Technical Details for All Newly Identified Findings #### 1. `VIC-BT-001` — Host::execute() clobbers HostList::prelude command allocator/list when the same HostList appears twice in runs (`P0`) - **Location:** `crates/victory-gpu/src/host.rs` lines `504-511, 582, 931-963` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for list.prelude() clobbering on duplicate list in runs). - **Root Cause:** In crates/victory-gpu/src/host.rs (lines 504-511), Host::execute() iterates `for list in runs`, calls `list.prelude()`, and pushes the returned ID3D12CommandList into `lists` before calling `self.queue.ExecuteCommandLists(&lists)` at line 532. Each HostList owns only a single reusable `(prelude_allocator, prelude_list)` pair, and HostList::prelude() (lines 931-963) unconditionally calls `allocator.Reset()` and `list.Reset()` before recording barriers and closing it. If `runs` contains the same HostList twice (e.g., `[L, L]` or `[L, M, L]`), the second `list.prelude()` resets the allocator and command list while the first occurrence's COM pointer is still sitting in `lists[]` awaiting ExecuteCommandLists. Both entries in `lists[]` now point to the second prelude's barriers (and the first prelude's barriers are lost, leaving textures in the wrong D3D12 resource state for the first execution of L). - **Edge-Case / Verification Note:** Verified at host.rs:582 that VIctory explicitly anticipates duplicate lists in a single submission ('a submission may name a list twice'). Also verified that prelude() returns a clone of the same underlying ID3D12CommandList COM object (`self.prelude_list.cast().ok()`) after resetting `self.prelude_allocator`. - **Synthetic Reproducer:** Record a closed command list L that transitions texture T from COPY_DEST to RENDER_TARGET and draws. Submit `[L, L]` in one ExecuteCommandLists call while T starts in COMMON. The first list.prelude() records COMMON->COPY_DEST into prelude_list; the second list.prelude() resets prelude_allocator/prelude_list and records RENDER_TARGET->COPY_DEST. ExecuteCommandLists executes `[prelude_list, L, prelude_list, L]`, attempting RENDER_TARGET->COPY_DEST when T is actually in COMMON. - **Proposed Fix & Risk:** - **Fix:** Allocate preludes from a per-submission pool on Host (or split `runs` into separate ExecuteCommandLists batches whenever a HostList pointer repeats in `runs`) so two queued entries in `lists[]` never alias the same underlying prelude allocator/command list. - **Regression Risk:** Low; splitting on duplicate HostList pointers (or pooling prelude lists on Host) preserves exact barrier ordering with zero overhead in the common non-duplicate case. (Estimated size: `M`) #### 2. `VIC-BT-002` — SSA construction inserts NONE (Value(u32::MAX)) into phi.args for unreachable predecessors, panicking remove_trivial_phis in release builds (`P0`) - **Location:** `crates/victory-shader/src/ir.rs` lines `139-143, 198, 217-264, 343-352, 594-601` - **Prior-Work Check:** 0% overlap across all 3,661+ records in Marvisak_VIctory (issues_and_prs.json, pulls.json, issue_comments.json, review_comments.json); checked remove_trivial_phis, unreachable phi, NONE phi, u32::MAX phi. - **Root Cause:** In crates/victory-shader/src/ir.rs, leader discovery (lines 139-143) creates basic blocks for instructions immediately following s_branch/s_endpgm, and link() (line 198) populates block.preds from ALL blocks including unreachable ones. However, reverse_postorder(), liveness(), and SSA renaming (lines 217-264, 343-352) visit only blocks reachable from block 0. Consequently, outs[unreachable_pred] remains empty, so when filling phi.args for a reachable merge block that has an unreachable predecessor in block.preds, lookup(&outs[p], phi.reg) returns NONE (Value(u32::MAX)). In debug builds this trips debug_assert! at line 261; in release builds NONE flows into remove_trivial_phis() (lines 594-601), which indexes replaced[v.0 as usize] with u32::MAX and panics with an out-of-bounds slice index. - **Edge-Case / Verification Note:** Checked whether link() or split_blocks() prunes unreachable blocks before SSA construction: neither does, and reverse_postorder() is only computed inside ssa() without filtering block.preds. Because AMD's console shader compiler frequently emits unreachable padding/tail blocks or dead jump-table fallthroughs before reachable labels, reachable merge blocks legitimately inherit unreachable predecessors in block.preds. - **Synthetic Reproducer:** Construct a GFX10 shader where block 0 unconditionally jumps via s_branch to block 2 (a merge block using s0), while dead block 1 (immediately after s_branch) writes s0 and falls through to block 2. Call ir::build() in release mode: block 2 gets a phi for s0 with preds [0, 1], outs[1] is empty, phi.args receives NONE (Value(u32::MAX)), and remove_trivial_phis panics indexing replaced[u32::MAX as usize]. - **Proposed Fix & Risk:** - **Fix:** Filter unreachable predecessors out of block.preds (or prune unreachable blocks from the CFG / skip preds with rpo[p] == usize::MAX when inserting and populating phis) before SSA renaming and phi placement in ir.rs. - **Regression Risk:** Low; pruning unreachable predecessors from CFG edges and phi operand lists strictly restores SSA invariants without affecting reachable control flow. (Estimated size: `S`) #### 3. `VIC-BT-003` — create_list() and create_list_x() ignore the pInitialState pipeline parameter, dropping initial draws/dispatches (`P0`) - **Location:** `crates/victory-gpu/src/list.rs` lines `160-230, 261-277` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for pInitialState, create_list pipeline, create_list_x pipeline, new_list pipeline). - **Root Cause:** In crates/victory-gpu/src/list.rs, both create_list() (line 165: `_pipeline: This`) and create_list_x() (line 187: `_pipeline: This`) discard the pInitialState parameter and call new_list(), which initializes `state: Default::default()` (line 227) with `pipeline: null`. By contrast, reset() (line 272) properly calls `state.reset(pipeline)` to bind the initial pipeline state. Per D3D12 specification, CreateCommandList opens the command list with pInitialState already bound (if non-null), just like Reset. - **Edge-Case / Verification Note:** Verified in draw.rs that State::default() sets pipeline to null and that draw/dispatch paths check `pipeline::host_pipeline(self.pipeline)` and drop the draw when pipeline is null. Also verified that pipeline::bound(pipeline) is not called on initial state during create_list/create_list_x. - **Synthetic Reproducer:** Call CreateCommandList(0, DIRECT, allocator, valid_pso, IID, &list), set root arguments/targets, and immediately call DrawInstanced or Dispatch without an intervening SetPipelineState. Because state.pipeline is null, the draw/dispatch is silently dropped. - **Proposed Fix & Risk:** - **Fix:** Pass `pipeline` into new_list(), call `crate::pipeline::bound(pipeline)` if non-null, and initialize `state` with `state.reset(pipeline)` (matching reset() at line 272). - **Regression Risk:** Low; brings CreateCommandList / CreateCommandListX into exact parity with Reset(). (Estimated size: `S`) #### 4. `VIC-BT-004` — fits() rejects NULL-desc and DXGI_FORMAT_UNKNOWN SRV/UAVs on typed textures promoted to typeless by host_texture() (`P0`) - **Location:** `crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/resource.rs` lines `descriptor/host.rs:599-611, 648-696; resource.rs:827-836` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for fits() rejecting view == 0 on typeless-promoted textures; #392 comment is about Host::rtv on B5G5R5A1/B4G4R4A4). - **Root Cause:** In crates/victory-gpu/src/resource.rs (lines 827-836), host_texture() promotes typed console textures to *_TYPELESS on the host in two common cases: (1) depth textures without DENY_SHADER_RESOURCE, and (2) sRGB textures with ALLOW_UNORDERED_ACCESS. On the console, the title's resource is still typed, so D3D12 allows the title to pass pDesc == NULL or pDesc->Format == DXGI_FORMAT_UNKNOWN (0) to CreateShaderResourceView / CreateUnorderedAccessView to inherit the resource's format. However, in descriptor/host.rs:599-611, fits() inspects the host texture's promoted typeless format (`typeless == true`) and sees `view == 0`, returning `!typeless` (`false`). make() then returns None and null_for() silently writes a null descriptor into the host heap. - **Edge-Case / Verification Note:** Checked descriptor.rs:220-235 (`RtvRecord::host_desc`) which explicitly calls `crate::resource::view_format(self.resource)` to recover the title's original typed format when creating NULL-desc RTVs/DSVs on typeless-promoted resources. descriptor/host.rs `make()`/`fits()` never performs that lookup for SRV/UAVs. - **Synthetic Reproducer:** Create a 2D texture with DXGI_FORMAT_R8G8B8A8_UNORM_SRGB (29) and ALLOW_UNORDERED_ACCESS (0x4): host_texture() creates it as DXGI_FORMAT_R8G8B8A8_TYPELESS (27). Call CreateShaderResourceView(tex, NULL, handle) or CreateUnorderedAccessView(tex, NULL, NULL, handle): fits() computes typeless=true, view=0, returns false, and the host heap receives a null view. - **Proposed Fix & Risk:** - **Fix:** When desc is None or desc.Format == DXGI_FORMAT_UNKNOWN (0) on a typeless-promoted host texture, resolve the title's original format via crate::resource::view_format(resource) (mapping sRGB to linear for UAVs and depth formats to their SRV format such as R32_FLOAT/R24_UNORM_X8_TYPELESS) and construct the explicit host view description before calling CreateShaderResourceView / CreateUnorderedAccessView. - **Regression Risk:** Low; matches the exact pattern already used by RtvRecord::host_desc and eliminates silent null-view substitution on valid D3D12 calls. (Estimated size: `S`) #### 5. `VIC-BT-005` — lifecycle.rs: Missing RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification in api-ms-win-core-psm-appnotify-* (`P0`) - **Location:** `crates/victory-hle/src/modules/lifecycle.rs` lines `296-310` - **Prior-Work Check:** Verified 0 hits across Marvisak_VIctory issues_and_prs.json, pulls.json, issue_comments.json, and review_comments.json for RegisterAppConstrainedChangeNotification / UnregisterAppConstrainedChangeNotification. - **Root Cause:** lifecycle::module() claims the wildcard DLL pattern 'api-ms-win-core-psm-appnotify-*' (lines 296-310) but only exports RegisterAppStateChangeNotification and UnregisterAppStateChangeNotification. The static PE32+ import table of game_scarlett_master.exe explicitly imports RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification from api-ms-win-core-psm-appnotify-l1-1-1.dll. - **Edge-Case / Verification Note:** On Windows desktop hosts, api-ms-win-core-psm-appnotify-l1-1-1.dll may not be present or may fail outside an AppContainer/UWP package; because VIctory intercepts api-ms-win-core-psm-appnotify-* via HLE, omitting these two exports leaves them unresolved or silently stubbed. - **Synthetic Reproducer:** Resolve RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification against the lifecycle HLE module for api-ms-win-core-psm-appnotify-l1-1-1.dll; lookup returns None. - **Proposed Fix & Risk:** - **Fix:** Export RegisterAppConstrainedChangeNotification(routine, context, registration) (storing/returning a non-null registration token and returning 0/ERROR_SUCCESS) and UnregisterAppConstrainedChangeNotification(registration) in lifecycle.rs, mirroring the existing AppStateChangeNotification implementation. - **Regression Risk:** Low; purely additive exports matching the Win32/Xbox PSM notification ABI. (Estimated size: `S`) #### 6. `VIC-BT-006` — s_cmp_eq/lg_u32/u64 comparing two lane masks is lowered to per-lane equality instead of wave-wide uniform reduction (`P0`) - **Location:** `crates/victory-shader/src/structure.rs` lines `946-965` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (issues #434/#145/#131 address MaskData::Host wave32 ballot upper-half in lower.rs, not structure.rs scc_lane lowering two-mask s_cmp_eq/lg to per-lane !(a ^ b) / a ^ b). - **Root Cause:** In crates/victory-shader/src/structure.rs (lines 946-965), scc_lane() handles s_cmp_eq_u32, s_cmp_eq_u64, s_cmp_lg_u32, and s_cmp_lg_u64 when both operands are tracked lane masks (a, b) by returning !(a ^ b) for eq and (a ^ b) for lg as a per-lane Bool. On GFX10/RDNA2 hardware, s_cmp_eq_u32/u64 sets the uniform scalar condition code SCC = 1 iff ALL 32/64 bits of mask a equal mask b across the entire wave (i.e., WaveActiveAllTrue(a == b)), and s_cmp_lg sets SCC = 1 iff ANY bit differs (WaveActiveAnyTrue(a != b)). Lowering this to per-lane !(a ^ b) turns a uniform wave-wide branch (s_cbranch_scc0/1) into a divergent per-lane branch where lanes that happen to agree take one path while disagreeing lanes take the other. - **Edge-Case / Verification Note:** Verified whether scc_lane() is only called when comparing against 0 or -1: lines 946-965 explicitly match two arbitrary tracked masks (Some(a), Some(b)). Comparing against 0 (a == 0 -> all lanes false) is already handled separately as uniform via ballot/SCC, whereas two non-zero masks (such as vcc vs exec in WaveActiveAllTrue) hit the per-lane XNOR/XOR branch and silently diverge. - **Synthetic Reproducer:** In a compute shader, compute a per-lane predicate into vcc (true on lane 0, false on lane 1), execute s_cmp_eq_u32 vcc, exec followed by s_cbranch_scc0 skip, and write a sentinel value. Hardware sets SCC=0 for the entire wave so all lanes skip; VIctory lowers SCC to per-lane !(vcc ^ exec), so lane 0 executes the body while lane 1 skips. - **Proposed Fix & Risk:** - **Fix:** Do not lower two-mask s_cmp_eq/lg_u32/u64 to a per-lane Bool in scc_lane(). Leave SCC as a uniform scalar comparison (Atom::Uniform) evaluated via wave-wide ballot equality in lower.rs (or emit WaveActiveAllTrue(a == b) / WaveActiveAnyTrue(a != b)). - **Regression Risk:** Medium; shaders using s_cmp_eq/lg on two masks will require wave-ops ballot/reduction support in lower.rs, which is already implemented for compute/graphics via waveActiveBallot. (Estimated size: `M`) #### 7. `VIC-BT-007` — Critical-edge map overwrites first edge block when LaneExit::Branch has taken == not_taken, emitting invalid DXIL PHIs (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `6793, 6866-6881, 6903-6906` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for self.edges.insert, taken == not_taken, duplicate phi edge). - **Root Cause:** In crates/victory-shader/src/emit/lower.rs, exit() (line 6793) handles LaneExit::Branch { when, taken, not_taken } by calling self.edge(b, taken) and self.edge(b, not_taken) and emitting Term::CondBr(cond, e1, e2). Inside edge() (lines 6866-6881), each call allocates a new DXIL edge block e and executes self.edges.insert((from, to), e). When taken == not_taken, both calls share the exact same map key (b, taken), so the second insert overwrites e1 with e2. Later, fill_phis() (lines 6903-6906) looks up self.edges.get(&(q, b)) for each predecessor, emitting duplicate incoming entries for e2 and zero entries for e1, even though the DXIL CFG has CondBr(cond, e1, e2) with both e1 and e2 branching to the merge block. - **Edge-Case / Verification Note:** Checked whether structure.rs guarantees taken != not_taken on all LaneExit::Branch exits: structure.rs constructs LaneExit::Branch from conditional branches and loop-exit rewrites where degenerate or folded targets can point to the same block, and ir.rs preserves duplicate edges in block.preds. Moreover, even a single unconditional branch optimization in exit() when taken == not_taken is absent. - **Synthetic Reproducer:** Emit a shader where a conditional branch has both taken and not_taken pointing to the same join block B with a live register phi (e.g., s_cbranch_scc1 +0 / folded branch). lower.rs emits CondBr(cond, e1, e2) where both e1 and e2 jump to B, while fill_phis populates B's phi with (val, e2) and omits e1, failing DXIL validation ('PHI node entries do not match predecessors'). - **Proposed Fix & Risk:** - **Fix:** In exit() (lower.rs:6793), collapse LaneExit::Branch { taken, not_taken, .. } when taken == not_taken into a single unconditional edge self.edge(b, taken) and Term::Br(e), or key self.edges by (from, to, branch_arm) when both arms must be preserved. - **Regression Risk:** Low; collapsing identical branch targets to an unconditional branch is semantically identical and simplifies the emitted DXIL CFG. (Estimated size: `S`) #### 8. `VIC-BT-008` — DPP16/DPP8 ignores fi (fetch-inactive) and source-lane EXEC activity for bound_ctrl (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `3626-3727` - **Prior-Work Check:** Searched all 3,661 VIctory records for `bound_ctrl`, `fetch-inactive`, `dpp8`, `dpp16`, and `fi` in `lower.rs` (0 hits). - **Root Cause:** Measured across 14,412 hardware oracle cases on RDNA2 `gfx1031` (`ProjectLeonidaL/leonida` `design.md:266`, `crosslane_fuzz.py --dpp-sweep --oracle hw`), DPP16/DPP8 must check whether the source lane is active (`EXEC[src]`) in addition to row/bank bounds: when `fi == 0` and the source lane is inactive, `bound_ctrl == 1` returns `0` and `bound_ctrl == 0` disables writing the destination VGPR (preserving old `vdst`). `lower.rs:3626-3727` never reads the `fi` bit for DPP16 or DPP8 and never checks `EXEC[src]`, unconditionally reading stale/undefined VGPR values from inactive lanes. - **Edge-Case / Verification Note:** Alternative hypothesis: shaders might only use DPP under full-wave `EXEC` masks. Falsification: divergent fragment quads and subgroup reductions routinely run DPP16 (`row_shr`, `quad_perm`, `row_bcast`) and DPP8 under partial `EXEC`; any inactive neighbor returns stale garbage instead of `0` or preserving `vdst`. - **Synthetic Reproducer:** Wave32 compute shader: `v_mov_b32 v0, 0x12345678; v_mov_b32 v1, 0xAAAA5555; s_mov_b32 exec_lo, 0x55555555; v_add_u32_dpp v1, v0, v0 row_shr:1 bound_ctrl:1 fi:0`. On RDNA2 hardware, active lane 2 reads inactive lane 1 as `0` (`v1 = v0 + 0`); VIctory reads `0x12345678` from inactive lane 1. - **Proposed Fix & Risk:** - **Fix:** Decode the `fi` bit for both DPP16 and DPP8; compute the active-lane mask via `waveActiveBallot(true)` (or tracked `EXEC`), treat `(!in_bounds || (!fi && !src_active))` as out-of-bounds, and apply `bound_ctrl` (`0` when `bound_ctrl == 1`, preserve old `vdst` when `bound_ctrl == 0`). - **Regression Risk:** Low-medium; adds one ballot + bit-test per DPP instruction and preserves `vdst` when `bound_ctrl == 0`. (Estimated size: `M`) #### 9. `VIC-BT-009` — Immediate sampler used non-comparison first then comparison later emits mismatched annotateHandle vs dx.resources metadata (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/shader.rs` lines `lower.rs:3325-3343; shader.rs:241-264, 405-431` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for cmp_samplers or sampler_handle). - **Root Cause:** In lower.rs:3337-3342, when a static sampler at index n is used with a comparison instruction (props.0 & 0x8000 != 0), it sets self.s.cmp_samplers |= 1 << n and calls self.s.sampler_handle(self.cur, n). In shader.rs:258-263, sampler_handle() immediately emits dx.op.annotateHandle with properties 14 | cmp based on the CURRENT value of self.cmp_samplers. If sampler n was first used by a non-comparison sample, that earlier annotateHandle was emitted with properties 14 (non-comparison SamplerState). When a later comparison sample sets bit n in self.cmp_samplers, Shader::finish() (shader.rs:411-420) declares sampler n in dx.resources as kind = 1 (SamplerComparisonState). The earlier annotateHandle(14) now contradicts dx.resources (kind = 1), which DXIL validation rejects. - **Edge-Case / Verification Note:** Checked whether lower.rs pre-scans for comparison sampler uses before lowering instructions: it does not; self.samplers and self.s.cmp_samplers are populated lazily during instruction lowering. Also note that if n >= 64, 1u64 << n overflows. - **Synthetic Reproducer:** Translate a shader with one immediate sampler constant (Source::Constant) used first by image_sample and second by image_sample_c. Inspect the emitted DXIL: the first annotateHandle has ResourceProperties {14, 0}, the second has {0x800E, 0}, and dx.resources declares s0 with SamplerKind=1 (Comparison). - **Proposed Fix & Risk:** - **Fix:** Allocate distinct static sampler slots for (words, is_comparison) pairs (which also eliminates the shortcut comment at lower.rs:3338-3339 and matches D3D12's requirement that comparison and non-comparison samples use matching sampler bindings), or patch earlier annotateHandle constants in Shader::finish() as fix_user_data_size() does. - **Regression Risk:** Low; separating (words, is_comparison) into distinct static sampler slots is cleaner, DXIL-valid, and bounded by the small number of immediate samplers per shader. (Estimated size: `S`) #### 10. `VIC-BT-010` — Integer VOP3 clamp (unsigned saturation) silently ignored on carry-out and non-carry add/sub ops (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `4172-4204, 4894-4907, 4953` - **Prior-Work Check:** Searched all 3,661 VIctory records for `v_add_co_u32 clamp`, `v_add_nc_u32 clamp`, `add_sub_carry` (0 hits). - **Root Cause:** None of `v_add_co_u32`, `v_sub_co_u32`, `v_subrev_co_u32`, `*_ci_u32`, `v_add_nc_u32`, `v_sub_nc_u32`, `v_subrev_nc_u32`, or `v_add3_u32` inspect `v.clamp`. Measured on RDNA2 `gfx1035` silicon (`Leonida/tools/int_hw_probe.py`), VOP3 `clamp` saturates unsigned overflow to `0xFFFF_FFFF` and underflow to `0` while keeping the true carry/borrow out in `sdst`. - **Edge-Case / Verification Note:** Alternative hypothesis: DXC-compiled console shaders rarely emit integer `clamp`. Falsification: synthetic VOP3 `v_add_co_u32 ... clamp` test. - **Synthetic Reproducer:** `v_add_co_u32 v0, vcc_lo, 0xFFFFFFF0, 0x20 clamp` -> expected `v0 = 0xFFFF_FFFF, vcc_lo = 1`; currently wraps to `v0 = 0x10`. - **Proposed Fix & Risk:** - **Fix:** When `v.clamp` is true, saturate `r` using the carry/borrow bit (`select(carry, 0xFFFF_FFFF, r)` for add, `select(borrow, 0, r)` for sub; widen to `i64` for `v_add3_u32`). - **Regression Risk:** Low; gated strictly on `v.clamp`. (Estimated size: `S`) #### 11. `VIC-BT-011` — Pixel shader export discards on !guard of DONE instead of tracking last exp VM (Valid Mask) and per-MRT color masks (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `6496-6506` - **Prior-Work Check:** Searched all 3,661 VIctory records for `valid mask`, `exp vm`, `e.done`, and `discard` in `lower.rs:6496` (0 hits). - **Root Cause:** Measured across 18 pixel shader programs on RDNA2 `gfx1036` (`ProjectLeonidaL/leonida` `design.md:267`, `ps_oracle.py`), pixel survival is governed by the `EXEC` mask of the last `exp` with `VM=1` (Valid Mask), MRT color exports are per-MRT last-write masked, and `exp null done vm` under partial `EXEC` kills only inactive lanes while keeping active lanes alive if a prior color export wrote them. `lower.rs:6496-6506` ignores `e.vm`, discards solely on `!guard` of `e.done`, and rejects conditional non-`done` exports. - **Edge-Case / Verification Note:** Alternative hypothesis: simple pixel shaders have a single `exp mrt0 ... done vm` at shader exit where `done` and `vm` coincide. Falsification: multi-MRT shaders with early-out `exp null ... done vm` or separate `exp mrt0` + `exp mrtz ... done vm` (alpha-to-coverage, depth-only discard, G-buffer deferred shaders) decouple `VM`, `DONE`, and per-MRT masks. - **Synthetic Reproducer:** Pixel shader exporting `exp mrt0 ...` under full `EXEC`, then narrowing `EXEC` to half the quad and running `exp mrt1 ... done vm` (or `exp null ... done vm`). Hardware uses the last `VM=1` export's `EXEC` mask for pixel survival and preserves MRT0 for surviving pixels; VIctory mis-discards or rejects the conditional non-done export. - **Proposed Fix & Risk:** - **Fix:** Track a per-lane `vm_live` boolean updated on every `exp` with `vm == 1` (overwriting with current `EXEC`), emit `discard` at shader exit based on `!vm_live`, and allow conditional non-`done` MRT exports by latching per-MRT output variables under `EXEC`. - **Regression Risk:** Medium; requires routing pixel shader `discard` through a unified exit block after all exports. (Estimated size: `M`) #### 12. `VIC-BT-012` — RtvRecord::desc() and depth_desc() hardcode TEXTURE_2D for NULL-desc RTV/DSVs, breaking MSAA, 2DArray, 3D, and 1D targets (`P1`) - **Location:** `crates/victory-gpu/src/descriptor.rs` lines `197-238` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for RtvRecord/host_desc/depth_desc hardcoding TEXTURE_2D; #796/#450/#16/#55 are about null RTV handles in OMSetRenderTargets). - **Root Cause:** In crates/victory-gpu/src/descriptor.rs (lines 197-238), when a title passes pDesc == NULL to CreateRenderTargetView or CreateDepthStencilView (`self.described == 0`), RtvRecord::desc() and depth_desc() call host_desc(TEXTURE_2D) with a hardcoded dimension (4 for RTV_DIMENSION_TEXTURE2D, 3 for DSV_DIMENSION_TEXTURE2D) and zeroed union fields. Whenever crate::resource::view_format() returns Some(fmt) (e.g., for typeless-promoted depth or sRGB+UAV textures), host_desc() emits a TEXTURE2D view description regardless of the underlying resource's actual dimension, sample count, or array size. D3D12 rejects TEXTURE2D views on MSAA textures (requires TEXTURE2DMS), 1D/3D textures, and 2D array textures. - **Edge-Case / Verification Note:** Verified in descriptor.rs:220-237 that host_desc() only queries crate::resource::view_format(self.resource) and never queries the resource's ResourceDesc (dimension, depth_or_array, samples). In D3D12, NULL-desc RTV/DSV is the standard way titles bind MSAA render targets and cascaded shadow map arrays. - **Synthetic Reproducer:** Create a 4x MSAA depth texture (D32_FLOAT, SampleDesc.Count=4, without DENY_SHADER_RESOURCE so host_texture promotes it to R32_TYPELESS), then call CreateDepthStencilView(tex, NULL, handle) and ClearDepthStencilView(handle, ...). RtvRecord::depth_desc() emits D3D12_DSV_DIMENSION_TEXTURE2D (3) instead of D3D12_DSV_DIMENSION_TEXTURE2DMS (5), causing D3D12 to reject the DSV. - **Proposed Fix & Risk:** - **Fix:** Query the title ResourceDesc (dimension, depth_or_array, samples) in RtvRecord::host_desc() and select the matching D3D12_RTV_DIMENSION / D3D12_DSV_DIMENSION (1D, 1DArray, 2D, 2DArray, 2DMS, 2DMSArray, 3D) with ArraySize/WSize set to depth_or_array. - **Regression Risk:** Low; strictly aligns NULL-desc RTV/DSV synthesis with the D3D12 specification. (Estimated size: `S`) #### 13. `VIC-BT-013` — State::prepare() compares raw title heap pointers (host_heaps != heaps), creating an ABA bug on heap release and reallocation (`P1`) - **Location:** `crates/victory-gpu/src/draw.rs` lines `422-435, 450` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for host_heaps ABA / as_raw; #59 comment is about resetting host_heaps after ExecuteIndirect). - **Root Cause:** In crates/victory-gpu/src/draw.rs (lines 422-435), State caches `self.host_heaps: [This; 2]` (raw pointers to title `Heap` objects) and only calls `list.list.SetDescriptorHeaps(&bound)` when `self.host_heaps != self.heaps`. Notice that for pipelines right below (line 450), State specifically avoids this ABA hazard by comparing the underlying host COM pointer (`host.pso.as_raw()`). For descriptor heaps, however, if a title destroys a heap and creates a replacement heap that the Rust allocator places at the same `This` address, `self.host_heaps == self.heaps` evaluates true even though the underlying host `ID3D12DescriptorHeap` COM object is completely different, so `SetDescriptorHeaps` is skipped. - **Edge-Case / Verification Note:** Verified in draw.rs:422-455 that `self.host_heaps` stores `[This; 2]` (the title COM pointer) rather than `[*mut c_void; 2]` (the host `ID3D12DescriptorHeap::as_raw()` pointers). Even within a single command list (or across dynamic heap recreation between draws), ABA on `Box<Heap>` reuse silently skips binding the new host descriptor heap. - **Synthetic Reproducer:** Bind shader-visible heap H1 on a command list and draw; release H1 and create H2 (same size/type, allocated at H1's freed address); call SetDescriptorHeaps([H2]) and draw. `self.host_heaps == self.heaps` is true, so the host command list never calls SetDescriptorHeaps with H2's host ID3D12DescriptorHeap. - **Proposed Fix & Risk:** - **Fix:** Store `[usize; 2]` of the host `ID3D12DescriptorHeap::as_raw() as usize` pointers in `self.host_heaps` (matching `self.host_pipeline` at line 450) and compare against the resolved host heap COM pointers before skipping `SetDescriptorHeaps`. - **Regression Risk:** Low; trivial comparison change that eliminates pointer-reuse ABA on descriptor heaps. (Estimated size: `S`) #### 14. `VIC-BT-014` — Thick 3D mip-tail predicate omits mip_depth(i) <= fixed[2] (`P1`) - **Location:** `crates/victory-formats/src/texture.rs` lines `406-412` - **Prior-Work Check:** Searched all 3,661 VIctory records for `first_tail_mip`, `fixed[2]`, `tail_max[2]`, `mip_depth` (0 hits). - **Root Cause:** Lines `377-382` compute thick 3D `tail_max` (including halving `tail_max[2]` when `block_log2 % 3 == 2`), but line `408` checks only `w <= fixed[0] && h <= fixed[1] && d.mips - i <= max_in_tail`, omitting `mip_depth(i) <= fixed[2]`. Deep narrow 3D textures (e.g. `16x16x64`) falsely enter the 1-block mip tail at mip 0. - **Edge-Case / Verification Note:** Alternative hypothesis: game volume textures might all be wider than `fixed[0]` when deep. Falsification: unit test with `16x16x64`, 4 mips, `Sw64KbS` immediately fails `Layout::new` invariant (offset overlaps / tail overflow). - **Synthetic Reproducer:** Unit test in `victory-formats/src/texture.rs`: `Desc { dimension: Tex3d, width: 16, height: 16, depth: 64, mips: 4, element_bytes: 4, swizzle: Sw64KbS }` -> mip 0 has `tail.is_some()` despite 64 slices > block depth. - **Proposed Fix & Risk:** - **Fix:** Change line `408` to `if w <= fixed[0] && h <= fixed[1] && (!thick || mip_depth(i) <= fixed[2]) && d.mips - i <= max_in_tail`. - **Regression Risk:** Very low; strictly corrects thick 3D mip-tail boundary per AMD addrlib. (Estimated size: `XS`) #### 15. `VIC-BT-015` — buffer_load_format_d16_x/xyz zeroes high 16 bits of destination VGPR and converts integer formats via legacyF32ToF16 (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `6454-6475` - **Prior-Work Check:** Searched all 3,661 VIctory records for `buffer_load_format_d16`. PR #169 only added `tbuffer_load_format_d16_*` packing and still zeroes odd-channel high halves; 0 hits for `buffer_load_format_d16_x/xyz` high-half preservation or integer format handling at `lower.rs:6454-6475`. - **Root Cause:** Measured on RDNA2 `gfx1031` silicon (`ProjectLeonidaL/leonida` `shader_validation.md:1642,1658-1665`, `d16_format_probe.py`), `buffer_load_format_d16_x` and `buffer_load_format_d16_xyz` preserve `vdst[31:16]` on the odd trailing VGPR, and integer buffer formats (`UINT`/`SINT`) saturate to 16-bit integer rather than converting as float. `lower.rs:6454-6475` unconditionally runs `legacyF32ToF16` on every channel (corrupting `UINT`/`SINT` formats) and writes the odd trailing channel directly to `vdst` with `vdst[31:16] = 0`. - **Edge-Case / Verification Note:** Alternative hypothesis: register allocation might not keep live values in the high 16 bits of `vdst` before `buffer_load_format_d16_x`. Falsification: RDNA2 16-bit register packing routinely allocates two independent 16-bit values to the low and high halves of one VGPR, and `d16_format_probe.py` confirms hardware preserves the high half. - **Synthetic Reproducer:** Pre-load `v0 = 0xDEAD_0000`, execute `buffer_load_format_d16_x v0, v1, s[0:3], 0 idxen` on a `32_UINT` buffer containing `70000`. Hardware produces `v0 = 0xDEAD_FFFF` (high half preserved, integer saturated to `0xFFFF`); VIctory produces `0x0000_7C00` (high half zeroed, float-converted to `+inf`). - **Proposed Fix & Risk:** - **Fix:** Merge the odd trailing channel with `(old_vdst & 0xFFFF_0000) | (lo & 0xFFFF)` via `low_half()`, and branch on the descriptor numeric format so `UINT`/`SINT` saturate to `[0, 65535]`/`[-32768, 32767]` instead of calling `legacyF32ToF16`. - **Regression Risk:** Low; matches `d16_format_probe.py` hardware behavior. (Estimated size: `S`) #### 16. `VIC-BT-016` — create_cbv() silently ignores NULL desc instead of writing a null CBV descriptor, leaving stale views active (`P1`) - **Location:** `crates/victory-gpu/src/descriptor.rs` lines `432-438` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for create_cbv null or CreateConstantBufferView null). - **Root Cause:** In crates/victory-gpu/src/descriptor.rs (lines 433-438), create_cbv() wraps record() inside `if let Some([lo, hi, size, _]) = words(desc)`. Under D3D12, passing pDesc == NULL to ID3D12Device::CreateConstantBufferView is explicitly valid and initializes a null CBV descriptor (BufferLocation = 0, SizeInBytes = 0) that returns 0 on all reads. Because create_cbv() returns early when desc is null, neither the title slot nor the mirrored host descriptor heap slot is updated, leaving whatever View (and host descriptor) previously occupied that slot intact. - **Edge-Case / Verification Note:** Verified in descriptor/host.rs:781-785 that `View::Constant(0, 0)` is already handled cleanly (shadow::find(0, 0) returns None -> null_for() calls CreateConstantBufferView with a zeroed D3D12_CONSTANT_BUFFER_VIEW_DESC). By contrast, create_srv() and create_uav() always call record() even when desc is null. - **Synthetic Reproducer:** Write a valid CBV or SRV to shader-visible heap slot 0, then call CreateConstantBufferView(NULL, slot0). Call descriptor::view(slot0): it still returns the previous CBV/SRV instead of View::Constant(0, 0), and the host heap still points to the previous resource. - **Proposed Fix & Risk:** - **Fix:** In create_cbv() (descriptor.rs:433-438), when words(desc) is None, call record(handle, View::Constant(0, 0)) so the slot is overwritten and mirrored as a null CBV on the host heap. - **Regression Risk:** Low; one-line change that matches D3D12 semantics and reuses the existing null_for(View::Constant) path. (Estimated size: `S`) #### 17. `VIC-BT-017` — d16 image_load corrupts 32-bit integer texels and zeros high 16 bits on odd-channel loads (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `6082-6110, 6329-6346` - **Prior-Work Check:** Searched all 3,661 VIctory records for `d16` integer / high half. PR #169 covers `tbuffer_load_format_d16` packing; PR #632/#571 cover LDS d16; none fix `image_load d16` integer saturation or odd-channel high-half preservation. - **Root Cause:** Verified on RDNA2 `gfx1036` (`Leonida/tools/image_d16_probe.py`): (1) `image_load d16` of 32-bit `UINT`/`SINT` texels saturates to `[0, 65535]` / `[-32768, 32767]`, whereas line `6088` unconditionally runs `legacyF32ToF16`; (2) odd-channel `d16` loads preserve the upper 16 bits of the destination VGPR, whereas lines `6094-6109` write `p[0]` directly with high 16 bits zeroed. - **Edge-Case / Verification Note:** Alternative hypothesis: destination high half is dead after 1-channel d16 load. Falsification: packed f16/u16 register allocation routinely keeps live data in the upper 16 bits. - **Synthetic Reproducer:** Pre-load `v0 = 0x5A5A_0000`, run `image_load v0, v[1:2], s[0:7] dmask:0x1 d16`. Expected `v0[31:16] == 0x5A5A`; observed `0x0000`. - **Proposed Fix & Risk:** - **Fix:** Merge odd trailing channel with `(old & 0xFFFF_0000) | (lo & 0xFFFF)` via `low_half()`, and use integer `textureLoad.i32` + 16-bit saturation when descriptor numeric format is `UINT`/`SINT`. - **Regression Risk:** Low; requires reading old VGPR value for odd trailing channel (already supported via `low_half`). (Estimated size: `M`) #### 18. `VIC-BT-018` — ds_swizzle_b32 reads undefined/stale VGPRs from inactive source lanes instead of returning 0 (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `2088-2128, 2009-2040` - **Prior-Work Check:** Searched all 3,661 VIctory records for `ds_swizzle_b32`, `quad_pick`, `read_lane`. PR #606 covers rotate/FFT modes (0xC000+); PR #189/#192 cover Wave32/64 lane indexing; none mask inactive source lanes to 0. - **Root Cause:** On RDNA2, `ds_swizzle_b32` returns `0` when the source lane `src` is inactive (`EXEC[src] == 0`). VIctory emits bare `waveReadLaneAt.i32` / `quadReadLaneAt.i32` without checking whether `src` is active. In DXIL, reading an inactive lane is undefined behavior and returns stale VGPR values on NVIDIA/AMD/Intel. - **Edge-Case / Verification Note:** Alternative hypothesis: shaders might only call `ds_swizzle_b32` under uniform full-wave `EXEC`. Falsification: divergent compute/pixel quad reductions execute with partial `EXEC` masks; synthetic test with `EXEC = 0x55555555` and `v0 = 0xDEADBEEF` proves stale reads. - **Synthetic Reproducer:** Wave32 kernel: set `v0 = 0xDEADBEEF`, mask `EXEC = 0x55555555`, execute `ds_swizzle_b32 v1, v0 offset:swizzle(SWAP,1)`. Expected `v1 == 0` on active even lanes; observed stale/undefined bits. - **Proposed Fix & Risk:** - **Fix:** Compute active-lane ballot (`waveActiveBallot(true)` or tracked EXEC mask), test bit `src`, and `select(src_active, read_val, 0)` before writing `dst_reg`. - **Regression Risk:** Low; adds 1 ballot + bit-test + select per `ds_swizzle_b32`. (Estimated size: `S`) #### 19. `VIC-BT-019` — format_load (tbuffer_load_format_*) drops high byte on unaligned 16-bit dword-straddling loads, fills missing channels with (0,0,0,1) instead of 0, and quiets f16 sNaNs (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `3156-3166, 3219-3241` - **Prior-Work Check:** Searched all 3,661 VIctory records for `format_load`, `tbuffer_load_format`, `legacyF16ToF32` NaN, and dword-straddling 16-bit load (0 hits). - **Root Cause:** Cross-auditing `lower.rs:3156-3166, 3219-3241` against measured RDNA2 hardware contracts (`ProjectLeonidaL/leonida` `buffer_formats.md:50-52`, `shader_validation.md:1671-1711` `f16_widen_probe.py`, `design.md:278,344`) reveals three distinct bugs: (1) 16-bit element loads at `off & 3 == 3` shift a single 32-bit dword right by 24 bits without fetching the next dword, silently zeroing the high byte; (2) missing channels beyond the format's channel count return `(0, 0, 0, 1)` instead of `0` (before `DST_SEL` swizzling; `DST_SEL` supplies `1` only when explicitly set to `SEL_1`); (3) `16_FLOAT`/`10_11_11_FLOAT`/`11_11_10_FLOAT` widening uses `legacyF16ToF32`, which quiets signaling NaNs and canonicalizes payloads instead of preserving unquieted `sign | 0x7F800000 | (payload << 13)`. - **Edge-Case / Verification Note:** Alternative hypothesis: vertex/typed buffers are mostly 4-byte aligned and rarely carry sNaN payloads. Falsification: packed 3-byte or byte-offset vertex streams hit `off & 3 == 3`, and 1/2/3-channel formats with `DST_SEL_W = SEL_W` expose the `(0,0,0,1)` vs `0` bug immediately. - **Synthetic Reproducer:** (1) `tbuffer_load_format_x` of `16_UINT` at byte offset 3 from `[0x00, 0x00, 0x00, 0x34, 0x12]` -> hardware reads `0x1234`, VIctory reads `0x0034`. (2) `tbuffer_load_format_xyzw` of `32_UINT` with `DST_SEL = XYZW` -> hardware returns `(x, 0, 0, 0)`, VIctory returns `(x, 0, 0, 1)` in W. (3) `16_FLOAT` value `0x7C01` (sNaN) -> hardware widens to `0x7F802000`, `legacyF16ToF32` quiets bit 22 to `0x7FC02000`. - **Proposed Fix & Risk:** - **Fix:** Fetch `(lo >> 24) | (hi << 8)` when `off & 3 == 3` for 16-bit elements; zero-fill absent raw channels before applying `DST_SEL`; preserve raw f16 NaN sign and payload bits on NaN widening. - **Regression Risk:** Low; localized to `format_load` helper. (Estimated size: `S`) #### 20. `VIC-BT-020` — gameinput.rs: IGameInput/IGameInputDevice/IGameInputReading QueryInterface unconditionally returns E_NOINTERFACE without supporting IID_IUnknown or clearing *out (`P1`) - **Location:** `crates/victory-hle/src/modules/gameinput.rs` lines `576-579` - **Prior-Work Check:** Verified 0 hits across Marvisak_VIctory issues_and_prs.json, pulls.json, issue_comments.json, and review_comments.json for no_interface / gameinput QueryInterface. - **Root Cause:** no_interface() at gameinput.rs:576-579 is wired as slot 0 (QueryInterface) for all three GameInput COM vtables (IGameInput, IGameInputDevice, IGameInputReading). It ignores riid and out completely and unconditionally returns E_NOINTERFACE without checking IID_IUnknown or the object's own IID, and without setting *out = null on failure as required by the COM IUnknown::QueryInterface specification. - **Edge-Case / Verification Note:** While titles that directly use the pointer returned by GameInputCreate without calling QueryInterface are unaffected, C++ smart pointers (Microsoft::WRL::ComPtr, winrt::com_ptr) and engine wrappers routinely QI for IID_IUnknown (for COM identity comparison) or versioned IGameInput IIDs. - **Synthetic Reproducer:** Call IGameInput::QueryInterface(this, &IID_IUnknown, &out) with out initialized to a non-null sentinel; returns E_NOINTERFACE and leaves out unchanged instead of returning S_OK with AddRef'd this. - **Proposed Fix & Risk:** - **Fix:** Implement per-object QueryInterface functions that validate out (returning E_POINTER if null), write *out = null on error, and return S_OK with AddRef when *riid matches IID_IUnknown or the object's own interface IID. - **Regression Risk:** Low; aligns GameInput COM objects with standard COM identity and refcounting rules. (Estimated size: `S`) #### 21. `VIC-BT-021` — half_src reads inline float constants as f16 bits instead of f32 bits for 16-bit integer instructions (`P1`) - **Location:** `crates/victory-shader/src/emit/lower.rs` lines `4315-4342, 4556-4567, 4629-4670, 5387-5399` - **Prior-Work Check:** Searched all 3,661 VIctory records for `half_src`, `f16_operand`, and inline float constants on 16-bit integer ops (0 hits; PR #78 only covered `v_fma_mix`). - **Root Cause:** Measured on RDNA2 silicon (`ProjectLeonidaL/leonida` `shader_validation.md:2053`, `Kajcsi/G6Recomp` `docs/shaders.md:805-808`), inline float constants (`240..=248`, e.g. `0.5`, `1.0`, `2.0`, `4.0`) only decode to 16-bit f16 bit patterns (`0x3C00` for `1.0`) when the instruction's source operand type is `F16`; for 16-bit integer instructions (`v_cvt_f16_u16`, `v_cvt_f16_i16`, `v_add_nc_u16`, `v_sub_nc_u16`, `v_mul_lo_u16`, `v_lshlrev/lshrrev/ashrrev_*16`, `v_min/max_u16/i16`, `v_cmp_*_u16/i16`), hardware decodes them as 32-bit `F32` bits (`0x3F800000`, so low 16 bits = `0x0000` and high 16 bits = `0x3F80`). `lower.rs:4315-4342` unconditionally calls `f16_operand` inside `half_src` for all 16-bit ops regardless of whether the operand is float or integer. - **Edge-Case / Verification Note:** Alternative hypothesis: DXC might rarely encode inline float constants `240..=248` as operands to 16-bit integer ops. Falsification: LLVM/DXC frequently exploits `op_sel` + inline `1.0`/`2.0`/`4.0` constants as compact encodings for `0x3F80`, `0x4000`, `0x4080` bit masks or constants in 16-bit integer ops to avoid a 32-bit literal dword. - **Synthetic Reproducer:** Assemble `v_add_nc_u16 v0, 1.0, v1` (operand code 242, `op_sel:[0,0]`, `v1 = 5`). Hardware decodes `1.0` as `0x3F800000` -> low half `0x0000`, yielding `v0 = 5`; VIctory decodes `1.0` via `f16_operand` as `0x3C00`, yielding `v0 = 0x3C05`. - **Proposed Fix & Risk:** - **Fix:** Split `half_src` into `half_src_f16` (using `f16_operand`) and `half_src_i16` (using 32-bit `s()` + 16-bit `op_sel` extraction), and route all 16-bit integer operands (`u16`/`i16`/`b16`) through `half_src_i16`. - **Regression Risk:** Low; clean separation between f16 and i16/u16/b16 operand decoding. (Estimated size: `S`) #### 22. `VIC-BT-022` — host_texture() passes non-null pOptimizedClearValue without ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL flags (`P1`) - **Location:** `crates/victory-gpu/src/resource.rs` lines `815-864` - **Prior-Work Check:** 0% overlap across Marvisak_VIctory (0 hits for clear_value without ALLOW_RENDER_TARGET/ALLOW_DEPTH_STENCIL; #735 comment only discusses clearing unsupported flag combinations). - **Root Cause:** In crates/victory-gpu/src/resource.rs (lines 839-864), host_texture() unconditionally constructs `clear_value` whenever the title's `clear` pointer is non-null and forwards it to `host.device.CreateCommittedResource(..., clear_value.as_ref()...)`. Under PC D3D12, passing a non-null `pOptimizedClearValue` when `Desc.Flags` has neither `D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET` (0x1) nor `D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL` (0x2) — or when `Desc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER` — is strictly illegal and fails with `E_INVALIDARG`. Xbox/console D3D12.X titles can pass non-null clear values on resources whose console-specific flags are masked off by `d.flags &= PC_FLAGS` at line 815. - **Edge-Case / Verification Note:** Verified lines 815-864 in resource.rs: `d.flags` is masked with `PC_FLAGS` and `DEPTH`/`UNORDERED` adjusted, but `clear_value` is never gated on `d.flags & (0x1 | 0x2) != 0` before calling CreateCommittedResource. - **Synthetic Reproducer:** Call CreateCommittedResource with a 2D texture desc having Flags = 0 (or Flags = ALLOW_UNORDERED_ACCESS) and a non-null pOptimizedClearValue: host_texture() forwards the non-null clear_value to PC D3D12 CreateCommittedResource, which returns E_INVALIDARG and logs 'no host texture'. - **Proposed Fix & Risk:** - **Fix:** Gate `clear_value` on `!clear.is_null() && d.dimension != BUFFER && (d.flags & (0x1 | 0x2)) != 0` in host_texture() (resource.rs:839). - **Regression Risk:** Low; strictly satisfies D3D12's CreateCommittedResource contract without affecting valid RT/DS clear values. (Estimated size: `S`) #### 23. `VIC-BT-023` — net.rs: getaddrinfo / GetAddrInfoW / GetAddrInfoEx{A,W} fail with WSAHOST_NOT_FOUND without setting *result = NULL (`P1`) - **Location:** `crates/victory-hle/src/modules/net.rs` lines `540-606` - **Prior-Work Check:** Verified 0 hits across Marvisak_VIctory corpus for getaddrinfo *result / WSAHOST_NOT_FOUND null. - **Root Cause:** In net.rs:540-606, when resolvable() rejects a hostname, getaddrinfo, GetAddrInfoW, GetAddrInfoExA, and GetAddrInfoExW immediately return WSAHOST_NOT_FOUND without writing null to the out-pointer (*result = std::ptr::null_mut()). Windows Winsock guarantees *ppResult is set to NULL on failure. - **Edge-Case / Verification Note:** Callers that zero-initialize `addrinfo* res = nullptr;` before calling getaddrinfo do not crash, but C/C++ code relying on the documented Win32 _Outptr_result_maybenull_ guarantee (including common HTTP/TLS libraries) leaves res uninitialized. - **Synthetic Reproducer:** Initialize `let mut res = 0xDEAD_BEEF as *mut c_void;` and call getaddrinfo(c"example.com", null, null, &mut res); returns WSAHOST_NOT_FOUND while res remains 0xDEAD_BEEF. - **Proposed Fix & Risk:** - **Fix:** Write `if !result.is_null() { unsafe { *result = std::ptr::null_mut(); } }` before returning WSAHOST_NOT_FOUND in all four resolver hooks. - **Regression Risk:** Low; strictly improves Win32 Winsock ABI conformance. (Estimated size: `S`) --- > **Continue Series:** **Part 1/2 (this issue)** | Part 2/2: `https://github.com/Marvisak/VIctory/issues/1249`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:24:42 +00:00
Author
Owner

@⁠ArnabSaga on GitHub · 2026-11-24 16:48 UTC · original

I'd like to investigate VIC-BT-003, which concerns the initial pipeline state being ignored by CreateCommandList and CreateCommandListX.

I'll independently verify the reported behavior, examine pipeline lifetime and state initialization, and develop targeted regression tests for the supported graphics and compute paths.

I can validate the implementation on native NVIDIA D3D12 and WARP using synthetic fixtures.

**@⁠ArnabSaga** on GitHub · 2026-11-24 16:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7138232332) I'd like to investigate VIC-BT-003, which concerns the initial pipeline state being ignored by CreateCommandList and CreateCommandListX. I'll independently verify the reported behavior, examine pipeline lifetime and state initialization, and develop targeted regression tests for the supported graphics and compute paths. I can validate the implementation on native NVIDIA D3D12 and WARP using synthetic fixtures.
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-24 17:25 UTC · original

I checked item 14 (VIC-BT-014) against the GFX10 Addrlib implementation and the proposed synthetic case. ComputeSurfaceInfoMacroTiled computes mip depth but passes only width, height and remaining levels to IsInMipTail. Depth is handled separately when sizing the surface. VIctory also accounts for depth by storing a tail block per thick depth slab.

I enumerated every texel address for the proposed 16 × 16 × 64 volume with four mips, four-byte elements and 64 KiB standard swizzle. The first tail mip is 0, as reported. All 18,720 texels have distinct addresses within the allocation, so I could not reproduce the claimed overlap or overflow. Adding a depth predicate would change the first tail mip away from the GFX10 reference.

AI-assisted (Codex).

**@⁠BaggyALPHA** on GitHub · 2026-11-24 17:25 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7139170339) I checked item 14 (VIC-BT-014) against the GFX10 Addrlib implementation and the proposed synthetic case. `ComputeSurfaceInfoMacroTiled` computes mip depth but passes only width, height and remaining levels to `IsInMipTail`. Depth is handled separately when sizing the surface. VIctory also accounts for depth by storing a tail block per thick depth slab. I enumerated every texel address for the proposed 16 × 16 × 64 volume with four mips, four-byte elements and 64 KiB standard swizzle. The first tail mip is 0, as reported. All 18,720 texels have distinct addresses within the allocation, so I could not reproduce the claimed overlap or overflow. Adding a depth predicate would change the first tail mip away from the GFX10 reference. AI-assisted (Codex).
Author
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-24 17:32 UTC · original

Two items in this list look like false positives, checked against main ffe310e, so nobody spends time on them:

  • VIC-BT-014 (thick 3D mip tail omits mip_depth(i) <= fixed[2]): AMD's own addrlib does the same as VIctory. Mesa's Gfx10Lib::IsInMipTail (src/amd/addrlib/src/gfx10/gfx10addrlib.cpp) decides tail membership from mipWidth <= mipTailDim.w && mipHeight <= mipTailDim.h && numMipsToTheEnd <= maxNumMipsInTail; depth is not compared, also for thick 3D swizzles. Adding the depth test would make VIctory disagree with the hardware layout, not fix it.
  • VIC-BT-028 (v_cvt_f32_f16 drops abs/neg, v_cvt_f16_f32 drops clamp with op_sel == 0): the arm the item points at is not reached for these opcodes. valu16 handles v_cvt_f32_f16 / v_cvt_f16_f32 before that arm, so the quoted lines are dead code for them. Whether valu16 itself honours abs/neg/clamp is a separate question I have not checked.

Several other items already have open PRs (e.g. #1274, #1268, #1313, #1308), as noted in the thread.

AI use: Claude Code (Claude Opus 5.5) read the code and the addrlib source; I checked both points before posting.

**@⁠vladbondarenko97** on GitHub · 2026-11-24 17:32 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7139356345) Two items in this list look like false positives, checked against `main` `ffe310e`, so nobody spends time on them: - **VIC-BT-014** (thick 3D mip tail omits `mip_depth(i) <= fixed[2]`): AMD's own addrlib does the same as VIctory. Mesa's `Gfx10Lib::IsInMipTail` (`src/amd/addrlib/src/gfx10/gfx10addrlib.cpp`) decides tail membership from `mipWidth <= mipTailDim.w && mipHeight <= mipTailDim.h && numMipsToTheEnd <= maxNumMipsInTail`; depth is not compared, also for thick 3D swizzles. Adding the depth test would make VIctory disagree with the hardware layout, not fix it. - **VIC-BT-028** (`v_cvt_f32_f16` drops abs/neg, `v_cvt_f16_f32` drops clamp with `op_sel == 0`): the arm the item points at is not reached for these opcodes. `valu16` handles `v_cvt_f32_f16` / `v_cvt_f16_f32` before that arm, so the quoted lines are dead code for them. Whether `valu16` itself honours abs/neg/clamp is a separate question I have not checked. Several other items already have open PRs (e.g. #1274, #1268, #1313, #1308), as noted in the thread. AI use: Claude Code (Claude Opus 5.5) read the code and the addrlib source; I checked both points before posting.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-24 17:50 UTC · original

Part 1/2 cross-check from the sibling runtime: VIC-BT-016 (NULL-desc create_cbv() silently ignored → stale view) is absent by construction in ivall/xcl — our CBV slot write funnels null and non-null through the same expression (real.rs:1783: desc.as_ref().map_or((0, 0), …) → cbv_words(va, size)), so a NULL desc always writes a zero (null-CBV) descriptor to the slot; staleness is unrepresentable. Same invariant your fix restores, reached structurally — worth stating in your fix text as the general rule: the descriptor write is unconditional; only its words depend on desc. (Part 2 items 026/040/030/031 already covered in my #1249 comment — raw-VCC branch test and symlink-skipping quota walk both already correct on our side, with pointers.)

**@⁠pickles976** on GitHub · 2026-11-24 17:50 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7139785356) Part 1/2 cross-check from the sibling runtime: **VIC-BT-016** (NULL-desc `create_cbv()` silently ignored → stale view) is **absent by construction in ivall/xcl** — our CBV slot write funnels null and non-null through the same expression (`real.rs:1783`: `desc.as_ref().map_or((0, 0), …)` → `cbv_words(va, size)`), so a NULL desc *always writes* a zero (null-CBV) descriptor to the slot; staleness is unrepresentable. Same invariant your fix restores, reached structurally — worth stating in your fix text as the general rule: **the descriptor write is unconditional; only its words depend on desc**. (Part 2 items 026/040/030/031 already covered in my #1249 comment — raw-VCC branch test and symlink-skipping quota walk both already correct on our side, with pointers.)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:12 UTC · original · edited 2026-11-26 06:43 UTC

Automated triage for the maintainers.

This is a list of 45 static-audit claims (Part 2 is #1249). A list this long can't be confirmed or closed as one bug, so each item is handled in its own PR or issue, which should come with a test that fails on main. Many already do (the open PRs that link #1242).

Merged into main since the audit (current main 63bcca4):

  • 003, initial pipeline in create_list/create_list_x: #1446
  • 009, immediate sampler comparison mode: #1477
  • 016, a null description in CreateConstantBufferView: #2449. create_cbv in crates/victory-gpu/src/descriptor.rs now records View::Constant(0, 0) when the description is null. Open PR #2889 adds a WARP readback test for it.
  • 023, resolver result cleared on a blocked lookup: #1411
  • 029, v_interp_p2_f16 modifiers: #1696
  • 033, dialog commands before initialization: #1515

Checked and not a bug on main:

  • 002: decode in crates/victory-shader/src/gfx10/mod.rs decodes only instructions reachable from offset 0, so code after an unconditional s_branch never becomes a block and the join has only the branching predecessor (the latest comment also reports a test showing this).
  • 014: the thick mip-tail test matches addrlib, which compares no depth. main pins this in crates/victory-formats/src/texture.rs (deep_volumes_keep_their_chain_in_each_slabs_tail, using this item's 16x16x64 case, and layouts_match_addrlib). The depth-predicate PRs #1494 and #1499 were closed unmerged.
  • 028: valu16 in crates/victory-shader/src/emit/lower.rs handles v_cvt_f32_f16 and v_cvt_f16_f32 before the cited arm.
  • 045: crates/victory-hle/src/modules/xsystem.rs reports family as "Xbox", which the latest comment matches against the public GDK documentation; no public source was found for the value the audit proposes.

Next to item 012 (view descriptions with DXGI_FORMAT_UNKNOWN): make in crates/victory-gpu/src/descriptor/host.rs resolves an UNKNOWN format from the resource for explicit SRV and UAV descriptions (#1273). Explicit RTV and DSV descriptions with UNKNOWN still reach the host unchanged on main. Open PR #2763 covers those with WARP tests, and #1406 (open) covers default descriptions.

The remaining items stay open until a PR with a failing test shows each one.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7159377376) · edited 2026-11-26 06:43 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-26T06:00:37Z at=2026-11-26T06:50:00Z --> Automated triage for the maintainers. This is a list of 45 static-audit claims (Part 2 is #1249). A list this long can't be confirmed or closed as one bug, so each item is handled in its own PR or issue, which should come with a test that fails on `main`. Many already do (the open PRs that link #1242). Merged into `main` since the audit (current main `63bcca4`): - 003, initial pipeline in `create_list`/`create_list_x`: #1446 - 009, immediate sampler comparison mode: #1477 - 016, a null description in `CreateConstantBufferView`: #2449. `create_cbv` in `crates/victory-gpu/src/descriptor.rs` now records `View::Constant(0, 0)` when the description is null. Open PR #2889 adds a WARP readback test for it. - 023, resolver result cleared on a blocked lookup: #1411 - 029, `v_interp_p2_f16` modifiers: #1696 - 033, dialog commands before initialization: #1515 Checked and not a bug on `main`: - **002:** `decode` in `crates/victory-shader/src/gfx10/mod.rs` decodes only instructions reachable from offset 0, so code after an unconditional `s_branch` never becomes a block and the join has only the branching predecessor (the latest comment also reports a test showing this). - **014:** the thick mip-tail test matches addrlib, which compares no depth. `main` pins this in `crates/victory-formats/src/texture.rs` (`deep_volumes_keep_their_chain_in_each_slabs_tail`, using this item's 16x16x64 case, and `layouts_match_addrlib`). The depth-predicate PRs #1494 and #1499 were closed unmerged. - **028:** `valu16` in `crates/victory-shader/src/emit/lower.rs` handles `v_cvt_f32_f16` and `v_cvt_f16_f32` before the cited arm. - **045:** `crates/victory-hle/src/modules/xsystem.rs` reports `family` as `"Xbox"`, which the latest comment matches against the public GDK documentation; no public source was found for the value the audit proposes. Next to item 012 (view descriptions with `DXGI_FORMAT_UNKNOWN`): `make` in `crates/victory-gpu/src/descriptor/host.rs` resolves an UNKNOWN format from the resource for explicit SRV and UAV descriptions (#1273). Explicit RTV and DSV descriptions with UNKNOWN still reach the host unchanged on `main`. Open PR #2763 covers those with WARP tests, and #1406 (open) covers default descriptions. The remaining items stay open until a PR with a failing test shows each one. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Halfect on GitHub · 2026-11-25 12:18 UTC · original

Note on VIC-BT-014 (thick 3D mip-tail omits mip_depth(i) <= fixed[2]): this one is a false positive. AMD addrlib does not bound a thick mip's depth to the tail block's depth; when every mip's width and height fit, the whole chain tails from mip 0 and each depth slab gets its own tail block (mipChainInTail). The repository already pins that behavior with addrlib-derived addresses in texture::tests::deep_volumes_keep_their_chain_in_each_slabs_tail — using exactly this item's 16x16x64/SW_64KB_S reproducer (first tail mip 0, size 4×65536) — and in the [16, 16, 64] and [4, 4, 16] rows of layouts_match_addrlib (Mesa addrlib Addr2ComputeSurfaceInfo). I implemented the proposed predicate to check it: both addrlib-reference tests fail (cargo test --locked -p victory-formats --lib; first_tail 0→2, size 262144→786432 on 16x16x64). Reverted; suggest striking the item. AI-assisted (Kimi).

**@⁠Halfect** on GitHub · 2026-11-25 12:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7162208724) Note on **`VIC-BT-014`** (thick 3D mip-tail omits `mip_depth(i) <= fixed[2]`): this one is a false positive. AMD addrlib does not bound a thick mip's depth to the tail block's depth; when every mip's width and height fit, the whole chain tails from mip 0 and each depth slab gets its own tail block (`mipChainInTail`). The repository already pins that behavior with addrlib-derived addresses in `texture::tests::deep_volumes_keep_their_chain_in_each_slabs_tail` — using exactly this item's 16x16x64/`SW_64KB_S` reproducer (first tail mip 0, size 4×65536) — and in the `[16, 16, 64]` and `[4, 4, 16]` rows of `layouts_match_addrlib` (Mesa addrlib `Addr2ComputeSurfaceInfo`). I implemented the proposed predicate to check it: both addrlib-reference tests fail (`cargo test --locked -p victory-formats --lib`; first_tail 0→2, size 262144→786432 on 16x16x64). Reverted; suggest striking the item. AI-assisted (Kimi).
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 19:59 UTC · original

I checked a case adjacent to VIC-BT-012 in PR #2763. An explicit RTV or DSV can request format inheritance with DXGI_FORMAT_UNKNOWN. On main 13f91ca the two tests see UNKNOWN at the host view. After 6cdae0e, a synthetic clear through VIctory reads sRGB red [137, 0, 0, 255] from the selected slice while the other stays blue. The DSV retains mip 1 and READ_ONLY_DEPTH and takes D32_FLOAT. Both tests reproduced six times before and after on WARP.

#1406 covers default descriptions. The current heads merge cleanly together in a local merge-tree check. Please retain the Git author on cherry-pick or rebase. If you fold the fix or tests into another commit, please add the following trailer.

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted with Codex. Synthetic textures on WARP.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 19:59 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7173028861) I checked a case adjacent to VIC-BT-012 in [PR #2763](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2763). An explicit RTV or DSV can request format inheritance with DXGI_FORMAT_UNKNOWN. On main 13f91ca the two tests see UNKNOWN at the host view. After [6cdae0e](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/6cdae0ec0d66324429da792b6194a842fb2983f1), a synthetic clear through VIctory reads sRGB red [137, 0, 0, 255] from the selected slice while the other stays blue. The DSV retains mip 1 and READ_ONLY_DEPTH and takes D32_FLOAT. Both tests reproduced six times before and after on WARP. #1406 covers default descriptions. The current heads merge cleanly together in a local merge-tree check. Please retain the Git author on cherry-pick or rebase. If you fold the fix or tests into another commit, please add the following trailer. Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted with Codex. Synthetic textures on WARP.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 23:10 UTC · original

For VIC-BT-016, #2889 adds a Windows/WARP shader readback test to the descriptor-record coverage merged in #2449. The same test on 120233cf912173e4411431a4b47579ef420310fe retained 0x11223344 in both slots after clearing the descriptor. On base 842b0cb76f8f5fa9289bd779783c51ec24d75302 both the mirrored and reused table slots read zero after the clear, in six runs. Test commit.

Please keep the Git author if cherry-picking the test. If folding it into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 23:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7177221421) For VIC-BT-016, #2889 adds a Windows/WARP shader readback test to the descriptor-record coverage merged in #2449. The same test on `120233cf912173e4411431a4b47579ef420310fe` retained `0x11223344` in both slots after clearing the descriptor. On base `842b0cb76f8f5fa9289bd779783c51ec24d75302` both the mirrored and reused table slots read zero after the clear, in six runs. [Test commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/96e178d56be53cf164942a260f420d36b7dfb37b). Please keep the Git author if cherry-picking the test. If folding it into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
Author
Owner

@⁠Halfect on GitHub · 2026-11-26 06:00 UTC · original

Checked three entries against current main (63bcca4); all three look invalid:

  • VIC-BT-002 — does not reproduce: gfx10::decode follows control flow ("Decodes every instruction reachable from offset 0"), so instructions after an unconditional s_branch are never decoded and never become blocks; the join's only predecessor is the branching block. Same conclusion as #1619's investigation (incl. its 937k-program sweep). An s_branch-over-dead-code test shows 2 blocks, preds == [0], no phi.
  • VIC-BT-014 — the predicate matches AMD's own addrlib2: Gfx10Lib::IsInMipTail (src/amd/addrlib/src/gfx10/gfx10addrlib.h, mirrored in Mesa) checks only mipWidth, mipHeight and numMipsToTheEnd — no depth term. Adding mip_depth(i) <= fixed[2] would diverge from the hardware layout. The 16x16x64/4-mip/SW_64KB_S case also round-trips fine on main (no overlaps, no out-of-bounds).
  • VIC-BT-045 — the public GDK documentation for XSystemAnalyticsInfo::family gives the examples "Xbox" and "Windows" (learn.microsoft.com/gaming/gdk XSystemAnalyticsInfo), so the current text("Xbox") matches the documented value; I found no public source for "Windows.Xbox".

AI-assisted (Kimi).

**@⁠Halfect** on GitHub · 2026-11-26 06:00 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7184006871) Checked three entries against current main (63bcca4); all three look invalid: - `VIC-BT-002` — does not reproduce: `gfx10::decode` follows control flow ("Decodes every instruction reachable from offset 0"), so instructions after an unconditional `s_branch` are never decoded and never become blocks; the join's only predecessor is the branching block. Same conclusion as #1619's investigation (incl. its 937k-program sweep). An `s_branch`-over-dead-code test shows 2 blocks, `preds == [0]`, no phi. - `VIC-BT-014` — the predicate matches AMD's own addrlib2: `Gfx10Lib::IsInMipTail` (src/amd/addrlib/src/gfx10/gfx10addrlib.h, mirrored in Mesa) checks only `mipWidth`, `mipHeight` and `numMipsToTheEnd` — no depth term. Adding `mip_depth(i) <= fixed[2]` would diverge from the hardware layout. The 16x16x64/4-mip/SW_64KB_S case also round-trips fine on main (no overlaps, no out-of-bounds). - `VIC-BT-045` — the public GDK documentation for `XSystemAnalyticsInfo::family` gives the examples "Xbox" and "Windows" (learn.microsoft.com/gaming/gdk `XSystemAnalyticsInfo`), so the current `text("Xbox")` matches the documented value; I found no public source for "Windows.Xbox". AI-assisted (Kimi).
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-26 12:35 UTC · original

More audit rows verified dead against current main — filing so nobody burns a PR on them:

  • VIC-BT-005: RegisterAppConstrainedChangeNotification/UnregisterAppConstrainedChangeNotification exist and are exported under api-ms-win-core-psm-appnotify-* (lifecycle.rs:84-92, 597-604).
  • VIC-BT-033: dialog::procedure now guards WM_COMMAND with if user_data == 0 { return 0 } (xgameui.rs).
  • VIC-BT-034: vtable slot 0x50 is unregister_progress, not missing::<10> (xpackage.rs).
  • VIC-BT-003: pInitialState is honored — state.set_pipeline(pipeline) + pipeline::bound(pipeline) in create_list_x (fixed in e52777a).
  • VIC-BT-016: create_cbv writes a null CBV for a null desc.
  • VIC-BT-036: already covered by open PRs #1935 / #1445.
  • VIC-BT-013: covered by open PR #1331 (host-identity compare).
  • VIC-BT-039: covered by open PR #2001. VIC-BT-037: #2452/#3018. VIC-BT-040: #2990. VIC-BT-012: #1406.

Still real per my check: VIC-BT-027 (fixed in #3198).

**@⁠kotekompotek** on GitHub · 2026-11-26 12:35 UTC · [original](https://github.com/Marvisak/VIctory/issues/1242#issuecomment-7192192499) More audit rows verified dead against current main — filing so nobody burns a PR on them: - `VIC-BT-005`: `RegisterAppConstrainedChangeNotification`/`UnregisterAppConstrainedChangeNotification` exist and are exported under `api-ms-win-core-psm-appnotify-*` (lifecycle.rs:84-92, 597-604). - `VIC-BT-033`: `dialog::procedure` now guards `WM_COMMAND` with `if user_data == 0 { return 0 }` (xgameui.rs). - `VIC-BT-034`: vtable slot 0x50 is `unregister_progress`, not `missing::<10>` (xpackage.rs). - `VIC-BT-003`: `pInitialState` is honored — `state.set_pipeline(pipeline)` + `pipeline::bound(pipeline)` in create_list_x (fixed in `e52777a`). - `VIC-BT-016`: `create_cbv` writes a null CBV for a null desc. - `VIC-BT-036`: already covered by open PRs #1935 / #1445. - `VIC-BT-013`: covered by open PR #1331 (host-identity compare). - `VIC-BT-039`: covered by open PR #2001. `VIC-BT-037`: #2452/#3018. `VIC-BT-040`: #2990. `VIC-BT-012`: #1406. Still real per my check: `VIC-BT-027` (fixed in #3198).
This discussion has been locked. Commenting is limited to contributors.
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#1242
No description provided.