The device can allocate 1D textures and set 0 has a sampled 1D binding, but default and explicit views previously sampled the fallback. Use the texture dimension and the requested mip range when registering the view.
The format block carries the per-channel count at +0x0C: equal to +0 for mono
and half of it for stereo in 7,451 measured streams (0 mismatches), matching
rpf9-explorer's OpusFrameCountPerChannel. Use it (with +0/channels as fallback)
instead of inferring the division, and document the field.
RT-54 switched to WARP only on NVIDIA (PCI vendor 0x10DE). AMD faults the same way: on an RX 7900 XTX the
XboxBvhBuilder constructor ends with 0xC0000005 right after the first slot 62 call (found by
@ThatZaliaSGuy, #166). The test now uses WARP whenever there is a hardware adapter, prints the vendor id it
skipped, and LEONIDA_BVH_HARDWARE=1 still keeps the hardware device. docs/d3d12_vulkan.md updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The other 64-bit scalar bitwise ops were translated, these three were
rejected. They join the s_and_b64 branch: D = ~(S0 op S1) on the
lane-mask path (a lane's mask value is 0 or ~0, so the NOT is per lane)
and on both dwords of 64-bit data, SCC as for the others.
test_salu64_bitwise_data.py runs them through its data cases (distinct
dwords, four-corner SCC, immediates, null, aliasing) and the wave32 and
wave64 lane-mask cases. docs/design.md row updated.
Pipelines (graphics and compute) whose translated shader declares set-0 bindings were refused. Their layout now
holds the device's bindless set 0 and replay binds it at every draw and dispatch. d3d12_m2_textured_test drives
heaps, SRVs, a POINT sampler, two root descriptor tables and DrawIndexedInstanced with a translated PS that
loads the T#/S# from the tables; 4096 of 4096 pixels match, and the descriptor hash table is checked.
d3d12_translated_draw_test is registered with ctest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CopyResource and CopyTextureRegion between D32_FLOAT and R32_FLOAT/UINT/SINT,
and between D16_UNORM and R16_FLOAT/UNORM, were refused at execution because
vkCmdCopyImage cannot mix a depth and a colour aspect. Host D3D12 and WARP
copy the bits, and #1134 listed these as not covered.
The replay now stages each such region image -> scratch buffer -> image.
The scratch comes from a new ScratchBuffers pool (vulkan_scratch.h):
device-local chunks handed out while a list is prepared and retired with
the submission's timeline value, like the depth24 converter's scratch, but
enabled on every GPU. Without it the copy is refused as unsupported before
anything is written.
Still refused: depth with stencil (two planes), D24 stored as D32, and
multisampled textures.
Tests: d3d12_copy_xfmt gains five depth <-> colour cases (R16 -> D16 both
ways, D32 -> R32_UINT, three mips, and a D32 -> R16 negative control), and a
depth <-> colour mismatch now fails it. vk_command_replay_test part H runs a
D32 -> R32 -> D32 round trip through the replay, and checks that a list is
refused with no scratch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
valu_fuzz.py, lds_fuzz.py and crosslane_fuzz.py ask vk_compute_test for
32-lane subgroups (VKC_SUBGROUP_SIZE=32) for wave32 programs, but they
ignored its "compute subgroup size: 32 not available" line. On a device
that can't pin that size (Mesa llvmpipe: 8 lanes) every wave32 program
was judged at the driver's size and its cross-lane results came out as
translator mismatches. On main f85582e with llvmpipe, lds_fuzz --emulate
--programs 400 --seed 5150 gave 215 mismatches, all wave32, and
crosslane_fuzz --wave 32 --no-maskdata gave 68 of 100.
Those wave32 programs are now skips, as check.py's unpinned_subgroup_skip
does for its lane-mask dumps. Programs translated with --wave64-emulate
use no subgroup operations, so they are still compared at any size
(400 of 400 match on llvmpipe). crosslane_fuzz counts the skips in its
summary and exits 2 when every program was skipped, as the other two
fuzzers already do.
The line is parsed by compute_fixture.unpinned_subgroup, shared by the
three fuzzers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rpf9_carve over textures.rpf: 2,749 streams; 1,313 system/graphics page pairs
of one two-texture dictionary template (128x128, format code 0x5f, payload
exactly 2 x 16,384 bytes) with 1,117 distinct payloads, and 121 opaque raw
streams holding 91% of the inflated bytes. Counts only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MoltenVK can't compile PerVertexKHR to MSL, so ps_interp_f16_high failed at
pipeline creation on every Mac. With --f16-interp-fallback every VS/mesh param
(and the --mesh-compute VS) also exports its two f16 halves decoded to f32,
low halves at location 29 - 2N and high halves at 30 - 2N, and a PS *_f16 read
takes them as ordinary smooth inputs. A producer skips halves that would land
on its own params; a PS whose half location is also an attribute is rejected.
The index records f16_halves on both sides.
tools/vk_subgroup_info.py reports per_vertex_inputs (false without
fragmentShaderBarycentric or on MoltenVK); make_game.py and run_gpu_tests.py
turn the flag on where it is false. Without the flag all 139 GPU-test modules
are byte-identical to main's, so NVIDIA/AMD keep the exact per-vertex path.
Apple A18 Pro, macOS 26.6.2, MoltenVK 1.4.2: ps_interp_f16_high passes, all
4096 pixels bit-exact; run_gpu_tests.py 84 pass/50 skip/1 fail -> 85/50/0
native, 112/22/1 -> 113/22/0 with wave64 emulation; ms_f16_pack passes through
--mesh-compute. Semantic suite 1194 -> 1203 OK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted
main is at bb2e1842. Three conflicts, both sides kept:
- runtime/test/vk_store_test.cpp: main added the "load-d16" mode (a row of
16-bit boundary values in the fill, for the saturating d16 loads) and
VK_KHR_shader_fma support; this branch added the "words" mode. Both modes
and both includes stay; main's boundary row applies to "load-d16" only, so
"words" keeps the plain fill its expected words are derived from.
- runtime/test/shaders/check.py: main lengthened CS_STORE on the line next to
this branch's cs_bvh32 entry. Both lines.
- tests/test_shader_checks.py: main counts cs_fma_fused (8 -> 9) on the line
after this branch's STORE_WORDS and GET_LOD_TESTS terms. Both.
The automatic merges were read as well: vk_compute_test.cpp keeps the larger
bvh heap next to main's shader_fma code, and check.py and run_gpu_tests.py
run cs_imgload_d16 in "load-d16" next to the "words" fixtures.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
OpusHead declared pre-skip 0, so every exported stream started with 312
samples of libopus priming and the end trim removed the same amount of real
audio. Write the lookahead (312 by default, --pre-skip overrides it) and make
the trimmed final granule pre_skip + length.
The plain-stream length also scaled the format tag's sample count by
48000/rate and ignored stereo interleaving. Measured over 1,598,151 plain
streams: packet samples - declared is 1920..2879 for every 48 kHz and 32 kHz
stream, which is only possible if the declared count is already 48 kHz frames;
after halving stereo counts the same 1920..2879 window holds for all 17,983
stereo streams. Scaling a 32 kHz stream by 1.5 left the padding untrimmed.
Tests cover the pre-skip, the 48 kHz frame count, stereo halving and the
--pre-skip bounds. libopus round-trip: the fixed output matches the reference
Ogg sample-for-sample (max |diff| 0); before the fix it was shifted 312
samples and differed by up to 12,188.
Narrowing a channel to an eight- or sixteen-bit UINT field must clamp high values before packing. Native RDNA2 returns all ones for an overflowing field, while masking wrapped it to the low bits.
runtime/README.md: the RtlPcToFileHeader redirect, and the thread events in
place of "the loader does not deliver thread attach/detach events"; mapped
DLLs' DllMain still gets no thread events. design.md: the CPU-code row.
Use the current common image packer and its boundary-value fixture for the sample shader. Keep the merged explicit-gather paths and the headless presentation skip.
Native RDNA2 clamps 32-bit unsigned contents to the 16-bit range before packing both halves. Reuse the integer narrowing helper for MUBUF and MTBUF while preserving full-width fetches and the unused high half.
The one CProceduralInfo document in common.rpf has a 255-slot procedural tag
table (107 names; one placeholder name fills 149 untagged slots) whose 66
procObj and 69 plant tags point into procObjInfos and plantInfos lists that
are both empty. No names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/design.md leaves one f16 question open: in round-to-nearest mode, does
v_fma_mixlo/hi_f16 round the exact x * y + z once to f16, or to f32 first
and then narrow? The translator does the second (f32 Fma, then f16_res).
The RX 6800 word behind the toward-zero rule can't settle it, because
1 * 2 - 2^-30 gives 0x4000 under both readings in nearest mode.
tools/fma_mix_probe.py has seven inputs where the two rules differ by one
f16 ulp, plus a control:
- ties just above and below, for both signs;
- the subnormal tie at 2^-25;
- the overflow tie at 65520;
- a tie made by the product;
- the same with f16 operands.
It reports which rule each side follows:
- the translator, on the CPU interpreter;
- --oracle hw: the native instruction on an AMD GPU, through
tools/hw_oracle, under the game's inferred MODE;
- --oracle vulkan: the translated compute shader through vk_compute_test,
with operands in user SGPRs so the driver can't fold them.
tests/test_fma_mix_probe.py checks:
- the expected words against a derivation written out by hand;
- that the translator follows the double rule today;
- that the compute listing gives the pixel shader's words;
- the verdict and exit codes.
On an RTX 5060 (621.24) the translated shader follows the translator's rule
on all eight inputs. A translator copy that uses fma_mix_odd in nearest mode
gives the single-rounded words on the CPU and on the GPU. That is the fix
if AMD hardware turns out to round once. The translator itself is unchanged.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Static reading of the FSR DLL's call sites, added to section 3.5a:
- 54 is ClearUnorderedAccessViewFloat and 55 DiscardResource (both +4).
- 59 is one console slot with a bool first argument, used for both ends of a
GPU event; the two slots the console lacks are among 56-60.
- 85 takes the six CopyTextureRegion arguments (two copy locations), not one
pointer: buffer-to-texture with a footprint from device slot 38, or
texture-to-texture.
- Pipeline slot 11 (console-only) gives a per-pipeline scratch value; the
largest times 0xd0 sizes FFX_XBox_ComputeScratch, and slot 141's fourth
argument is the bound pipeline's value.
- A byte at device +0x18 selects between the DLL's own 32-byte descriptor
copy and device slot 24 CopyDescriptorsSimple.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Counts over CEntityComponentLodManagerData and the object, vehicle and ped
component-set managers in common.rpf: 33 component types with pool sizes;
every type used by the 7 vehicle and 15 ped sets (32 of 33) is in that list;
DefaultSet refs resolve; Min <= Max distance in all 263 components. No names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- parse_adat_header_bytes/parse_adat_at_file rejected count == 0 outright, so the validated
walk missed audio.rpf's two 20-byte zero-stream banks that the encrypted TOC lists and
AwcRecovery.ReadValidated accepts (docs said 7,160 banks vs design.md's 7,162).
- A zero-stream bank is now accepted only when the flag-selected tables end exactly at the
declared header size; slop, truncation and out-of-bounds stay rejected.
- Three synthetic tests (no game bytes); docs/rsc8_audio.md corpus row updated to the
re-measured 7,162 banks / 28,505,691,532 bytes with a note on the layout.
AWC stream tables keep only joaat(lowercase name) & 0x1FFFFFFF. With ~1.8M
distinct ids in a 2^29 space, ~0.3% of arbitrary words collide, so
awc_names.py accepts a hit only as an exact dialogue-wave word
(<root>au_<4 letters>_<NN>) or as a numbered family in one bank (3+
members or 2 adjacent, common-token base, one member a dictionary word).
A salted control run estimates the false names and sets each rule's
threshold per source.
The dictionary takes word lists or a hashdict.py JSON, and builds dialogue
wave names from conversation key/label pairs (<key>_01.._N per label).
Banks come from .awc files, directories or rpf9dump's audio_manifest.json.
On 1.0.2.1: 266,781 of 1.85M ids named (story000 73.7%, audio 5.7%),
with 417 control hits. Standard library only; tests are synthetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>