Commit Graph

5744 Commits

Author SHA1 Message Date
a57bd02b9d Merge pull request #573 from Størm 2026-11-21 20:09:24 -05:00
1fa7ae78cc Merge pull request #564 from Ewann 2026-11-21 20:09:23 -05:00
72314f8051 Merge pull request #554 from Kam471
# Conflicts:
#	docs/design.md
2026-11-21 20:09:21 -05:00
e4212556c3 Merge pull request #553 from NRXM 2026-11-21 20:09:20 -05:00
536ba3a2cb Merge pull request #538 from kotorvr 2026-11-21 20:09:18 -05:00
c555b4c2bd Merge pull request #512 from SuarezPM 2026-11-21 20:09:17 -05:00
6a55f981e0 Merge pull request #503 from Tomgamer 2026-11-21 20:09:16 -05:00
8493b28604 Merge pull request #493 from Andrea 2026-11-21 20:09:14 -05:00
feefef597c Merge pull request #476 from IAmNotSiob 2026-11-21 20:09:14 -05:00
e90d40c1d3 Merge pull request #472 from kotorvr 2026-11-21 20:09:14 -05:00
2720df12a1 Merge origin/main into f64-output-modifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/semantic/regen_fixtures.py
2026-11-22 02:07:19 +01:00
c7ea4b4aaa Merge the upstream two-mip fixture with the a16 gradient test
Keep both texture draws in the standalone checker, the GPU runner and its expected case count.
2026-11-22 02:04:42 +01:00
b6eda1e60c Translator: flush f16 denormals in the quantized interpolant path
AI-assisted. Addresses IAmNotSiob's review on #512 (he is taking the
arithmetic sites under SHADER-56/#513; f16_roundtrip stays here).

SPIR-V's OpQuantizeToF16 returns +0/-0 when the magnitude is too small for a
normal f16, and it pins no rounding mode. The docstring, the design row and the
test's rule text now say "round to nearest, f16 denormals flushed to signed
zero" and warn against reusing the helper where denormals or a rounding mode
matter.

The mini-interpreter used struct.pack('<e'), which keeps f16 subnormals: it was
more precise than any conforming driver, so a test could pass here and fail on a
GPU. It now flushes after float_to_half, and the test's independent oracle does
the same. A new case pins 1e-6 -> +0.0 and -1e-6 -> -0.0 through a translated
flagged shader (PS input 1e-6 is an f16 subnormal, 6.1e-5 is the smallest
normal); without the interpreter flush that test is red.

Existing 1.1 -> 1.099609375 pin and the opcode pin are unchanged.
2026-11-21 22:04:36 -03:00
b3e71d7a4d runtime: UINT border colours use VK_BORDER_COLOR_INT_* (#538 review)
A UINT opaque-white border read back as 0 (Vonsek, on an RTX 5080). The S# has
no integer border types, since the hardware reads them by the image's format.
So bind_sampler gave Vulkan VK_BORDER_COLOR_FLOAT_*, which an integer image
reads as 0. The float and UINT samplers also shared one S# key and so one
VkSampler.

An integer border is now marked in the S#: BORDER_COLOR_PTR = 0x800
(gfx10::kIntegerBorderPtr), a field the hardware reads only for table colours.
That gives it its own key, and vulkan_sampler picks VK_BORDER_COLOR_INT_*.

d3d12_descriptor_test runs Vonsek's case: an R8G8B8A8_UINT texture sampled past
its edge through UINT black and white border samplers reads 0 and 1, and a
float white border reads 255. The case fails with the float enums on an RTX
4090. gfx10_descriptors_test and d3d12_sampler2_test check the mark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:03:36 +00:00
ffb5e34b9c runtime: CreateSampler2 on the Vulkan device (D3D-28, part 2)
CreateSampler2 wraps CreateSampler. The UINT border colour maps (0,0,0,0),
(0,0,0,1) and (1,1,1,1) to the S#'s border types, and anything else to the
table. Non-normalized coordinates set FORCE_UNNORMALIZED. A description the PC
runtime refuses (unknown flags; a non-normalized sampler with an unequal
min/mag filter, a linear mip filter, anisotropy, comparison, a U/V address mode
other than clamp/border, or a non-zero LOD or bias) leaves the slot as it was,
as the runtime does on an RTX 4090 and on WARP. The layer now answers
D3D12_OPTIONS17 with NonNormalizedCoordinateSamplersSupported, as both report.

d3d12_sampler2_test compares the S# bytes with CreateSampler's and the 22
edge cases with the host's PC runtime live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:03:36 +00:00
382daba42f runtime: the 1/2/3 method variants on the Vulkan device (D3D-28, part 1)
CreateCommittedResource1/2/3, CreateCommandQueue1 and GetCopyableFootprints1
as thin wrappers over the existing methods. D3D12_RESOURCE_DESC1 drops to
D3D12_RESOURCE_DESC; the initial state or barrier layout is unused, because new
textures start UNDEFINED and move on first use. The newer arguments are answered
as the PC runtime answers them (measured on an RTX 4090, driver 621.14):

- a protected resource session: E_INVALIDARG (no session support reported);
- a sampler-feedback mip region: E_INVALIDARG on textures, ignored on buffers;
  GetCopyableFootprints1 returns its failure answer for such a texture;
- a buffer's initial layout other than UNDEFINED: E_INVALIDARG;
- a castable count with a null list: no list;
- a castable list: E_INVALIDARG, since it needs RelaxedFormatCastingSupported,
  which the layer does not report (D3D12_OPTIONS12 is unanswered);
- CreateCommandQueue1's creator ID: ignored.

d3d12_method_variants_test compares each variant with its base method, runs the
edge cases and, when the host has a D3D12 device, compares each answer with the
PC runtime live. Thanks to ezwinxdlmao for the probe notes in #156.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:03:35 +00:00
2a41e7a44c Navmesh: decode 0DRP cover-point pages, 0x00010015 tiles and Band-3 grids (ASSET-22) 2026-11-21 22:03:23 -03:00
cfc314d233 Docs and CMake: the runtime needs the Windows SDK 10.0.26100 or newer
The runtime uses version 1.2 root signatures (D3D12_ROOT_SIGNATURE_DESC2),
which older SDKs such as 10.0.22621 don't declare, so the build failed
halfway through with a compiler error. The prerequisites now name the SDK,
docs/testing.md has a Known problems row for the error, and CMake checks
for it at configure time and stops with the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:03:14 -05:00
320531ec67 Merge remote-tracking branch 'origin/main' into valu-add-nc-clamp
# Conflicts:
#	docs/design.md
2026-11-21 22:02:29 -03:00
b3edaf3ed4 Merge remote-tracking branch 'upstream/main' into codex/rgb9e5-texture
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 02:02:12 +01:00
bd7e53f43a Runtime: serialize root signature 1.2 as 1.1 on runtimes that stop at 1.1 (WIN10-ROOTSIG)
The in-box d3d12.dll of Windows 10 (and Windows 11 23H2, #361) serializes
root signatures only up to 1.1: on Windows 10 it rejects even an empty 1.2
description with E_INVALIDARG (#528). #361 made the tests skip there, but the
d3d12_xs serializer still forwarded 1.2 descriptions unchanged, so every 1.2
root signature from the package DLLs or the game failed on those hosts.

- d3d12_xs_rootsig: downgrade_root_signature_1_2_to_1_1 rewrites a 1.2
  description whose static samplers all have Flags == 0 as the same root
  signature in 1.1 (1.2 differs only in D3D12_STATIC_SAMPLER_DESC1::Flags).
- d3d12_xs: probe the host once with an empty 1.2 description; where it
  stops at 1.1, serialize 1.2 as 1.1, or refuse one with sampler flags
  with a log line.
- root_sig_test: the registered shim's 1.2 checks run on every runtime again;
  new checks cover the rewrite field by field, through the registered shim
  and back through the host deserializer, and the refusal.
- root_signature_oracle_test: its 1.2 cases use sampler flags, which have no
  1.1 form, so they print SKIP where the host can't serialize 1.2.
- docs/d3d12_vulkan.md: the measurement and the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:01:11 -08:00
a4996c7ab4 Merge origin/main into f64-output-modifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:55:11 +01:00
66a5fc90f8 Query multisample quality for depth-stencil formats 2026-11-22 01:53:53 +01:00
5c8cc4fade Part 3: f16 FMAs round once, to f16 (SHADER-55)
v_fma_f16, v_fmac_f16 and v_pk_fma_f16 used GLSL Fma (rounded to f32) and then narrowed, a double rounding;
an RX 6700 matches a correctly rounded f16 FMA in 12,612/12,612 cases (#374). fma_f16_odd: exact f32 product,
TwoSum, round-to-odd at f32, then f16_bits. Design row for f16 rounding.
2026-11-22 01:53:21 +01:00
22590c7bbc docs: drop table rows duplicated by this round's both-side merges
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:53:13 -05:00
4c842cd11e Merge pull request #548 from Spaghetih 2026-11-21 19:53:12 -05:00
3dee137e53 Merge pull request #546 from Luiz Neves 2026-11-21 19:53:12 -05:00
9251d2f3d7 Merge pull request #542 from kotorvr 2026-11-21 19:53:11 -05:00
b3c2623554 Merge pull request #541 from SirAmong 2026-11-21 19:53:11 -05:00
2703d83700 Merge pull request #540 from AlxcBTW 2026-11-21 19:53:11 -05:00
394497fbe9 Merge pull request #534 from NWX10
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 19:53:11 -05:00
98bfd847d0 Merge pull request #532 from VictorJulianiR 2026-11-21 19:53:09 -05:00
25fea32be6 Merge pull request #529 from Jaws 2026-11-21 19:53:09 -05:00
1ce79642f6 Merge pull request #525 from Luis Baker
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 19:53:08 -05:00
a541616a1e Merge pull request #524 from kotorvr 2026-11-21 19:53:07 -05:00
fa0b52f754 Merge pull request #520 from SombraSoft 2026-11-21 19:53:07 -05:00
302b4f2770 Merge pull request #516 from ezwinxdlmao 2026-11-21 19:53:07 -05:00
55de32c87e Merge pull request #512 from SuarezPM 2026-11-21 19:53:06 -05:00
824f07e9af Merge latest main and align Vulkan MSAA with D3D12 sample limits
Expose only D3D12-valid Vulkan sample counts (2..32), allow 32x allocations, and reject zero, oversized, and unsupported-quality resource descriptions. Extend resolve/allocation coverage to 32x MSAA and add boundary tests.
2026-11-22 01:51:30 +01:00
125ab44500 valu_fuzz: drop the wave family; FUZZ-7 is @kotorvr's crosslane_fuzz.py 2026-11-22 01:51:09 +01:00
f0fdfe360d Tools: f16, buffer memory and cross-lane differential fuzzers on the GPU (FUZZ-2, FUZZ-5, FUZZ-7) 2026-11-22 01:51:09 +01:00
5c74ec363b tests/docs: run cs_w32_lane_wrap across 32 lanes, contract row for the wave32 lane select (SHADER-52)
#488 landed the translator fix. This adds what it left out: a semantic
test that executes the translated fixture on one 32-wide subgroup (a
mask of 63 is an out-of-range shuffle there), and the contract-table row
with how the rule was found (FUZZ-7) and confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:50:42 +00:00
ae70fbf235 docs: record AMD's reserved-resource mip split next to NVIDIA's (D3D-20)
The GetResourceTiling notes in d3d12_vulkan.md section 4.2 were measured on
NVIDIA only. On an RX 9070 XT (RDNA4, driver 32.0.31041.1004, Windows 11,
main 91b36cf) the AMD PC runtime splits standard and packed mips differently,
so d3d12_vulkan_device_test's tiling comparison fails there: tile shapes agree
in all 17 texture layouts and 11 match exactly, but in 6 AMD keeps more mips as
standard tiles. Record those six, the rule that fits all 17 AMD results (a
hypothesis), and that the split to follow is open (#374).

AI-assisted (Claude Code).
2026-11-21 19:50:32 -05:00
3973ce8c20 feat(runtime): support sampled RGB9E5 textures
Map the shared-exponent format through resource creation and buffer-image copies so shaders can resolve its existing GFX10 view. Check the sampled channels and compare the mip-array footprints with the host runtime.
2026-11-22 01:47:40 +01:00
c0dbd14b96 Runtime: compare copies with the host runtime (D3D-46)
CopyResource, CopyTextureRegion (texture to texture, footprint to texture and back, boxes, offsets, array slices,
mips, 3D) and CopyBufferRegion run on the layer and on a host D3D12 device (LEONIDA_HOST_ADAPTER picks it) and the
bytes read back are compared, for 39 format/shape cases including BC1-7 and depth-stencil.

Layer fixes it found: texture formats R8G8_SNORM, R16_UNORM, R32G32_UINT, R9G9B9E5, B5G6R5 and B5G5R5A1 were
refused; a block-compressed texture-to-texture box reaching the padded mip edge was refused as invalid_copy.
Known differences (TEXTURE1D, D24 on GPUs without it, D24 X8 byte) are documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:47:27 +01:00
bcb9f6d5f2 runtime: LEONIDA_UNIMPLEMENTED=log|fail|stop policy for imports with no binding
An unimplemented import used to return 0 silently, which is S_OK for an
HRESULT function with its out parameters never written. The thunk now passes
the caller's return address and rcx/rdx/r8/r9 to a shared stub, and
LEONIDA_UNIMPLEMENTED picks the behaviour:

- log (default): exactly as before.
- fail: E_NOTIMPL for imports known to return HRESULT (D3D12Create*/Serialize*,
  CreateDXGIFactory*, XGameRuntimeInitialize, and the GDK XAsync/XTaskQueue/
  XUser/XStore/XGameSave/XPackage/XGameUi families minus their documented
  void/bool/int functions), 0 otherwise.
- stop: print the import, the caller as module+RVA and the four argument
  registers, then break under a debugger or exit with code 3.

--dry-run now counts unimplemented imports by return class. The stub zeroes
xmm0 and has unwind info, so float callers and debuggers are unaffected.
unimplemented_policy_test builds a synthetic image and checks all three modes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 01:46:33 +01:00
55fcbbc4b3 docs: drop the stale 'whole-quad mode on non-EXEC masks is the identity' approximation (PROC-13) 2026-11-22 00:46:19 +00:00
3f70816217 Translator: v_add_nc_i32 / v_sub_nc_i32, and integer clamp on the _nc adds
v_add_nc_i32 and v_sub_nc_i32 raised Unsupported. The VOP3 clamp bit on
v_add_nc_u32 / v_sub_nc_u32 / v_subrev_nc_u32 was silently ignored, so a
saturating add came out wrapped. On GFX9+ an integer add/sub with clamp
saturates (LLVM selects uaddsat/usubsat and saddsat/ssubsat to these ops):
unsigned to [0, 0xFFFFFFFF], signed to [INT_MIN, INT_MAX].

tests/semantic/test_alu_add_nc_clamp.py checks all five ops with and without
clamp against a plain-Python reference; docs/design.md gets a contract row.
2026-11-21 21:44:11 -03:00
0786a08395 Docs: measure the character skeleton and clip sidecars
Add a character-skeleton page: 597-name #ft table, the following 597-record parent/reference-TRS table, the model bone-hash mapping, and the character material texture-parameter split. Update animation.md with the partial clip decode (two named clips, 0x48-byte track arrays, 63/38 and 12/38 masks) and the 46-byte MoVE header correction. Link the new page from models.md and design.md. No game data.
2026-11-22 00:44:04 +00:00
ca0c66af6d Merge pull request #510 from kotorvr 2026-11-21 19:43:51 -05:00