Commit Graph

5744 Commits

Author SHA1 Message Date
81647000cc Merge pull request #950 from Bushyon 2026-11-22 00:33:14 -05:00
3a88593f1e Merge pull request #949 from spider 2026-11-22 00:33:14 -05:00
96b9913afe Merge pull request #946 from Vonsek 2026-11-22 00:33:13 -05:00
68f76efe18 Merge pull request #944 from bobcatchris 2026-11-22 00:33:13 -05:00
4730befe4d Merge pull request #942 from nicolas 2026-11-22 00:33:13 -05:00
f8bd0102d9 Merge pull request #932 from RCGV1 2026-11-22 00:33:11 -05:00
67cb3cd6ea Merge pull request #931 from nicolas 2026-11-22 00:33:11 -05:00
6d6301c1b5 Merge pull request #919 from bobcatchris 2026-11-22 00:33:09 -05:00
fd37191dc1 Merge pull request #911 from 465d6a0eac 2026-11-22 00:33:08 -05:00
0aab7326d3 Merge pull request #903 from gabrielsteglich 2026-11-22 00:33:06 -05:00
ac93feef4e Merge pull request #897 from Vonsek
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 00:33:04 -05:00
b7ec22e798 Merge pull request #890 from nicolas 2026-11-22 00:33:00 -05:00
7b51dbd9d8 Merge pull request #888 from enx 2026-11-22 00:33:00 -05:00
3fa09d21df Merge pull request #885 from AvantBras 2026-11-22 00:32:59 -05:00
a5a25080df Merge pull request #882 from oVolkra 2026-11-22 00:32:59 -05:00
d9efcd366b Merge pull request #879 from kotorvr 2026-11-22 00:32:59 -05:00
6481dad72a Merge pull request #867 from nicolas 2026-11-22 00:32:57 -05:00
f3d2823ac2 Merge pull request #864 from omardev29 2026-11-22 00:32:57 -05:00
d2a3949e75 Merge pull request #863 from SuarezPM 2026-11-22 00:32:56 -05:00
944d75bf5a Merge pull request #775 from JavierBlanco23
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 00:32:53 -05:00
7a406ccfc0 Merge pull request #763 from cemalyakla 2026-11-22 00:32:51 -05:00
3400c5659d Merge pull request #742 from totonii 2026-11-22 00:32:51 -05:00
abbedcc57e Merge pull request #706 from cemalyakla 2026-11-22 00:32:50 -05:00
fb06ce420e Merge pull request #494 from shelbykb2 2026-11-22 00:32:50 -05:00
61bcc969c4 D3D-86: answer CheckFeatureSupport OPTIONS2-5, 7, 9, 11, 13-16, 18-21 2026-11-22 06:29:05 +01:00
dd4a2f549a Guards: ignore and detect the model, audio and world files the build writes
The export stages write .obj models, .glb chunks, .ogg Opus and .wav PCM
straight from the package, but .gitignore and the No Game Data check only
named the archive, shader and texture types. A run pointed inside a checkout
could leave those untracked and get them staged; the check would also miss a
force-added one, along with .r9modeldata and .msixvc that .gitignore already
covers.

The bvh and navmesh examples also wrote their index reports into the working
directory, which puts game-derived JSON and CSV in the tree; point them at
<temp> like the movies note does.

Verified with git check-ignore on every new pattern and by matching sample
filenames against the workflow regex. Docs and ignore rules only.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:27:15 -06:00
5826a60187 fix: apply sampler LOD bounds to emulated gathers
Explicit-LOD gathers use four texel fetches that bypass the Vulkan sampler. Decode its 4.8 LOD bounds before selecting the mip so clamped gathers agree with a sampler-backed draw.
2026-11-22 06:25:26 +01:00
1293cc2656 Translator: hardware NaN rules for float min/max/med3, v_fract below 1.0
Measured on an AMD Radeon RX 6800 (gfx1030) with the hw-oracle tool from the
AnyPS5 project, all four IEEE/DX10_CLAMP combinations, wave32 and wave64:

- v_min/v_max f32/f16, each half of v_pk_min/max_f16, and v_min3/v_max3 now
  emit NMin/NMax (one NaN operand gives the other) instead of FMin/FMax.
- v_med3_f32/_f16: FClamp(z, NMin(x,y), NMax(x,y)), and with OpIsNan of each
  operand that can be a NaN, select NMin(NMin(x,y), z) (hardware: min3 when
  any operand is NaN). Non-NaN constants get no check; no select when none.
- v_fract_f32: Fract, then 1.0 -> 0x3f7fffff by compare and select (the NaN
  of fract(+-inf) is kept). v_fract_f16: the same, then a packed 0x3c00 ->
  0x3bff (not after an output multiplier).

Other FMin/FMax/FClamp uses (clamp bit, LOD and conversion clamps) are
unchanged. GPU fixtures ps_fnan_med3 and ps_fnan_fract read their inputs
from memory; on the RX 6800 the two med3 words differed before this change.
tests/semantic/test_float_nan_fract.py runs the measured rows; both
interpreters gain NMin/NMax, and spirv_mini_interp OpIsNan and exact Fract.

tests/semantic/test_alu_med3.py (merged after this branch was cut): its float
reference used Python min/max, which return the first argument for equal
zeros. Hardware orders -0 below +0 (RX 6800: med3(-0, +0, 1.0) = +0,
med3(+0, -0, -1.0) = -0 in every operand order), so the reference now sorts
with that order, and spirv_mini_interp's FMin/FMax/FClamp order zeros the same
way as its NMin/NMax.

Rebased onto 8df277f. Two upstream tests were written against the old
behaviour and are updated: tests/semantic/test_valu_f32_min3_max3_mad.py
(its min3/max3 reference used first-operand order for mixed zeros, and its
negative control replaced FMin/FMax; now -0 < +0, as measured on the RX 6800,
and the control swaps NMin/NMax) and tests/semantic/test_valu_f16_round.py
(it asserted that the interpreter rejects Fract; it now asserts the value).
Upstream had added an OpIsNan/OpIsInf branch to spirv_mini_interp, so this
commit's own OpIsNan branch is dropped (it shadowed upstream's). docs/design.md
notes that an output modifier on v_fract_f16 is applied before narrowing to
f16, an order not measured on hardware.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:25:05 -07:00
e3e4014af8 Docs: the measured f32 denormal and special results of rcp/rsq/sqrt/log/exp/rcp_iflag 2026-11-22 02:18:08 -03:00
a030e18ef6 Docs: note the Dozen device order and LEONIDA_VK_DEVICE
The Compatibility Pack lists Mesa's D3D12 layer as a second discrete GPU. The
harnesses now prefer a native ICD (#915), and LEONIDA_VK_DEVICE selects one
explicitly, so record both next to the other known problems.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:11:58 -06:00
060ddedb4c lane_masks: track v_mad_u64_u32 and v_mad_i64_i32 sdst as lane masks
v_mad_u64_u32 and v_mad_i64_i32 write their 64-bit carry/sign output sdst (a[1]) via mask_dst in rdna2spirv.py, matching *_co_* vector carry ops, and shader_meta.py already groups them together. lane_masks.step() only checked '_co_' in op, causing whole-wave mask consumers (s_bcnt1_i32_b64, s_ff1_i32_b64, v_mbcnt) to treat sdst as plain per-lane data and produce divergent SGPR results (e.g. 64 in carrying lanes and 0 in non-carrying lanes).

Verified on CPU with tests/test_lane_masks.py, tests/semantic/test_alu_mad64.py (including 64-lane wave64 s_bcnt1_i32_b64/s_ff1_i32_b64 tests) and tests/semantic/test_wave64_scmp_masks.py.
2026-11-22 01:10:12 -04:00
8fa6b89f4c World names: whole-archive coverage, --archetypes-out and --rpf9-names
docs/world.md and docs/world_names.md said ~96% of archetypeName hashes stay
unresolved. That was a name-source limit of the two sampled windows: the
names are in levels.rpf, and rpf9_names.py already lists them. With its
name.#dr/name.#ft list as the dictionary, 99.85% of the 1,670,435 placement
entities resolve (99.94% with --max-inflate 256 MiB), every match verified by
the entity's 64-bit key.

- world_index.py --archetypes-out writes the aggregate archetype file that
  world_names.py resolve --archetypes reads (entity count and 64-bit key per
  hash); nothing in the repo produced it before. Entities of a resource that
  needs a continuation stream are counted once.
- world_names.py build --rpf9-names reads rpf9_names.py index JSON.
- docs: whole-archive coverage table, the four commands that reproduce it,
  and the corrected statements in world.md and docs/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:10:01 -05:00
738249fd93 rdna2spirv: translate v_cmp_nlg and v_cmpx_nlg for f32 and f16
Add nlg -> OpFUnordEqual (x == y or either source is NaN) to Gen.compare(), completing all 16 IEEE-754 RDNA2 VOPC float predicates (confirmed against LLVM gfx10_asm_vopc.s and RDNA2 ISA VOPC).

Verified on CPU with tests/semantic/test_float_compares.py (e32/e64 f32, f16 and v_cmpx_nlg) and tests/semantic/test_vopc_const_ordered.py.
2026-11-22 01:09:53 -04:00
643f9d0596 rdna2spirv: apply VOP3 output modifiers on v_fmac_f16 and v_interp_p2/mov_f32
Apply clamp_mods (mul:2/mul:4/div:2 then clamp to [0, 1]) in v_fmac_f16_e64 (before f16 narrowing, matching v_fma_f16 and keeping the high half intact) and in v_interp_p2_f32_e64 / v_interp_mov_f32_e64 (zero-instruction no-op when mods has none).

Confirmed against LLVM gfx10_asm_vop2.s (v_fmac_f16_e64 clamp/mul:2/mul:4/div:2) and gfx10_asm_vop3.s (v_interp_p2_f32_e64, v_interp_mov_f32_e64). Verified on CPU with tests/semantic/test_f16_fma_rounding.py, tests/semantic/test_interp_f32_mods.py, tests/semantic/test_interp_f16.py and tests/semantic/test_value_semantics.py.
2026-11-22 01:09:50 -04:00
b7905794d0 shader_ir: preserve VOP3 FP abs/neg modifiers on constant operands
Keep VOP3 FP source modifiers (neg(...), |...|, -|...|, abs(...), and nested combinations) as abs/neg flags on imm and fimm operands instead of applying two's-complement integer negation or folding outer '-' before FAbs, matching LLVM AMDGPUInstPrinter::printOperandAndFPInputMods.

Plain signed numeric literals (-1, -1.0, 0x10) keep their existing dict layout. Also handle -0x... inside modifiers, preserve abs on sext(...), and apply abs then neg in tools/shader_meta.py::_imm_u32.

Verified on CPU with tests/test_shader_ir.py, tests/test_shader_meta.py, tests/test_cpu_ref.py, tools/f32_fuzz.py and the full tests/semantic suite (1,027 tests).
2026-11-22 01:09:48 -04:00
9363490570 feat(dxgi): add Vulkan-backed IDXGIFactory4 and IDXGISwapChain3 COM shim with HWND GPU test 2026-11-22 02:06:28 -03:00
74bd4cb805 docs/models.md: what the model rejects at 917e9b9 are
The 1,009 levels.rpf rejects in the last shard are texture dictionaries,
not incomplete or duplicate tail pages, and 28 more in shards 1 to 7 are
models the probe caps reject. The 27 standalone models below c3708fb are
those capped models, not merged duplicates. Adds a per-archive table of
reject classes and links the upstream fixes (rpf9-explorer#9, #11).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:05:44 +01:00
3bce1fd0d0 Docs: name and measure map material texture parameters
Adds joaat names for 0x1E77BF4C (bumptex), 0xC6F46E79 (speculartex),
0x739E3D0D (speculartex2), 0x3FB7964F (tinttexture) and 0xC075F9B6
(lookuptexture), and a content check on a 1,500-model map sample: bumptex is
normal-map-like (1,394 vs 74), speculartex is not (69 vs 1,469). Notes the
conflict with the character table's 0xC6F46E79 row and three sRGB colour
parameters missing from ModelTextureBindings. Counts only.

AI-assisted (Claude). Measured on my own copy (1.0.2.1); docs only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:05:39 +00:00
dfde5f58e9 fix: allow packed A16 coordinates on texel-offset samples
The address decoder already preserves the full offset VGPR before reading the packed coordinates. Let the existing offset path use those operands, and compare asymmetric packed UVs to the full-precision texel on the GPU.
2026-11-22 06:05:34 +01:00
f61720d877 Translator: s_cmp of a lane mask with -1 compares the real mask word
In a partial wave, lanes that were never launched don't vote but their
bits are 0 in the mask, so the vote called vcc_hi = 0xff "all ones".
Keep the vote for 0 only; -1 goes through wave_mask(). GPU tests for a
40-thread wave64 and a 20-thread wave32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:04:46 -03:00
34cc69d497 Docs: add the D3D-56 descriptor-lookup numbers for AMD RDNA3
The 5.1 table only had the RTX 5080 run and listed AMD as open. Add the
RX 7900 XTX results for device_local, host_visible and host_device_local,
with the caveats that matter: the 100k table is 524,288 slots (20 MiB, 8
probes) here versus 2,097,152 on the RTX 5080, so rows are not comparable
across vendors, and the 10k host_visible path varied 147-845 net us/1M over
five runs, so its row is one representative run and the prose carries the
range. Numbers from #313/#166 at 2aed144.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:03:57 -06:00
69fe9d3752 Merge remote-tracking branch 'origin/main' into claude/d3d-24-debug-markers-457bab
# Conflicts:
#	runtime/CMakeLists.txt
#	runtime/shims/d3d12_com.cpp
#	runtime/shims/d3d12_com.h
2026-11-22 05:01:46 +00:00
747d1c34c0 Support overlapping ordinary occlusion in Vulkan replay 2026-11-22 01:59:55 -03:00
5190d597c8 Merge keyboard-pad coverage with controller reading history 2026-11-21 21:58:55 -07:00
6169f9be25 docs: the image fuzzer's device requirements, and why Xe-LP skips 2026-11-22 01:56:25 -03:00
e6c767bdd3 Tools: image_load differential fuzzer with a GPU harness
AI-assisted. docs/shader_validation.md said "Not covered yet: images", and
FUZZ-1..13 touch VALU, memory, LDS, crosslane and control flow but not a single
image instruction. This is the first slice of that gap:

- runtime/test/vk_image_fuzz.cpp: headless harness that binds one 2D sampled
  image from a key=value spec (format, size, texels, T# key) through the
  bindless set and the descriptor table, draws a 64x64 full-screen triangle with
  a caller-supplied VS/PS, and dumps RGBA32F. It enables the without-format
  storage-image reads/writes and fragment atomics the translated image path
  declares, and fails on validation errors with LEONIDA_VK_VALIDATION=1.
- tools/image_fuzz.py: assembles a pixel shader that reads one texel with
  image_load (dmask 0xf, T# in s[8:15]), translates it with rdna2spirv.py, runs
  the harness, and compares every pixel with an independent CPU oracle for the
  T# format. A fetch is a memory read, so the oracle is exact.
- tests/test_image_fuzz.py: the oracle, the texel mapping, the T# word and the
  generated shader, without a GPU.

Covered: R8G8B8A8_UNORM, R16G16B16A16_SFLOAT, R32G32B32A32_SFLOAT and
R32_SFLOAT, at 8/16/32/64 square sizes that divide the draw; a fifth of the
values are NaN, +-inf, +-0 or denormals.
Not covered yet: dmask variants, UINT/SINT formats (they read through the
storage views), mips, 1D/2D-array/3D/cube, image_sample/gather with filters and
borders, and texel offsets with VK_KHR_maintenance8.

Verified on an NVIDIA RTX 2060 SUPER (Linux, 620.73.04, Vulkan 1.4.357):
40/40 programs match under LEONIDA_VK_VALIDATION=1; ctest 11/11; the GPU suite
is unchanged with a clean build. Synthetic fixtures only, no game data.
2026-11-22 01:56:25 -03:00
8f65445e27 Keep ds_bpermute subgroup operations convergent 2026-11-21 20:53:20 -08:00
b72fc5a4fe Keep gamepad readings in order between title polls 2026-11-21 21:46:14 -07:00
56d1273ce7 Allow world exports to select the base-color texture parameter 2026-11-21 21:44:55 -07:00
d380e5ae8e Translator: flush f32 denormals in v_mad_f32, v_mac_f32 and v_mad_legacy_f32 (SHADER-118) 2026-11-22 01:29:47 -03:00