Tracking & Static Audit: 45 New Source-Level Bugs + 150 Prioritized Backlog Items [Part 2/2] #1249
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#1249
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@hyperland956-lgtm on GitHub · 2026-11-24 16:46 UTC · original
24.
VIC-BT-024— resource::track() iterates blocks in index order instead of RPO, missing waterfall offset loads in split_irreducible copies (P1)crates/victory-shader/src/resource.rslines172-190, 261-269, 360-385for (b, block) in p.blocks.iter().enumerate()rather than reverse postorder (RPO). When a block at a lower index references a descriptor loaded by an s_load in a higher-indexed block (for example, a block cloned and appended to p.blocks by structure::split_irreducible(), or a loop back-edge/reordered CFG block), out.scalar has not yet been populated for that higher-indexed block when the consumer is visited. Similarly, offset_at() (lines 261-269) only checks out.scalar entries populated prior to the current iteration, so waterfall detection misses the load and falls back to a uniform first-lane descriptor load.0..p.blocks.len()linearly while relying on previously-populated maps.S)25.
VIC-BT-025— s_buffer_load_dword* adds unaligned base, soffset, and offset before dword-truncating instead of truncating each term independently (P1)crates/victory-shader/src/emit/lower.rslines2834-2873s_buffer_load_dwordalignment /& ~3/soffsettruncation (0 hits).gfx1030) andgfx1036hardware (ProjectLeonidaL/leonidadesign.md:281),s_buffer_load_dword*clears the low 2 bits ofbase,soffset, andimm_offsetindividually ((base & ~3) + (soffset & ~3) + (offset & ~3)) before summing: specifically,sOFF = 3andIMM = 3resolves to byte offset+0, NOT+4.lower.rs:2834-2873sumsoffset + base + extra + soffsetfirst and only truncates/divides by 4 afterward, shifting the loaded dword by +4 bytes whenever the low 2 bits of two terms carry across bit 2.soffsetcan have non-zero low 2 bits; hardware explicitly masks each addend before addition.[0x11111111, 0x22222222]at offset 0. Executes_mov_b32 s4, 3; s_buffer_load_dword s5, s[0:3], s4 offset:3. Hardware loads0x11111111(offset(3 & ~3) + (3 & ~3) = 0); VIctory computes(3 + 3) >> 2 = 1and loads0x22222222.base,soffset, andoffsetindividually with& !3u32before summing them inlower.rs:2834-2873.XS)26.
VIC-BT-026— s_cbranch_vccz and s_cbranch_vccnz AND vcc with exec instead of testing raw VCC (P1)crates/victory-shader/src/structure.rslines1010-1021s_cbranch_vccz,s_cbranch_vccnz, andvccANDexecinstructure.rs(0 hits).structure.rs:1010-1021evaluatess_cbranch_vcczands_cbranch_vccnzby computingself.b.and(vcc, exec)before checking whether the mask is all-zero. Per the RDNA2 ISA,s_cbranch_vccz/s_cbranch_vccnztest the full 32-bit/64-bitVCCscalar register (VCC == 0/VCC != 0) independent ofEXEC. Whenever a shader sets bits inVCCfor currently inactive lanes (e.g. vias_mov_b32 vcc_lo, ...,s_or_b32 vcc_lo, ..., or a priorv_cmpbefore narrowingEXEC) and branches ons_cbranch_vccz/vccnz, masking withexecflips the branch direction.VCCviav_cmpunder the sameEXECmask immediately precedings_cbranch_vccz. Falsification: loop-exit patterns save/ORVCCacross iterations while narrowingEXEC(s_and_saveexec_b32), or load a wave-wide scalar mask intoVCC; a synthetic shader settingvcc_lo = 1withexec_lo = 2and executings_cbranch_vccztakes the wrong branch.s_mov_b32 vcc_lo, 1; s_mov_b32 exec_lo, 2; s_cbranch_vccz target. On RDNA2 hardware,VCC != 0so the branch is NOT taken; VIctory computesvcc & exec == 0and takes the branch.vcclane-mask value directly instructure.rs:1010-1021withoutself.b.and(vcc, exec).XS)27.
VIC-BT-027— texture_at() caches failed host textures (host == None) in PLACED_TEXTURES before checking host.is_some() (P1)crates/victory-gpu/src/resource.rslines1153-1178PLACED_TEXTURESat line 1155 and immediately returnsSome(r as This)on a cache hit. On a cache miss, it callscreate_at_address(...)(which returns S_OK even whenhost_texture()returns None), unconditionally inserts(address, *desc) -> outintoPLACED_TEXTURESat line 1176, and only THEN checksresource(out).host.is_some().then_some(out)at line 1177. Thus on failure, the first call returns None, the failed Resource is never released, and every subsequent call hits line 1155 and returnsSome(out)withhost == None.create_at_addressreturnsS_OKwhenhost_texture()fails (it only logs a warning and storeshost: Nonein theResource), and thatplaced_texture()indescriptor/host.rs:750expectstexture_at()to returnSomeonly when a usable texture resource was created.outinto PLACED_TEXTURES; Call 2 with the same (addr, desc) hits line 1155 and returns Some(out) even thoughresource(out).hostis None.resource(out).host.is_some()BEFORE inserting intoPLACED_TEXTURES; ifhostis None, releaseoutviarelease(out)and return None.S)28.
VIC-BT-028— v_cvt_f32_f16 drops abs/neg and v_cvt_f16_f32 drops clamp on default low-half VOP3 (op_sel == 0) (P1)crates/victory-shader/src/emit/lower.rslines4110-4121, 4147-4153 (vs 4486-4504)v_cvt_f32_f16(0 hits) andv_cvt_f16_f32clamp (0 hits).lower.rs:4147-4153matches"v_cvt_f32_f16" if v.opsel == 0, reads the raw integer operand vias(self, 0)?, and passes it straight tolegacyF16ToF32—completely dropping VOP3v.absandv.neg. Directly above,4110-4121matches"v_cvt_f16_f32" if v.opsel == 0and routes throughint(self, r), bypassingv.clamp([0,1]saturation). Thev.opsel != 0arms at4486-4504handle all modifiers properly viahalf_fsrcandfloat_result.v_cvt_f32_f16_e64withabs/negandop_sel:[0]. Falsification: run a synthetic shader test withv_cvt_f32_f16_e64 v0, -v1andv_cvt_f16_f32_e64 v0, v1 clampand check DXIL output.v_cvt_f32_f16_e64 v0, -v1(v1 = 0x3C00/+1.0h) -> expected-1.0f(0xBF800000), observed+1.0f(0x3F800000). Assemblev_cvt_f16_f32_e64 v0, v1 clamp(v1 = 2.0f) -> expected0x3C00, observed0x4000.if v.opsel == 0early arms at4110-4121and4147-4153so all encodings route through4486-4504.op_sel != 0. (Estimated size:XS)29.
VIC-BT-029— v_interp_p2_f16 lowering ignores VOP3 op_sel[3] (high destination half), clamp, and omod modifiers (P1)crates/victory-shader/src/emit/lower.rslines5541-5559S)30.
VIC-BT-030— v_readlane_b32 and v_writelane_b32 do not mask lane index to S1[4:0] (Wave32) / S1[5:0] (Wave64) (P1)crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/emit/wave.rslineslower.rs:4205-4232, wave.rs:321-333v_readlane_b32,v_writelane_b32, and lane index masking/wrapping (0 hits).ProjectLeonidaL/leonidadesign.md:265,cs_w32_lane_wrap.asm: lane 40 wraps to lane 8 in Wave32), RDNA2 hardware masks theS1lane-select operand ofv_readlane_b32andv_writelane_b32toS1 & 31in Wave32 andS1 & 63in Wave64.lower.rs:4205-4232passeslaneunmasked directly intowaveReadLaneAtand intolane_id == lane, causing out-of-range lane indices (>= 32in Wave32 or>= 64in Wave64) to trigger DXIL UB onv_readlane_b32and silently drop writes onv_writelane_b32.< wave_size. Falsification: shaders that compute lane indices fromm0or packed SGPR counters (e.g., upper bits carrying unrelated metadata) rely on hardware 5-bit/6-bit masking;cs_w32_lane_wrap.asmexplicitly tests lane40 -> 8.v_mov_b32 v0, lane_id; s_mov_b32 s0, 40; v_readlane_b32 s1, v0, s0. Hardware returnss1 = 8; VIctory callswaveReadLaneAt(v0, 40)(DXIL UB).lanewithself.b.and(lane, self.b.i32_const(wave_size - 1))(31 for Wave32, 63 for Wave64) in bothv_readlane_b32andv_writelane_b32.XS)31.
VIC-BT-031— v_writelane_b32 gates its destination write with EXEC, silently dropping SGPR spills to inactive lanes (P1)crates/victory-shader/src/emit/lower.rslines4217-4232v_writelane_b32andEXEC/guard(0 hits; #320 is CFG structurization and #659 is mesh v5).v_writelane_b32ignoresEXECcompletely so the compiler can spill SGPRs into any lane of a dedicated spill VGPR even inside divergent control flow where the target lane'sEXECbit is0.lower.rs:4217-4232writes the selected value usingint(self, r)which applies the currentEXECguard, silently dropping the write whenever the target lane is inactive and corrupting the spilled SGPR when restored later viav_readlane_b32.if/elsebranches where lane 0 takes theelsepath routinely spill SGPRs inside thethenbranch (whereEXEC[0] == 0) usingv_writelane_b32.v_mov_b32 v5, 0; s_mov_b32 exec_lo, 0xFFFFFFFE; v_writelane_b32 v5, 0xCAFEBABE, 0; v_readlane_b32 s0, v5, 0. Hardware restoress0 = 0xCAFEBABE; VIctory drops the write becauseEXEC[0] == 0and restoress0 = 0.select(lane_id == masked_lane, src0, old_vdst)result unconditionally tovdstinlower.rs:4217-4232, bypassing theEXECguard.v_writelane_b32is explicitly non-EXEC-masked. (Estimated size:XS)32.
VIC-BT-032— xgameruntime.rs & COM HLE vtables: Slot 0 (QueryInterface) wired to missing::<0> returning E_NOTIMPL across all GDK and DirectStorage COM objects (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.rslinesdstorage.rs:239,264,299,986; xasync.rs:991; xuser.rs:273; xgamesave.rs:908M)33.
VIC-BT-033— xgameui.rs: dialog::procedure dereferences GWLP_USERDATA without null check on WM_COMMAND (P1)crates/victory-hle/src/modules/xgameui.rslines216-229let entry = &mut *(wm::GetWindowLongPtrW(dialog, wm::GWLP_USERDATA) as *mut Entry);before even checking whether LOWORD(wparam) is IDOK or IDCANCEL. In Rust, creating&mut *null_ptris immediate UB regardless of whetherentryis later used.&mut Entryreference at line 217 before matching_ => return 0.&mut *(0 as *mut Entry)(UB / debug panic / crash).let ptr = wm::GetWindowLongPtrW(dialog, wm::GWLP_USERDATA) as *mut Entry; if ptr.is_null() { return 0; }(and only dereference inside the IDOK arm).S)34.
VIC-BT-034— xpackage.rs: XPackageUnregisterInstallationProgressChanged (slot 0x50) wired to missing::<10> returning HRESULT instead of bool (P1)crates/victory-hle/src/modules/xpackage.rslines270-284S)35.
VIC-BT-035— Host::execute() calls ID3D12CommandQueue::ExecuteCommandLists with 0 lists when runs is empty (P2)crates/victory-gpu/src/host.rs, crates/victory-gpu/src/queue.rslineshost.rs:500-543; queue.rs:114-128host_listsvia filter_map and callshost.execute(&host_lists)without checking whetherhost_lists.is_empty(). In host.rs (lines 500-543), Host::execute() builds an emptylistsVec and (when diagnostics timing is off) setsgroups = [&lists[..]]containing a single empty slice&[], then callsself.queue.ExecuteCommandLists(&[])at line 532. D3D12 specifies thatNumCommandListsmust be >= 1, causing debug-layer errors and undefined behavior on some drivers/vkd3d-proton.#[cfg(feature = "diagnostics")]and non-diagnostics branches of host.rs:515-527: in non-diagnostics (release) builds,groups = [&lists[..]]ALWAYS has length 1 even whenlistsis empty, soself.queue.ExecuteCommandLists(&[])is guaranteed to execute.runs.is_empty()(and skipExecuteCommandListsiflists.is_empty()).S)36.
VIC-BT-036— XMemAllocatePhysicalPages never recycles freed page numbers (monotonic next_page growth) (P2)crates/victory-hle/src/modules/xmem.rslines433-464next_pageandXMemFreePhysicalPagesrecycling (0 hits).XMemAllocatePhysicalPagesmonotonically bumpsphysical.next_page += n * FRAMES, whileXMemFreePhysicalPagesremoves entries fromphysical.pageswithout recycling the page numbers. If a title packs(number >> 4)into a 21-bit field (as documented at448-450), cumulative streaming churn exceeding 128 GiB wraps/truncates page numbers even with low peak live memory.XMemAllocatePhysicalPages/XMemFreePhysicalPagesproves unboundednext_pagegrowth past1 << 25.XMemAllocatePhysicalPages(2)+XMemFreePhysicalPages(2)1,048,577 times ->number >> 4 >= (1 << 21)while live pages == 0.free_pages: Vec<usize>(or interval free-list) inPhysicalpopulated byXMemFreePhysicalPagesand popped before incrementingnext_page.S)37.
VIC-BT-037— dstorage.rs: open_file clobbers GetLastError() via heap allocation before last_os_error() and omits FILE_SHARE_WRITE | FILE_SHARE_DELETE (P2)crates/victory-hle/src/modules/dstorage.rslines125-143handle as isize == -1and readingstd::io::Error::last_os_error()(line 140).std::io::Error::last_os_error()immediately afterhandle as isize == -1before formattingname, and passFILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE(7) to CreateFileW.S)38.
VIC-BT-038— image_get_resinfo returns 1 instead of 0 for unused depth channels on 1D / 2D / 1D-Array views (P2)crates/victory-shader/src/emit/lower.rslines5811-58265821-5822returnsone(1) whenever!present[ch]. Native RDNA2 (gfx1036,Leonida/tools/image_query_probe.py) returns0for unused depth words on 2D and 1D/1D-array views.Texture2D.GetDimensionsnever reads channel 2. Falsification: raw RDNA2 shaders issuingimage_get_resinfo dmask:0xFinspect channel 2 to distinguish 2D (0) vs 3D/Array (>0).image_get_resinfo v[0:3], v0, s[0:7] dmask:0xFon a 2D SRV -> expectedv2 == 0, observedv2 == 1.0forch < 3 && !present[ch], retaining1only forch == 3 && uav.XS)39.
VIC-BT-039— net.rs: resolvable() blocks the local machine's own hostname (gethostname) with WSAHOST_NOT_FOUND (P2)crates/victory-hle/src/modules/net.rslines179-192S)40.
VIC-BT-040— storage.rs: used_bytes() follows symlinks and Windows directory junctions via e.metadata(), risking infinite recursion or quota escape (P2)crates/victory-hle/src/modules/storage.rslines90-102e.metadata()(which dereferences symlinks and Windows directory junctions) instead ofe.file_type()(which reports reparse points asis_symlink()without traversing them), and recursively callsused_bytes(&e.path())without a cycle guard.mklink /J) inside the title's PLS directory pointing to its parent directory and call XPersistentLocalStorageGetSpaceInfo; process overflows the stack.let Ok(ft) = e.file_type()and skip entries whereft.is_symlink()(and iterate using an explicit stack rather than recursion), mirroring xcl's pls_used_bytes().S)41.
VIC-BT-041— v_fma_mixlo_f16 / v_fma_mixhi_f16 double-rounds through binary32 instead of single-rounding to binary16 (P2)crates/victory-shader/src/emit/lower.rslines4071-4098v_fma_mix. PR #683 covers missing old-dst fallback; PR #661 covers VOP3P neg; PR #78 covers inline constants; none address binary32->binary16 double rounding.4071computesfmadto binary32 then narrows vialegacyF32ToF16. Native RDNA2 (gfx1036) hardware measurements (Leonida/tools/fma_mix_probe.py) proved hardware rounds the exacta*b + conce, directly to binary16, differing by 1 f16 ULP on all 7 midpoint tie classes.fma_mix_probe.pytie inputs (1.0*1.0 + (2^-11 + 2^-30)->0x3C01hw vs0x3C00double-rounded).v_fma_mixlo_f16ona=1.0, b=1.0, c=0x3A000001-> expected0x3C01, observed0x3C00.fmad+ error term sticky bit) prior tolegacyF32ToF16.M)42.
VIC-BT-042— v_mad_f16 / v_mac_f16 conflated with fused v_fma_f16 and double-rounded through binary32 (P2)crates/victory-shader/src/emit/lower.rslines4538-4541v_mad_f16/v_mac_f16(0 hits).4541lowers both unfused (v_mad_f16/v_mac_f16) and fused (v_fma_f16/v_fmac_f16) ops identically to binary32fmad+legacyF32ToF16. Unfusedv_mad_f16must rounda * bto binary16 before addingacc; fusedv_fma_f16must single-round to binary16.a = 256.0h, b = 256.0h, c = -65504.0hoverflowsa*bto+infin unfusedv_mad_f16(+inf), whereas fusedv_fma_f16yields32.0h.v_mad_f16witha = 256.0h, b = 256.0h, c = -65504.0h-> expected+inf(0x7C00), observed32.0h(0x5000).v_mad_f16/v_mac_f16, rounda * bthroughlegacyF32ToF16->legacyF16ToF32before addingacc; forv_fma_f16/v_fmac_f16, apply round-to-odd before narrowing.S)43.
VIC-BT-043— v_mad_f32 / v_mac_f32 / v_mad_legacy_f32 omit unconditional subnormal flush before and after omod (P2)crates/victory-shader/src/emit/lower.rslines3925-3960v_mad_f32denorm. PR #682 only handles0 * denorm = 0inlegacy_mul; does not flush subnormals inv_mad_f32/v_mac_f32or aroundomod.gfx1010, RX 5600 XT,Leonida/tools/mad_denorm_probe.py, 48/48 cases),v_mad_f32,v_mac_f32, andv_mad_legacy_f32unconditionally flush subnormal inputs, products, sums, andomodoutputs regardless ofMODE.denorm32.(1.5*2^-126 - 2^-126) mul:2to returnFLT_MINinstead of+0.0.v_mad_f32 v0, 1.5, 0x00800000, -0x00800000 mul:2-> expected+0.0, observed0x00800000when denorms are kept.omodinv_mad*/v_mac*.S)44.
VIC-BT-044— write_f omod (mul:2/mul:4/div:2) preserves -0.0 instead of flushing -0.0 to +0.0 per RDNA2 hardware (P2)crates/victory-shader/src/emit/lower.rslines1792-1799omodand-0.0/flush(0 hits).Kajcsi/G6Recompdocs/shaders.md:764,1060;ProjectLeonidaL/leonidashader_validation.md:1970), applying VOP3 output modifiersomod(mul:2,mul:4,div:2) to-0.0flushes the sign bit to+0.0.lower.rs:1792-1799emits plain IEEEFMul(val, 2.0/4.0/0.5), which preserves-0.0, breaking downstream sign-bit checks,v_cmp_class, orcopysign/v_min_f32tie-breakers.-0.0vs+0.0rarely affects rendering outputs. Falsification: normal-map oct-encoding, shadow-map sign bits, andv_min_f32/v_max_f32(where-0.0 < +0.0on RDNA2) observe the sign of zero directly.v_add_f32_e64 v0, -0.0, -0.0 mul:2. On RDNA2 hardware,v0 == 0x00000000(+0.0); VIctory produces0x80000000(-0.0).omod != 0inwrite_f, flush-0.0to+0.0(e.g.select(bitcast(res) == 0x80000000, +0.0, res)orFAdd(res, +0.0)under strict float semantics).omod != 0. (Estimated size:XS)45.
VIC-BT-045— xsystem.rs: XSystemGetAnalyticsInfo reports family as 'Xbox' instead of GDK-documented 'Windows.Xbox' (P2)crates/victory-hle/src/modules/xsystem.rslines105-115family: text("Xbox"). Per Microsoft GDK documentation for XSystemAnalyticsInfo::family (and matching xcl's xgameruntime/mod.rs:278), Xbox consoles report "Windows.Xbox".form("Xbox Series X" / "Xbox Series S") or XSystemGetDeviceType() are unaffected, but engines usingfamilyfor platform branching expect "Windows.Xbox".family: text("Xbox")tofamily: text("Windows.Xbox")at xsystem.rs:109 and update unit test coverage.S)3. Prioritized Existing Canonical Backlog (150 Open Issues & Active PRs)
Deduplicated so open PRs targeting an open issue are grouped under the canonical issue rather than counted twice. Ranked by priority (
P0asset loading / rendering / crashes →P1Wave32 / CPU / VRAM / shader & tiling correctness →P2sync / audio / performance →P3hardening / tests).L97c78d1is not one program, not loops, not barriers; 77 compute pipelines refusedXSXSXSLLLXSLLLXSLXSXSXSLXSXSLLLLXSLLXSXSXSLXSLXSMLLXSXSXSLMLXSXSXSLMLXSXSLXSLXSLLXSLLLLXSLLXSXSXSLXSXSXSXSLXSXSXSXSMLLXSXSLXSXSMLXSLXSXSXSXSLXSXSLXSXSXSXSXSXSXSLLLXSXSLXSXSLXSXSLXSXSXSXSLXSXSLLXSXSXSXSXSXSXSXSLXSLXSLLLXSLXSLXSXSXSLLL@pickles976 on GitHub · 2026-11-24 17:48 UTC · original
Cross-checked two of the 45 against the sibling runtime (ivall/xcl → now xcl-dev/xcl) before anyone ports them blindly — both classes are absent here, which may help your dedup instincts on this list: ① VIC-BT-026 (raw VCC vs
vcc & exec): ours_cbranch_vccz/nztests the raw mask pair directly (emit.rs:642/977—mask_zeroreads the two SGPRs with no EXEC AND), so the raw-VCC reading is the implemented one on the sibling, matching your hardware claim — two runtimes converging on raw-VCC raises confidence for the fix. ② VIC-BT-040 (quota walk following symlinks/junctions): our PLS accounting (xgameruntime/mod.rs:pls_used_bytes) skips every reparse point before any metadata call, leaning onDirEntry::file_typereporting all name-surrogate reparse points (symlink and junction) asis_symlinkwithout dereferencing — one comment line of hardening and the recursion/quota-escape class is structurally gone; worth copying verbatim since yourused_bytes()has the same surface. ③ FYI on VIC-BT-030/031: they duplicate in-flight #1044 and the claims here are the opposite of #1044's headline (EXEC gating writelane; masking the lane selector) while matching xcl's implemented behavior — whichever way the GPU matrix in #1044 lands, all three should be closed together on one measurement rather than three guesses.@Marvisak on GitHub · 2026-11-25 10:13 UTC · original
Automated triage for the maintainers.
Thanks for the audit. 22 separate findings plus a 150-row backlog can't be confirmed or closed as one issue. Each finding should be a pull request (open to everyone now) with its test, or a separate issue. This issue stays open as the index (with Part 1, #1242). Status checked on
main:unregister_progressat vtable slot0x50incrates/victory-hle/src/modules/xpackage.rs.crates/victory-shader/src/structure.rs,s_cbranch_vccz/vccnztestvcc & exec. Open PR #1336 changes this.OpenFile), #1928 (used_bytesjunctions), #2001 (local hostname), #1941 (analytics family), #2159 (VOP3 conversion modifiers).The other items are not verified here. A failing test against current
mainis the quickest way to settle each one.Generated by Claude Code