The converter was made only where the GPU lacks D24_UNORM_S8_UINT (1c5463b4). 96-bit textures need it on every
GPU, so it is always created; it costs nothing until a copy uses it (lazy pipeline, lazy tracker lock).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
R32G32B32_FLOAT/UINT/SINT/TYPELESS textures were refused ("texture format not
supported yet"). They are now R32G32B32A32 images on every GPU: most have no
optimal-tiling RGB32 image, and one that has would not avoid the repack, since
D3D12 places subresources at multiples of 512 bytes and Vulkan wants a copy's
buffer offset to be a multiple of the texel size
(VUID-vkCmdCopyBufferToImage-dstImage-07975).
- Footprints keep D3D12's 12-byte texels (compared with WARP).
- CopyTextureRegion between a texture and a buffer is repacked by the D24
compute pass (depth24_convert.comp modes 2 and 3, Depth24Job::rgb96): the
same scratch, parts and lifetime, texels of three words in the footprint and
four in the scratch, copied uninterpreted. depth24_convert.inc is
regenerated with the documented glslc command; the same glslc reproduces the
previous blob byte for byte from the previous source.
- WriteToSubresource/ReadFromSubresource take the staged copy, as D24-as-D32.
- A view's T# names GFX10_FORMAT_32_32_32_*, so alpha reads as one.
- Refused: unordered access and depth (as WARP), render targets (WARP has
them; not done, and FORMAT_SUPPORT and GetResourceAllocationInfo agree),
copies between a 96-bit and a four-channel texture, views of another
format family.
Tested on an RX 9070 XT (AMD 26.11.2), Windows 11: d3d12_rgb96_test matches
WARP and the expected texels bit for bit for 4 formats as 2D arrays with mips
and as volumes; d3d12_descriptor_test samples FLOAT, UINT and TYPELESS views.
Clean under the validation layer with sync validation; depth24_convert_test
and ctest (62) pass.
AI-assisted (Claude Code).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
#1301 landed on main: check_read_methods, fssm_header.read_methods,
ps_interp_census.py removed. Resolution: our corrected SHADER-181 mode row
references check_read_methods and the surviving census tool; kotorvr's
translator-side row kept verbatim; the two stale copies of the old
bits-are-the-mode row, the extra interpolants duplicates and the old
fssm_header paragraph dropped.
Native RDNA2 ignores descriptor selectors for MTBUF and supplies zero for absent components. Preserve runtime descriptor swizzles for MUBUF and cover both paths with the same conflicting selectors.
main hand-merged both PRs' rows (1246 twice, then 1256), leaving kotorvr's
bits-0-1-are-the-mode row beside ours and a duplicated Pixel-shader
interpolants row. Resolution keeps one interpolants row and one SHADER-181
row stating the measured truth: FSSM flags bits 0-1 are the read method
(55,791-record validation, 0 contradictions), the mode is PSV0's
(tools/ps_interp_modes.py), and the two disagree in 2,190 Constant-via-
p1/p2/f16 and 3,197 Linear-mov-only rows. The fssm_header section says the
same. #1301 (kotorvr) renames the accessors to read_methods and keeps the
translator side; kotorvr's code is untouched here.
Device slots 8 (CreateCommandQueue), 75 (CreateCommandQueue1), 36
(CreateFence) and 32 (OpenSharedHandle of a fence) now return queue and
fence proxies. They forward the public chain in PC order (19 queue slots,
11 or 12 fence slots), refuse and log a slot past it up to the end of the
proxy's table, and name a read past the table through a guard region and
a vectored handler.
Heap, queue and fence proxies are unwrapped wherever a device or queue
method hands them to the real runtime: queue Signal/Wait, device slots
31/34/35/45/46/50. Arrays are copied without exceptions. QueryInterface
answers only the modelled interfaces, and logs one the real object has
but the proxy does not model. Outputs are cleared on failure as for
slots 14/62/76. --trace-d3d12 records proxy calls in the README grammar.
Every function a thunk hands its words to keeps them in the same
positions, because a title passes only as many as the method takes.
Tests: queue_proxy_test (host WARP, host hardware, Vulkan device;
differential per-process error cases, guard faults, identity, threads,
raw-slot client, child-runner self-test), xs_proxy_mock_test (older
devices, fences without Fence1, OpenSharedHandle branches, allocation
failures; three guard-setup fault modes), and device_proxy_test through
the D3D12XboxCreateDevice shim. No game files.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPIRV-Cross 1.4.363.0 turns the whole-array OpStore of ClipDistance into the
mesh per-vertex output into a C array assignment, which Metal rejects
("array type 'threadgroup float[1]' is not assignable"). Copying each element
gives the same result on Vulkan and compiles on Metal: ms_clip draws its
expected 2048/4096 pixels in a native Metal mesh draw on an Apple A18 Pro.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The buffer unit encodes every half NaN as zero. Passing NaN to FClamp instead produced the negative signed-normalized endpoint on both translated backends.
Measured on levels.rpf: 1,549,343 HD/ORPHAN_HD placements in 2,940 chunks
(21 min) and all 1,669,771 placements in 12,340 tiered chunks (33 min), every
chunk checked structurally and samples parsed by three r160's GLTFLoader; the
LOD-tier medians and bands; what the viewer loads with and without bands; the
pin vs #8/#10 model coverage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/hw_oracle ran only on Windows, through the HIP runtime in the AMD
driver, and so far only on gfx1150. On Linux the same kernels now run as
raw compute dispatches through the kernel driver: no ROCm, only clang
with the amdgcn target, gcc and the libdrm headers.
- hw_oracle_drm.c is the launcher. Its command stream is libdrm's own
compute dispatch test for GFX10 (amdgpu_test_dispatch_memset), with
what belongs to the kernel put in: the entry point, the group size,
the kernarg pointer in two user SGPRs, and COMPUTE_PGM_RSRC1,
COMPUTE_PGM_RSRC2 and the wave size as the kernel's descriptor has
them. So the .amdhsa_* directives (register counts, float rounding
and denormal modes, IEEE, DX10 clamp) take effect as under the HIP
runtime. It prints the same lines as hw_oracle.c. Compute engine
version 10 only (RDNA1 and RDNA2).
- drm.py is the backend: it assembles with clang, takes .text, the
kernel offsets and the kernel descriptors out of the object, and runs
the launcher. A descriptor that asks for what the launcher does not
provide (LDS, scratch, more user SGPRs) is refused. The render node
must be named in LEONIDA_HW_DRM_NODE, and a node with a display
connected is refused unless LEONIDA_HW_DRM_ALLOW_DISPLAY=1.
- runner.open_oracle() picks the backend for the platform. The Windows
path is unchanged.
- asm.raw_kernel_text puts the GFX10 names of the global memory
instructions back for gfx10xx. crosslane_fuzz stores with
global_store_b32, which a GFX10 assembler does not have, so on RDNA2
every one of its programs was rejected.
One thing the launcher had to learn: while it rewrote one command buffer
in place, the second kernel of every process ran the first kernel's
commands (200 of 200 runs). Every submission now gets command memory of
its own; 24,500 distinct kernels in both wave sizes then each returned
their own words, and a test runs 300 of them.
Results on the integrated GPU of a Ryzen 9 7950X3D (Raphael, gfx1036),
Linux 7.3.5, libdrm 2.4.134, clang 23.1.5:
- salu_diff --oracle hw: 70,000 programs, 69,021 run, 0 mismatches
(seeds 1-8; seeds 1-4 with --bfe-any; seeds 1-2 with --inline64). The
s_bfe_i32 rule measured on gfx1150 holds on RDNA2, and s_ff0_i32_b32
and s_ff0_i32_b64, which gfx1150 lacks, match (2,000 programs).
--oracle translator,hw: 3,000 programs pass.
- crosslane_fuzz --oracle hw: 32,000 programs, 0 mismatches: seeds 1-6
(12,000 wave32, 12,000 wave64, 6,586 with the permlane hypothesis)
and seeds 1-2 with --dpp (8,000, 972 with the DPP hypothesis).
- f32_fuzz --oracle hw, seeds 1-6: 38,858 programs, 28,671 match, 0
mismatches, 56 known deviations (an output modifier turns -0 into +0,
as on gfx1150), the rest skipped or not judged. The four MODE settings
read back as the descriptors set them.
- Controls: a reference with s_min_i32's SCC changed from < to <= gives
2 mismatches in 5,000 programs, minimized to that instruction;
crosslane_fuzz --permlane-fetch-inactive mismatches in 239 of 1,000;
f32_fuzz --negative-control catches all six wrong models.
- No GPU fault, timeout or reset in the kernel log.
Tests: tests/test_hw_oracle.py gains tests of the backend that need no
GPU (reading the object and its descriptors, tokens, the display check,
the platform choice, the GFX10 mnemonics) and two on hardware: 300
distinct kernels, and an f32 rounding mode set in the descriptor that
must change a sum. The HIP-only test skips on Linux.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The explicit-mip fetch already selects the sampled view by numeric type. Pass its D16 modifier to the same result writer as image_load so integer components and floating halves retain their representation.
tools/f16_trans_sweep.py runs all 65,536 f16 bit patterns through v_exp/log/rcp/rsq/sqrt/sin/cos_f16 natively
(8 raw kernels of 1,024 threads per op), in wave32 and wave64 and five MODEs (IEEE, f16 denormal mode, f16
round toward zero), reads MODE back first, and compares each word with the exact result correctly rounded to
f16 (decimal, 60 digits; sin/cos reduced in turns). It counts bit-exact, 1 ulp, >1 ulp, denormals read or
written as zero, signalling NaNs kept or quieted, and the inputs where SPIR-V is undefined, and lists the words
of 23 special inputs.
On an RX 6700 XT (gfx1031): the five non-trigonometric ops are correctly rounded on every non-NaN input; sin/cos
are exact in turns over the whole f16 range (14 and 4 results 1 ulp off, all at |x| <= 1), while the f32
product 6.2831855 * x is >1 ulp off on 16,366 sin and 2,036 cos inputs (#594). denorm_mode_16_64 = 0 flushes
denormal operands and results, FP_ROUND's f16 field is ignored, IEEE only quiets signalling NaNs. The results
go into docs/design.md (a new f16 transcendentals row) and docs/shader_validation.md.
Translates the stable onboarding text (what the project is, the own-copy and no-game-data rules, prerequisites,
build commands, stage order, troubleshooting, and how to contribute) synced to c0ac5fd6, and lists pl-PL in
docs/i18n/README.md and docs/README.md.
Per the split in #1218, #1256 owns the PS interpolation-mode decoder and
census; this keeps the translator side of what #1246 put on main.
- fssm_header: read_methods()/READ_MOV/READ_INTERP/read_name() replace
interpolation_modes()/MODE_*/mode_name(); the bits say how the code reads
each input (0x01 v_interp_mov, 0x02 v_interp_p1/p2), as #1256 names them.
- rdna2spirv: check_read_methods() (same rule, refuses 0 of 12,101 PS);
index.json records ps_flat_interpolants.
- Remove tools/ps_interp_census.py and its test (#1256's ps_interp_modes.py
covers it).
- docs/design.md: the row becomes the translator-side "PS v_interp read
methods" row; the "PS interpolation modes" row is #1256's.
Depends on: #1256
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The conflict resolution in b4093239c kept both versions of the row: the one from #753 and main's older one,
which still says the MODE register is ignored. The old row's other content (pkrtz, v_mul_legacy_f32) is in
the #753 row word for word, so only the contradiction goes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MTBUF encodes a format independently of the vertex buffer descriptor. Route its D16 loads through the existing fixed-format decode and packed destination writer so a valid vertex fetch can reach a draw.
docs/design.md marked four translator rules "not GPU-verified": v_cmp(x)_nlg,
v_cvt_off_f32_i4, the VOP3 output modifiers on v_fmac_f16 and
v_interp_p2/mov_f32, and VOP3 FP modifiers on constants. This adds one pixel
fixture per rule group, each writing four constant mrt0 words derived in its
header: ps_cmp_nlg, ps_cvt_off, ps_fmac_f16_mods, ps_vop3_const_mods,
ps_interp_f32_mods and ps_interp_mov_mods. The two interp fixtures are drawn
with a new vertex shader, vs_interp_consts, whose params are constant over the
triangle.
Every word is a normal float or zero, so the R32G32B32A32_SFLOAT target can't
change it. All six are wired into check.py and run_gpu_tests.py.
tests/semantic/test_rule_gpu_fixtures.py checks that the interpreter, both
runners and the headers agree. run_gpu_tests.py now skips only
ps_interp_f16_high under --bary-fallback, as check.py does, rather than every
PIXEL_VERTEX fixture.
On a Tesla V100 (NVIDIA 580.95.05, Linux), all six write their words on 4096
of 4096 pixels, natively and with LEONIDA_W64_EMULATE=1
LEONIDA_BARY_FALLBACK=1. docs/design.md now cites them. The integer clamp row
stays with quackottu's part of TEST-175, and the denormal-flush row still
needs an RDNA1/2 part.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No FSSM word stores SPI_PS_INPUT_ENA/ADDR (u16 scan of 0x00-0x138 over all
12,101 PS against the signature-reconstructed value). tools/ps_interp_modes.py
decodes the mode from the DXBC PSV0 input elements (DXIL::InterpolationMode,
mapped to the SPI_PS_INPUT_ENA pair bits per Mesa gfx103.json), cross-checks
the FSSM table flags (read-method bits 0/1/3/4) and the disassembly I/J
operands, and runs a census: all generic inputs are Constant or
perspective-centre Linear (zero centroid/sample/noperspective); SV_Position is
noperspective by D3D rule, interpolated through the parameter cache in only 4
PS; every shader reads a single barycentric pair (v0/v1, one v14 copy). 23
synthetic tests; decoder+census only, no translator change.
Packing integer gather results as half floats discarded the texture values in both signed and unsigned views. Use the descriptor format for the Vulkan image type and pack each integer pair into its destination register.