Commit Graph

5744 Commits

Author SHA1 Message Date
722b68fb86 Merge pull request #504 from NRXM 2026-11-21 19:43:50 -05:00
bfc6b6ed22 Merge pull request #493 from Andrea 2026-11-21 19:43:43 -05:00
6581bc4abd Merge pull request #476 from root 2026-11-21 19:43:41 -05:00
51b9ccf5e2 Merge pull request #448 from Luiz Neves
# Conflicts:
#	docs/design.md
2026-11-21 19:43:39 -05:00
45cf469013 Merge pull request #388 from 73N1X 2026-11-21 19:43:25 -05:00
8e02b90c29 Merge pull request #350 from nicolas
# Conflicts:
#	docs/design.md
2026-11-21 19:43:25 -05:00
b28c8ac0af Merge pull request #288 from Parakeet-Wheat 2026-11-21 19:43:17 -05:00
bcd38863f5 Merge pull request #268 from shelbykb2 2026-11-21 19:43:16 -05:00
8b5d88dec9 Merge upstream main into D3D-47 resolve comparison
Preserve reserved-resource coverage alongside multisample resolve support and comparison tests. Fix the Windows SDK ResolveSubresourceRegion rectangle mutability.
2026-11-22 01:42:26 +01:00
726570a67c Translator: v_mad_u64_u32 and v_mad_i64_i32
Both raised Unsupported. {sdst, D} = S0 * S1 + S2 as a 65-bit result (RDNA ISA
pseudocode): a 32 x 32 -> 64-bit product, unsigned or signed, plus the 64-bit
S2, built from OpUMulExtended/OpSMulExtended and an OpIAddCarry chain. sdst
gets bit 64 as a lane mask: the carry out for u64, the sign of the exact sum
for i64. clamp is rejected.

tests/semantic/test_alu_mad64.py checks D and the sdst bit against a
plain-Python reference, a null sdst, an inline accumulator, and the carry
feeding v_add_co_ci_u32; docs/design.md gets a contract row.
2026-11-21 21:41:24 -03:00
3f4cf2e40d FUZZ-5: typed buffer loads in tools/mem_diff.py (buffer_load_format, tbuffer_load_format)
A buffer_format family: buffer_load_format_* on every format the translator decodes (random DST_SEL 0/X/Y/Z/W) and tbuffer_load_format_* on the five formats the 1.0.2.1 corpus uses. The reference decodes each element from the GFX10 format name (tools/gfx10_formats.json), not from the translator's table.

Two outcomes await a gfx10 hardware measurement (posted in #374) and are counted apart: UNORM/SNORM results 1 ULP from the correctly rounded value (the translator multiplies by a rounded reciprocal), and the missing W of a 32-bit format (0 in the translator, 1 / 1.0 for every other format). 5,000 programs: no other difference. Mutations of the 16_16_SNORM kind, the 8_8_8_8_UINT widths and the DST_SEL order make 33, 37 and 191 of 300 programs fail.

AI-assisted.
2026-11-22 01:37:53 +01:00
24bfb65867 Follow up three review points on merged PRs (#326, #308, #292)
- ci.yml: cancel only superseded pull request runs; a push to main was
  cancelled by the next merge and left that commit without a CI result
  (#326 review).
- world_census.py: --jobs above 61 is rejected with an argparse error on
  Windows instead of ProcessPoolExecutor's ValueError traceback, with a
  test next to the below-1 test (#308 review).
- docs/textures.md: drop the duplicated "The BCPack counts above..."
  paragraph (#292 review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:37:20 +00:00
8542365e0d docs: record GDKX PresentX/frame-event presentation from public samples
Answers 8.2 question 6 partly: public MIT/zlib GDKX code (Xbox-GDK-Samples,
DirectXTK12 wiki, directxtk12modelviewer, SDL2) presents with PresentX and
frame events and no DXGI swapchain. Records the call sequence and argument
counts as fact, the game's behaviour as hypothesis, slots/layouts as unmeasured.
Updates 4.5, queue/swapchain mapping rows, PresentX row, M0/M7 and xs_surface 7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:36:23 +01:00
737735aecb Translator: v_movrelsd_2_b32 with separate M0 source/destination fields
VGPR[D + M0[25:16]] = VGPR[S0 + M0[9:0]] (RDNA2 ISA VOP1 opcode 72; same
fields in the RDNA3 ISA). It raised Unsupported before (noted in #496).

- tools/rdna2spirv.py: masks M0 per side on the existing movrel path.
- tests/semantic/test_alu_movrelsd_2.py: 7 hand-computed cases through the
  translator and the interpreter, including ignored M0 bits set, the _e32
  spelling and a check that it differs from v_movrelsd_b32.
- runtime/test/shaders/cs_movrelsd_2.asm: GPU test (wave32 dump) with the
  ISA's own example; registered in check.py and run_gpu_tests.py.
- docs/design.md: contract row for the v_movrel* forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:34:25 -05:00
5cd151c551 docs: refresh the README status table and stale BCPack rows (PROC-9)
README: the GPU-test row counts the 30+ entries now in #166 (adds AMD
GCN3/RDNA1/RDNA4, Intel Gen9, llvmpipe) and drops the cs_w64x_partial
note that #204 fixed; the translation row says wave64 emulation makes
compute and mesh exact on 32-wide GPUs; the texture row names the
BCPack decoder from #312 and that the export doesn't use it yet; the
D3D12 row lists texture views, samplers and resolves (#228, #328).
docs/design.md: the TTPF row points at the decoder instead of calling
BCPack the hard blocker. docs/textures.md: drop the superseded
'no decoder is added' paragraph left above the new one.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
2026-11-22 00:33:19 +00:00
0a4b0b353d docs: d3d12_vulkan.md section 8.2 in order, and rows 15 and 18 point at their items (PROC-11)
Row 10 sat after row 13; it now follows row 9. Row 15 (ExecuteIndirect) names D3D-17
and row 18 (aliasing, reserved and tiled resources) names D3D-16 and D3D-20, the items
in #313 that build the answers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 03:31:09 +03:00
569d4aa33a Textures: decode all 697 TTPF 2D arrays, streaming cubemaps and 3D volumes (ASSET-36) 2026-11-21 21:31:04 -03:00
879e1a798d Merge upstream texture and generated shader tests into the a16 fix
Use the canonical shader source for clip dependencies and preserve texel-offset checks next to explicit gradients.
2026-11-22 01:28:49 +01:00
7fdabf3ff3 Preserve nested bank paths during AWC audio export 2026-11-21 21:28:04 -03:00
58019e85ec Merge main and preserve predicated typeless clear handling 2026-11-21 20:26:41 -04:00
bc7c389be9 Translator: quantize 16-bit interpolant reads with OpQuantizeToF16
AI-assisted. Follow-up to merged #274, per Vonsek RTX 5080 review on it.
Pack/Unpack round-trip is folded to a no-op (expected 0x3f802000, observed 0x3f801800, not f16); emit one OpQuantizeToF16, teach mini-interp, pin value and opcode in tests.
2026-11-21 21:26:12 -03:00
f9fb9f02a8 Translator: load mid-dword buffer_load_format elements from every dword they span
need used to be ceil(size/4) and only the first dword was shifted, so a
4-byte format at byte 3 (or an 8-byte format at byte 6) took its tail
from dword 0. Load ceil((byte_shift + size) / 4) dwords and shift the
whole window so the packed stream starts at the element. Found by the
FUZZ-5 fuzzer; left open in #234.
2026-11-21 16:25:42 -08:00
1565e63418 Merge commit '91b36cf86cb92a95836eed8af73abc0671a61e31' into codex/med3-result-modifiers
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
2026-11-21 17:25:32 -07:00
adc1549376 Runtime: WriteToSubresource and ReadFromSubresource on the Vulkan device
Both were generated stubs; WriteToSubresource is in the first-frame API set
(docs/d3d12_vulkan.md section 6.1). Textures in CPU-visible custom heaps map with a
null pointer, as on D3D12, and copy on the host with VK_EXT_host_image_copy while
they are in GENERAL (D3D12's COMMON). Every other case is a CopyTextureRegion
from or to a staging buffer, replayed on the device's queue and waited for, so the
layout tracker and first-use zero fill behave as for the application's copies.
The standalone and test devices enable the extension where the GPU has it.

d3d12_vulkan_device_test checks both paths: boxes and pitches, a mip, a volume,
BC1, rejected calls, a default-heap texture, and GPU copies in both directions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:24:38 +11:00
212c52ac3e docs/design.md: record the ps_f64_mods GPU pass (RTX 6000 Ada)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:22:25 +01:00
e816f20b29 Runtime: SNORM/SINT render targets and clear conversion (D3D-45)
Add DXGI->Vulkan mappings and footprint sizes for SNORM and SINT render-target formats, and extend render_target_clear_color to convert SINT clears numerically (NaN to zero, clamp to the signed range, truncate toward zero) instead of copying float bits. Rename d3d12_uint_clear_test to d3d12_clear_test and widen it to compare UNORM/SNORM/FLOAT/UINT/SINT render-target and depth/stencil clears against Windows WARP, full and rectangle. SRGB clears are left out of the byte-exact comparison: the linear->sRGB encoding rounds differently at the .5 boundary on WARP vs Vulkan (a 1-ulp driver difference).
2026-11-22 01:21:20 +01:00
df696e4c3b saves: key hashes are case-sensitive joaat; add tools/save_keys.py
The $0x... keys in JSAV blocks and ASAV settings are the case-sensitive joaat
(seed 0, no lower-casing) of engine/script names, the same rule as the member
hashes in docs/world_names.md. Found from structure: the group keys hash names
derived from the clear-text JSON wrappers.

tools/save_keys.py collects the distinct keys from saves or extract folders and
resolves them against strings harvested from any local files (raw bytes and
zlib streams), reporting per hash family how many keys resolve and how many
are expected by chance; --compose N adds one/two-word names. On the sample set
278 of 1,059 keys resolve with joaat over the game's own data archives; every
other family stays at chance level. Only counts are documented; names stay local.

Synthetic tests only (tests/test_save_keys.py).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:21:17 +00:00
d999bb9709 Merge pull request #421 from shelbykb2
# Conflicts:
#	tests/semantic/README.md
#	tests/test_shader_checks.py
2026-11-21 19:19:04 -05:00
0b7233e567 Tests: the D3D-14 push-constant check accepts GPUs with 128 bytes
d3d12_vulkan_device_test asserted that the real test device never needs
the push-constant fallback. On a GPU whose maxPushConstantsSize is 128 (the
Vulkan minimum), the device is right to flag it, so the test stopped there.
That happens on Intel Arc, and on a Radeon 680M on the Windows driver
22.40.84.06. The check now asserts that the flag matches
maxPushConstantsSize < 144, which holds on either kind of GPU. The
simulated 128-byte device below it still covers the flagged path.

docs/d3d12_vulkan.md: the 680M joins Intel Arc as a measured 128-byte GPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:18:39 +02:00
fe67117ffc Merge origin/main into salu-lshl-add 2026-11-21 21:17:59 -03:00
3a83c29eae GPU tests for f16 op_sel and partial writes, hardware-measured; f16 inline constants fixed (SHADER-13)
Covers the "16-bit results" contract row, which ended with "not yet GPU-verified".

Hardware evidence: AMD RX 6800 (gfx1030), the instructions run as a raw compute kernel in wave32 and
wave64, IEEE off, DX10 clamp on, denormals kept, round to nearest. The bytes assemble identically for
gfx1013 and gfx1030 (llvm-mc 21; the kernels themselves were assembled by the driver's comgr).
- v_med3_f16: all 16 op_sel patterns, neg/abs on a selected high half, clamp, destination also a source.
- v_add/sub/mul/max/min_f16 (_e32, _e64 with neg/abs/clamp), v_fmac_f16 (_e32, _e64), f16 unary
  (rndne/floor/ceil/trunc/fract/sqrt/rcp/rsq, _e32 and _e64), v_cvt_f16_f32: low halves in, low half out,
  high half of the destination kept; the v_fmac_f16 accumulator is the low half of the destination.
  336 words per wave size, all as the rule says and as the translator computes.
- Not expressible: op_sel on the VOP2/VOP1 ops in VOP3 encoding (v_add/sub/mul/max/min_f16_e64,
  v_fmac_f16_e64, unary _e64). llvm-mc rejects the modifier and its disassembler drops the bits, so
  nothing was measured there and nothing was hand-encoded.

Translator fix (tools/rdna2spirv.py, new src_h): an inline float constant in an f16 operand is the f16
value in the low half over a zero high half. The translator unpacked the f32 pattern, whose low half is
zero, so v_add_f16 d, 1.0, v added 0.0 and v_cvt_f32_f16 d, 0.5 gave 0. Measured for v_add/mul/max_f16,
v_sub_f16_e64, v_fma_f16, v_fmac_f16, v_rcp_f16, v_med3_f16, v_cmp_lt_f16, v_cvt_f32_f16, v_cos_f16,
v_pk_add/mul_f16 and v_pack_b32_f16 (0.15915494 is 0x3118); the high half op_sel selects from a constant
reads +0.0. v_fma_mix* operands were not
measured and are unchanged.

Tests:
- runtime/test/shaders/ps_f16_{med3_opsel,med3_mods,vop2,vop2b,vop1,vop1b,const,const2,pack}.asm, wired into
  check.py and scripts/run_gpu_tests.py. Their expected words are the ones the hardware gave for the same
  instructions. Vulkan, AMD Radeon RX 6800, Windows, driver 26.11.2: 9/9 pass; with one expected word
  flipped per test 0/9 pass; without the translator fix ps_f16_const, ps_f16_const2 and ps_f16_pack fail.
- tests/test_f16_hw_words.py: header, check.py and run_gpu_tests.py hold the hardware words; a
  plain-Python reference of the rule and the translator (tests/spirv_interp.py) both give them. 12 of its
  tests fail without the fix.
- tests/semantic: ps_f16_vop2 fixture and value test; the v_sin_f16 mutation anchor follows the edit.
- tests/spirv_interp.py: Floor/Ceil/Trunc/RoundEven keep the sign of a zero result (trunc(-0.75) is
  0x8000 on the hardware and on Vulkan), Sin/Cos, component-wise vector arithmetic.
- python -m unittest discover -s tests/semantic: 388 -> 389, OK. pytest tests: 1467 -> 1514 passed.
  scripts/run_gpu_tests.py (test tools rebuilt): 48/49 -> 57/58 passed, 1 skipped.

docs/design.md: the "16-bit results" row says what was verified and what is not expressible; new row
"f16 inline constants".

AI-assisted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:17:58 -07:00
0f25c63200 Tools: wave and cross-lane differential fuzzer on the GPU (FUZZ-7)
tools/crosslane_fuzz.py generates seeded wave32/wave64 compute programs
from readlane/writelane/readfirstlane, v_cmp/v_cmpx ballots, s_bcnt/s_ff1
of masks, v_mbcnt, v_cndmask, permlane16/x16, forward s_cbranch_execz/
vccz/vccnz and (--dpp) DPP16/DPP8, under random EXEC, nested saveexec,
partial waves and multi-wave groups. A 64-lane model of the ISA is
compared with the translated SPIR-V run by vk_compute_test (VKC_OUT_WORDS
/ VKC_DUMP), wave32 natively and wave64 with --wave64-emulate.

Found SHADER-52 (#407) and two DPP bugs in #238. tests/test_crosslane_fuzz.py
checks the model without a GPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:14:53 +00:00
2fd9504e92 Merge pull request #488 from LuanFreitas 2026-11-21 19:14:13 -05:00
edb8bb8643 Merge pull request #477 from tunczzzz
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
2026-11-21 19:14:12 -05:00
85164a7d9d Merge pull request #476 from root 2026-11-21 19:14:11 -05:00
44e354869e Merge pull request #448 from Luiz Neves
# Conflicts:
#	docs/design.md
2026-11-21 19:14:07 -05:00
0a31f041a9 Merge pull request #445 from Luiz Neves 2026-11-21 19:14:05 -05:00
119d3084fd Merge pull request #442 from Spaghetih
# Conflicts:
#	docs/shader_validation.md
2026-11-21 19:14:05 -05:00
bd15303dc4 Merge pull request #430 from NRXM 2026-11-21 19:14:03 -05:00
a3e8a7f9e0 Merge pull request #420 from kotorvr 2026-11-21 19:14:02 -05:00
1eaca53672 Merge main into D3D-26: bundles and samplers on main; D3D-26 calls follow the bundle rules
main added ExecuteBundle (command_list.h, d3d12_com.cpp) and samplers
(vulkan_backend.h); both sides are kept. DiscardResource and the atomic
copies are now refused in a bundle, as D3D12 documents, and
WriteBufferImmediate is allowed there (d3d12_com_test covers all four).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:13:23 +00:00
707b194707 Merge main (4abd545) into d3d-25-uav-clears
Conflicts, both sides kept: command_list.h (clear_unordered_access next to
ExecuteBundle's execute_bundle), vulkan_backend.h (fill/update buffer next to
the sampler functions), CMakeLists.txt (the UAV clear test next to the new
descriptor test) and the known-gaps paragraph in docs/d3d12_vulkan.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:11:50 +00:00
25b8b0f3d6 runtime: fences and timing on the Vulkan device (D3D-30)
- SetEventOnMultipleFenceCompletion, ALL and ANY: a null event is one
  vkWaitSemaphores (WAIT_ANY_BIT for ANY); with an event, each fence's
  existing wait thread counts down one shared waiter, so no new threads.
- Queue GetClockCalibration: vkGetCalibratedTimestampsKHR (or the EXT
  alias) over the DEVICE and QueryPerformanceCounter domains when the
  device has the extension (the standalone device now enables it);
  otherwise a submitted vkCmdWriteTimestamp bracketed by QPC reads.
- GetAdapterLuid from VkPhysicalDeviceIDProperties::deviceLUID.
- GetCustomHeapProperties per the D3D12 docs' NUMA table, matching the
  UMA = FALSE the device reports.

d3d12_fence_timing_test covers both calibration paths, the LUID against
DXGI's adapter list and the heap answers against the host runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:10:33 +00:00
d7a08ad45c Runtime: debug markers on VK_EXT_debug_utils and private data on every object (D3D-24)
SetMarker/BeginEvent/EndEvent on command lists are recorded in the IR
(DebugMarker) and replayed as vkCmd*DebugUtilsLabelEXT; on queues they
call vkQueue*DebugUtilsLabelEXT under the submit lock. Labels are used
only when the instance enabled VK_EXT_debug_utils
(VulkanDeviceInfo::debug_utils; the standalone device enables it when
the loader lists it); otherwise the calls are no-ops. Events may span
the lists of one ExecuteCommandLists; an unmatched end is dropped and
labels left open are ended before the command buffer ends, so Vulkan's
begin/end rule always holds. Metadata 0/1 strings become UTF-8 labels;
a PIX3 blob (2) gets a fixed label (open question 21).

SetPrivateDataInterface holds a reference until replaced, removed or
the object dies, and GetPrivateData hands it back AddRef'd. SetName
stores WKPDID_D3DDebugObjectNameW. Both live in the shared Object base,
so every object of the Vulkan device has them.

d3d12_debug_markers_test checks the exact label calls through a
recording vkGetInstanceProcAddr, the no-extension path, and private
data on the device, queue, allocator, list, heap, resource and fence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:10:17 +00:00
91050d0cee valu_fuzz: drop the wave family; FUZZ-7 is @kotorvr's crosslane_fuzz.py 2026-11-22 01:09:53 +01:00
06bd42a20e Translator: apply clamp and omod to v_add_f64
v_add_f64 is VOP3Inst<"v_add_f64", VOP3_Profile<VOP_F64_F64_F64>> in LLVM
AMDGPU; VOPProfile gives it HasClamp (f64 is a modifier type) and HasOMod
(floating-point destination). The translator dropped both. The double sum
is now scaled by mul:2/mul:4/div:2, then clamped to [0, 1] (FClamp, as the
f32 clamp_mods does), before it is split into the register pair.

- tests/test_f64_output_modifiers.py: SPIR-V data-flow check per modifier
  combination, plus NoContraction on the f64 add/scale.
- runtime/test/shaders/ps_f64_mods.asm: GPU test (registered in check.py,
  run_gpu_tests.py and regen_fixtures.py). vk_harness enables shaderFloat64
  when the fragment shader declares Float64, else exits 77 (SKIP).
- docs/design.md: contract row with the LLVM profile names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:09:07 +01:00
ce822e5040 Merge pull request #375 from Vonsek 2026-11-21 19:08:38 -05:00
0032f57ce3 Merge pull request #362 from bbareth 2026-11-21 19:08:38 -05:00
c237415654 Merge pull request #354 from bbareth 2026-11-21 19:08:37 -05:00
e5fcb02e84 Merge pull request #323 from Ayinaki 2026-11-21 19:08:32 -05:00