Commit Graph

4907 Commits

Author SHA1 Message Date
b9320a118d Merge pull request #1812 from kirigayakazima/fix/bcpack-bptc-safety
tools: harden bcpack_tables_bptc.py section validation, bounds and file cache
2026-11-25 18:36:10 +01:00
360c728bde Merge pull request #1793 from kirigayakazima/fix/ps-helper-probe-safety
tools: guard ps_helper_probe.py empty coverage and atomic --json writes
2026-11-25 18:35:17 +01:00
fd33a31a22 Merge pull request #1815 from kirigayakazima/fix/script-qtable-atomic-json
tools: make script_qtable.py --json writes atomic and validate paths and hex stems
2026-11-25 18:34:28 +01:00
1f62a9c368 Merge pull request #1817 from kirigayakazima/fix/gamedata-sps1-atomic-json
tools: make gamedata_sps1.py --json writes atomic, validate paths and avoid duplicate index read
2026-11-25 18:33:39 +01:00
a8266e3f8a Merge pull request #1852 from kirigayakazima/fix/int-hw-probe-safety
tools/int_hw_probe: write --json atomically and reject trailing-separator paths
2026-11-25 18:32:42 +01:00
082ebe4406 Merge pull request #1853 from kirigayakazima/fix/ab-control-flow-safety
tools/ab_control_flow: handle UTF-8-SIG/CRLF inputs, subprocess encoding and atomic outcomes.tsv
2026-11-25 18:31:39 +01:00
b0e11f234a Merge pull request #1807 from kirigayakazima/fix/pal-stages-safety
tools: handle corrupt XBCH zlib, case-insensitive extensions and index errors in pal_stages.py
2026-11-25 18:29:48 +01:00
aeec1ddc6f Merge pull request #1850 from cheltyi/fix/gamedata-empty-typed-objects
gamedata_reader: preserve empty polymorphic objects (GAMEDATA-EMPTY-TYPED-OBJECTS)
2026-11-25 18:28:59 +01:00
fe1553456f Merge pull request #808 from whoalin1/shader-structured-pc-unwrap
cfg_structure / rdna2spirv: unwrap tautological %pc guards in structured CFGs (ms_wave_info_s3 AMD crash, SHADER-STRUCTURED-PC-UNWRAP)
2026-11-25 17:46:31 +01:00
3a84ae7aa8 tools/ab_control_flow: handle UTF-8-SIG/CRLF inputs, subprocess encoding and atomic outcomes.tsv 2026-11-25 21:10:56 +08:00
71c86830f5 tools/int_hw_probe: write --json atomically and reject trailing-separator paths 2026-11-25 21:08:25 +08:00
6e85823da4 gamedata_reader: preserve empty polymorphic objects 2026-11-25 16:05:38 +03:00
597cf76623 TOOLS-WINE-GAME-RUN: scripts/run_game_wine.sh, one bounded game run under Wine
The launcher runs gta6rt.exe --run once under Wine on Linux, headless on a
private kwin_wayland --virtual --xwayland session (Xvfb has no DRI3, so RADV
cannot present there) or on the current display with --visible. Sound is off
(Wine's audio drivers disabled, Pulse/PipeWire/ALSA pointed at nothing,
LEONIDA_AUDIO=silent for the runtime's silent output endpoint), --device pins
the Vulkan device through MESA_VK_DEVICE_SELECT, and a hard time limit, a lock
and full teardown bound the run. Every path comes from arguments or the
environment.

tools/game_run_summary.py prints counts only: run time, end, exceptions by
code, D3D12 calls by outcome, presents, the top failing calls and the [rt]
lines by category with numbers masked. It never prints a log line.

Tests need no game, Wine or GPU: the script against stubs, the summary on
synthetic run folders. docs/linux_proton.md describes the script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:30:48 -05:00
def89c3aa5 tools: make gamedata_sps1.py --json writes atomic, validate paths and avoid duplicate index read 2026-11-25 20:29:24 +08:00
59eadb0be5 tools: make script_qtable.py --json writes atomic and validate paths and hex stems 2026-11-25 20:27:21 +08:00
81e34a5695 tools: harden bcpack_tables_bptc.py section validation, bounds and file cache 2026-11-25 20:25:15 +08:00
abe47df11e tools: handle corrupt XBCH zlib, case-insensitive extensions and index errors in pal_stages.py 2026-11-25 20:21:02 +08:00
a759e1ebc6 tools: guard ps_helper_probe.py empty coverage and atomic --json writes 2026-11-25 20:14:04 +08:00
be6301be99 Merge commit 'refs/tmp/main' into HEAD 2026-11-25 05:12:31 -05:00
57ba40bd6d Merge pull request #1493 from ubiquitarianism/claude/valu-literal-sext
Merging.

**Why merged**
- Fixes a real translator bug: the 32-bit literal of signed 64-bit `v_cmp(x)_*_i64` (and the other signed 64-bit VALU forms this PR covers) was zero-extended instead of sign-extended, so comparisons against negative literals gave wrong results.
- Independent checks:
  - approved by tiguan26;
  - KEEP from ytsodacan's review;
  - independent hardware verification by ecox982745 on an RTX 4090: the parent gave 444 wrong results out of 2,016 lane outputs, this head gives 0, and the unsigned controls are unchanged.
- Re-tested here merged onto current main (3de22a190) on an RTX 4070 SUPER:
  - the merge is clean;
  - `tests/semantic` VALU/VCMP files plus the PR's new test: 1,483 passed, 21,175 subtests passed, 0 failed;
  - the full semantic suite on 604ddff0b: 6,287 tests, 0 failed (main: 6,279);
  - the PR's new test fails 5 of 8 against main's translator, as a control;
  - the consistency set is the same as main, whose only failure is the pre-existing `test_runtime_paths` workflow check.

**Why it's good**
- The change is small and scoped: `valu_imm_i64`/`src64_i64` are applied only to the signed 64-bit forms, and the unsigned paths are untouched.
- It comes with a regression test pinned to the exact encodings.
- Wrong signed compares silently steer branches and masks in translated shaders, so this removes a class of hard-to-trace wrong results.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-25 05:01:35 -05:00
ba626820ec Integrate post-story-load memory, queue and Vulkan runtime changes
Preserve physical window aliases across remaps, order console list values,
and replay bounded indirect graphics with captured draw state. Coordinate
pipeline lifetime, texture refresh and queue teardown. Add synthetic CPU
and GPU coverage for the integrated paths.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 03:44:43 -06:00
33431d6fe5 fix(wave64_emulate_opt): refuse exec-fold regions containing a trailing conditional branch
A block with len(raw_edges[u]) == 1 ending in a conditional branch (no
fallthrough block, so falling through writes %pc = len(blocks) = END)
cannot safely sit inside a folded s_cbranch_execz/nz region whose exit
unconditionally sets %pc = skip.

Reject such blocks during the region walk in find_local_exec_folds
(matching the existing
ot succ[u] check) and add semantic regression
tests covering both s_cbranch_scc1 X and s_cbranch_scc1 skip in
structured and --dispatch-loop --wave64-emulate modes.

Co-Authored-By: Gemini 4 Neon <noreply@google.com>
2026-11-25 10:06:01 +02:00
98efc22ca3 Merge pull request #1064 from Moriz82/split/rt-direct-heap-compute
d3d12: supply directly indexed heaps to compute dispatches (RT-DIRECT-HEAP-COMPUTE)
2026-11-25 04:25:38 +01:00
275cb01456 Merge main into carry/old-9921-ms-compressed-exports (after #1197)
- tools/rdna2spirv.py, mesh_export: #1197's misc-vector return for pos1
  (Layer/ViewportIndex) comes first, then this pull request's compressed
  components; both kept.
- docs/design.md, "Mesh shaders" row: main's row (with #1197's sentence)
  plus this pull request's compressed-export sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:14:11 -05:00
2fc4224cda Merge commit 'b07b9ecb0' into HEAD 2026-11-24 22:10:21 -05:00
5115f08879 Merge main into RT-DIRECT-HEAP-COMPUTE (#1064)
main already supplies the directly indexed heaps to compute dispatches (integration #984, the tree this
pull request was split from): with_direct_heaps()/compute_user_data() on Dispatch and the ExecuteIndirect
dispatch path, RootArgumentLayout::compute_arguments_end (kNoSgpr for a spilled signature),
LEONIDA_COMPUTE_DIRECT_HEAPS=0, and the first form of this test (direct dispatch, indirect after a
resource-only rebind, the GPU read through the heap). That form stays. What this pull request adds beyond
it is carried onto it: the review-round reports, the extra recorded-argument checks, the census tool and
its evidence.

Conflicts:
- runtime/shims/d3d12_com.cpp: main's with_direct_heaps()/compute_user_data() and its one-argument
  note_direct_heap_indexing(). Carried: compute_user_data() makes the note itself, so an ExecuteIndirect
  dispatch with no heap bound is reported too (record_dispatch's own call removed), and a heap with no
  inline dword left is reported once per heap kind ("compute root arguments leave no inline SGPR for the
  resource/sampler heap"); a spilled signature (main: kNoSgpr) gets one note of its own. Dropped: the PR's
  GetEnvironmentVariableA switch (main's direct_heaps_enabled) and its "graphics heap-base SGPR is not
  supplied" notes (main supplies the graphics heaps).
- runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (compute_arguments_end and
  graphics_arguments_end with their comment; compute_arguments_end only when the compute arguments do
  not spill).
- runtime/test/glsl/cs_user_data.comp: main's; its direct-indexing mode (s5 = 0xFFFFFFFC, heap at s9)
  is this pull request's, byte for byte.
- runtime/test/d3d12_compute_test.cpp: the PR's block replaces main's earlier form of it (a superset:
  adds the bundle dispatch that inherits the parent's heaps, an indirect dispatch with only the sampler
  heap, signatures ending at s30 and s31, and the LEONIDA_COMPUTE_DIRECT_HEAPS=0 expectations).
- docs/d3d12_vulkan.md: main's section 3.4 (the BatchCull s7 and PreSkin s9 evidence), with the PR's
  census paragraph (tools/compute_heap_layout_census.py, the seven paired layouts, the heap order as a
  hypothesis) and the no-room and spill reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:09:38 -05:00
b07b9ecb09 Merge pull request #974 from iFeyz/feat/d3d448-graphics-root-layout
D3D-448-GRAPHICS: graphics root arguments in the console layout, mesh shaders through a window
2026-11-25 04:00:46 +01:00
50740a1bc5 Merge main into carry/old-9921-ms-compressed-exports
The "Mesh shaders" row of docs/design.md changed on main (#802); the
compressed-export sentence is added to main's version of the row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:55:03 -05:00
f78385646c Merge pull request #802 from whoalin1/shader-ms-clip-iface
rdna2spirv: list %ms_cull before %ms_out_vtx in OpEntryPoint MeshEXT (AMD LLPC crash, SHADER-MS-CLIP-IFACE)
2026-11-25 03:46:59 +01:00
b8563e949e Merge main into D3D-448-GRAPHICS (#974)
main already lays graphics root arguments out in the console layout (from s8, one dword per table: #939's
graphics-root-layout patch in #984's form, pack_stage(Stage::Pixel), RootArgumentLayout::graphics_console,
graphics_arguments_end, LEONIDA_GRAPHICS_STAGE_LAYOUT=0 for pack()). That form stays. What this pull request adds
beyond it is carried onto it: the mesh-shader root window (translator, index "root_window", mesh_ok, the two
refusals) and its tests. Its own graphics spill handling (Spill::block) and LEONIDA_GRAPHICS_ROOT_LAYOUT=pc are not
carried: main keeps pack()'s s0 layout for a graphics signature past s31, and its switch does what =pc did.

Conflicts:
- runtime/src/root_signature.h, root_signature.cpp: main's pack_stage (compute spill array, spill_dword); the
  Spill enum, first_spilled and spilled_dwords dropped. The header keeps the PR's evidence note, with Stage::Pixel.
- runtime/shims/d3d12_com.h: main's comment and members, with the mesh window described; mesh_ok added (false by
  default, set only for a console-layout signature that Stage::Mesh also places); the PR's second graphics_console
  dropped.
- runtime/shims/d3d12_vulkan_device.cpp (CreateRootSignature): main's pixel/packed form; the PR's Stage::Mesh pack
  and its log line added, mesh_ok = pixel.ok && mesh.ok. The mesh-shader refusal without "root_window" (no
  conflict) stays.
- runtime/shims/d3d12_com.cpp: DispatchMesh keeps main's any_nonempty_viewport() and graphics_user_data() after the
  PR's mesh_ok check; address() keeps main's comment. The PR's kNoSgpr guard in constants()/address() stays,
  reworded: in main a spilled compute parameter has first_sgpr kNoSgpr, and kNoSgpr + offset wrapped round to s0.
- runtime/src/shader_library.h: both (main's wave64_graphics, the PR's root_window).
- runtime/test/d3d12_mesh_test.cpp: main's mesh shader-kind byte on both containers (also the PR's ms_old); the
  PR's two-parameter signature replaces main's 25-dword padding onto the s0 layout; both test blocks kept (the
  PR's window refusals, main's DISPATCH_MESH command signature), each in its own scope. The =pc case is dropped
  (main's switch is read once per process).
- runtime/CMakeLists.txt (no conflict): the mesh test uses ps_draw.spv again; the ps_draw_s0.spv rule is gone.
- runtime/test/glsl/ps_draw.frag, vs_depth.vert, vs_draw.vert, vs_draw_int.vert, ps_depth_write.frag and
  runtime/test/shaders/ps_m15, ps_m2, ps_m2_array, ps_m2_literal, ps_m2_uoff, ps_m3, ps_m3_post, ps_m3_query,
  vs_m15, vs_m3 (.asm): main's (the same s8 rewrite done twice); ps_draw.frag's mesh-test note updated.
- runtime/test/root_signature_test.cpp (no conflict): the Spill::block cases dropped, the window cases kept.
- docs/design.md: main's rows (loop guard, direct resource heap) and the PR's user-data row.
- docs/d3d12_vulkan.md (no conflict): section 3.5 and the CreateRootSignature bullet rewritten for main's form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:44:23 -05:00
2213d5cb8f Merge pull request #1287 from anonymechab-droid/fix/literal-mad-denorm
rdna2spirv: flush literal MAD denormals (SHADER-LITERAL-MAD-DENORM)
2026-11-25 03:38:58 +01:00
82f033512c Merge pull request #1110 from klikso/carry/shader-w64-sink-race
rdna2spirv: wave64 emulation resets shared words with OpAtomicStore (SHADER-W64-SINK-RACE-CARRY)
2026-11-25 03:38:02 +01:00
85ece68470 Merge pull request #1400 from Okachamie/fix/dpp-absent-source
rdna2spirv: guard native DPP FI=0 shuffle source (SHADER-DPP-ABSENT-SOURCE)
2026-11-25 03:37:13 +01:00
71424b5df4 Merge pull request #1216 from breachato/feature-scan-shared-report-path
Merging.

**Why merged:** feature_scan uses the shared report_paths guard instead of its own same_path, which had no other callers.

**Why it's good:** Own tests: 45 passed, 1 skipped.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 21:36:26 -05:00
f6f56dfdec Merge pull request #1005 from thesubtleties/f64-diff-fixup-ref
Merging.

**Why merged:** The f64_diff reference for v_div_fixup follows the gfx1036 hardware measurement in the one case where it differed.

**Why it's good:** Own tests: 32 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 21:36:14 -05:00
92415c39e6 Merge pull request #1345 from IlyassRS3/fix/pe-inspect-delay-va-thunks
Merging.

**Why merged:** pe_inspect resolves delay-import thunks given as VAs as well as RVAs.

**Why it's good:** Own tests: 60 passed, 1 skipped.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 21:35:50 -05:00
0c3c56b9e9 Merge pull request #1315 from fin-github/codex/exe-sha-source
Merging.

**Why merged:** exe_sha credits gain an --expect check, so a run against the wrong executable says so instead of crediting it.

**Why it's good:** Own tests: 14 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 21:35:24 -05:00
bc2d333495 rdna2spirv: sign-extend the 32-bit literal of v_cmp(x)_*_i64, v_ashrrev_i64, v_mad_i64_i32 (SHADER-VALU-LITERAL-SEXT)
LLVM's operand syntax widens a 32-bit literal in an i64 operand by sign
extension and in a u64/b64 operand by zero extension. llvm-mc prints -100
as 0xffffff9c, and the vector ops zero-extended that printed form, so
v_cmp_lt_i64 5, 0xffffff9c gave 1, v_ashrrev_i64 4, 0xffffff9c gave
0x0ffffff9:0 and v_mad_i64_i32 1, 1, 0xffffff9c had a zero high word.
The signed sources now go through Gen.valu_imm_i64; the u64/b64 ones
(v_cmp_*_u64, v_lshlrev/lshrrev_b64, v_mad_u64_u32) still zero-extend,
and f64 literals keep their high-word rule. Vector half of #978.

Tested: new tests/semantic/test_valu_signed_literal64.py (decimal, printed
hex and explicit pair agree; unsigned, positive-literal and inline-constant
controls) fails 5/8 on main and passes 8/8; full semantic suite 476 files /
6223 tests before, 477 / 6231 after, 0 failures; repo-consistency pytest
set 578 passed, 5 skipped; compileall clean. CPU only, no hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 20:45:56 -05:00
8e5cf5aef1 fix(rdna2spirv): include END in out_pcs for trailing conditional branches
A conditional branch in the last basic block (no fallthrough block, so
len(raw_edges[b]) == 1) emits OpSelect(%cond, tgt, len(blocks)) and can
leave %pc at either tgt or cfg_structure.END.

Compute exact per-block out_pcs in rdna2spirv._block_out_pcs (matching
wave64_emulate_opt), pass it through capped_tree() into both
cfg_structure.structure() (so single-target fall-off-the-end blocks also
keep their dominated target guard) and unwrap_known_pc_guards(), and
pass compact_out_pcs into cfg_structure.structure() in wave64_emulate_opt.

Add unit and semantic regression tests covering both the loop back-edge
repro reported in review and the non-loop dominated-target variant.

Co-Authored-By: Gemini 4 Neon <noreply@google.com>
2026-11-25 03:41:00 +02:00
53ef382d70 cfg_structure: document why loop entry keeps cur_pc | {h} in unwrap_known_pc_guards
Co-Authored-By: Gemini 4 Neon <noreply@google.com>
2026-11-25 03:40:21 +02:00
0681b9d280 cfg_structure / rdna2spirv: unwrap tautological %pc guards in structured CFGs (ms_wave_info_s3 AMD LLPC crash)
cfg_structure.structure() wraps post-dominating join blocks after a diamond or loop in a ('guard', g, ...) node even when %pc == g is tautologically true on every incoming path. wave64_emulate_opt._unwrap_known_pc_guards already unwraps these guards for --wave64-emulate, which is why ms_wave_info_s3 passed on 32-wide NVIDIA GPUs while crashing with 0xC0000005 on native wave64 AMD RDNA2 Windows (driver 24.10.24, LLPC) where blk2's OpControlBarrier stayed trapped inside a conditional OpBranchConditional.

Move unwrap_known_pc_guards into tools/cfg_structure.py (reused by wave64_emulate_opt with zero duplication) and apply it in rdna2spirv.capped_tree() so both assemble() and needs_barrier_rounds() see post-dominating join blocks at top level.

SHADER-STRUCTURED-PC-UNWRAP

Co-Authored-By: Gemini 4 Neon <noreply@google.com>
2026-11-25 03:40:21 +02:00
38bd89d44e Merge the #984 result as of 71a783e56 into the #939 merge
Fourteen commits the #984 merge gained after 8a242efeb: its own failing tests (xmem_test under Wine, check_tls_index0, vk_bindless_grow, xs_present_lazy_test), the console-heap probe and the poke experiment behind their switches, Python tool fixes, and the title watchdog default. No conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:37:26 -05:00
154e4ec034 Merge the #984 result (main + RT-PROTON-STORY-LOAD) into #939
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.

A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.

A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.

B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.

B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).

C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.

D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.

E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:26:00 -05:00
709acc2fb3 mem_diff.py: the reference model addresses memory as the translator now does
#984 changed how a buffer's device address is formed: the low 48 bits of the effective VA are sign-extended before the heap base is added (Gen.host_addr, the 'Heap-relative buffer device addresses' row in docs/design.md), because a V# base is device_address - heap_base in 48 bits and is negative for an import below the heap. The memory differential fuzzer's reference machine still put a base with bit 47 set at the zero-extended address, so every case with such a base read zeros on the translated side: tests/test_mem_diff.py failed in nine families (on #984's head too).

The fuzzer has one function for where a VA is in memory, host_address, used by the reference machine's reads and writes and by the generator's seeding. The cases, the seeds and the interpreter are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:11:33 -05:00
100fed1b3d #984's Python tools: encoding=, the stdout guard, and --help that writes no file
Three conventions main's tests enforce and #984's new tools missed (all three tests fail on #984's head):

- tests/test_text_encoding.py: tools/build_dstorage_history.py read its stamp and its base history, and tools/dstorage_census.py its trace, in the locale's code page. They name UTF-8 now.
- tests/test_tool_stdout_encoding.py: the __main__ blocks of build_dstorage_history.py, dstorage_census.py, gen_bcpack_runtime_tables.py and scripts/translate_pipeline_compute.py did not set errors='replace' on stdout.
- tests/test_tool_startup.py runs every tool with --help. gen_bcpack_runtime_tables.py took its first argument as the output path whatever it was, so the test passed and left a 61 KiB file named '--help' in the working directory. The tool has an argument parser now (the tables file, or --profile JSON OUT, as before); the generated tables are byte-identical.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:09:32 -05:00
c17604dfe1 build_dstorage_history.py: name the line ending of its text writes
#984's tool wrote history.json, the generated tables and the signature stamp as text without newline=, so the bytes differed between Windows and the other platforms; tests/test_text_write_line_endings.py fails on that (on #984's head too). All four writes are UTF-8 with LF now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:45:17 -05:00
39879ce0fd Merge main into RT-PROTON-STORY-LOAD (#984)
Merges main at 1154976d4 into the integration branch at 273b3bdf9 (merge base ece4ba5b3). 42 files conflicted;
this commit is the resolution only. Build and test repairs follow in their own commits.

Rule of resolution: where both sides added different things, both stay; where both made the same change in two
forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two
changed the same code for different purposes, both purposes are kept.

Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, registry.cpp):
- d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device
  routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device
  slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the
  console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and
  list slot 139 (#396).
- Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's
  completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is
  attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider
  pc_resource_desc, S_OK for queue slots past the PC table.
- Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its
  undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base
  list proxy, its null-view slot 70 and its refusing slot 133.

Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp):
- Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra
  cases added; main's --env-slots-74 and #984's --env-slots-70.
- Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy,
  the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases.

D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h,
frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp,
d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp,
vk_pipeline_check.cpp, vk_test_device.h):
- Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's
  ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's
  origin, so both pools run on disjoint sets of textures.
- frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter.
- main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4
  stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980).
- shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it.
- Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count
  refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it.

Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp,
runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp):
- ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on
  ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file.
- gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries.
- Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped.

Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1,
make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py,
runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md,
runtime/README.md):
- Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake.
- rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's
  restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped.
- shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags.
- shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants.

One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC
compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:38:04 -05:00
355fe0c62e rdna2spirv: list %ms_cull before %ms_out_vtx in OpEntryPoint MeshEXT (AMD Windows LLPC crash)
AMD's proprietary Windows Vulkan driver (24.10.24, LLPC) segfaults (0xC0000005) during vkCreateGraphicsPipelines whenever a MeshEXT shader lists a Block-decorated per-vertex output struct with ClipDistance/CullDistance (%ms_out_vtx) before the Block-decorated PerPrimitiveEXT CullPrimitiveEXT output (%ms_cull) in OpEntryPoint's interface list (even glslangValidator's own GLSL output with gl_ClipDistance + gl_CullPrimitiveEXT hits the same crash).

Listing %ms_cull before %ms_out_vtx/%ms_out_pos in OpEntryPoint fixes ms_clip on AMD Windows RDNA2 (0xC0000005 -> 2048/4096 covered pixels exact, 0 validation errors) while keeping %ms_cull_blk in its Block+bool form required by SPIRV-Tools <=2025.1 (SHADER-30).

SHADER-MS-CLIP-IFACE

Co-Authored-By: Gemini 4 Neon <noreply@google.com>
2026-11-25 02:11:05 +02:00
364ab4eabb Merge pull request #985 from Tyrannys/fix/reanchor-from-llvm-offsets
Merging.

**Why merged:** SHADER-REANCHOR-LLVM-OFFSETS: shader_ir parses llvm-mc's "invalid instruction encoding" column offsets. rdna2spirv anchors on those exact offsets only when every rejected word has a parsed offset; otherwise it keeps the old forward search. Reviewers:
- morodirule: 2 of the 3 new cases fail on the old translator;
- KernelSmoker: semantic suite 471 files / 6168 tests, 0 failed;
- towade: on a full pipeline library, 2,608 programs translate versus 2,599 before, all pass spirv-val, and none are lost;
- madhyn: 3/3.

**Why it's good:** this changes translator output, so I held it for the full semantic suite. On Windows 11, cumulative with this batch on main e0b08c77d: 476 files / 6219 tests. The single failing file is `test_image_cube_store_glc`, which also fails on main (475 / 6216) because llvm-mc is given a Windows path here (#837). So the only difference is this PR's own new file, and nothing regressed. Its own tests: 3 passed. The repo-consistency set gives 578 passed / 5 skipped / 0 failed, and full ctest on the cumulative build is 317/318 (only the pre-existing d3d12_depth_resolve). git merge-tree against current main: no conflicts. Security read: no new tools file, no binaries, downloads or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 18:42:47 -05:00
26fabdbba8 rdna2spirv: guard native DPP FI=0 shuffle source 2026-11-24 18:27:48 -05:00