A device whose maxPushConstantsSize is 128, Vulkan's minimum (AMD's Windows driver on RDNA2 iGPUs, some
Intel Arc drivers), can't take the 144-byte block (152 with --mesh-compute). With --pc-tail-ubo the
push-constant block keeps s0..s31 (128 bytes), and the tail that follows them by default (heap base, code
base, the --mesh-compute output address) becomes %pc_tail, a uniform block at set 1, binding 0, with the same
members in the same order. It is declared only when the shader reads the tail; the index records "pc_tail"
and 128 push-constant bytes, and "bindings" still lists set 0 only. Without the flag nothing changes.
Step 1 of the uniform-buffer tail claimed in #1902; the GPU harnesses and the D3D12 layer that bind the
block follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The translator cuts a bitfield extract at bit 31 (bfe_width) and reads offset
and width from bits [4:0], but for the VALU form this rested on gfx1150 s_bfe
runs and LLVM's v_bfe fold; RDNA2 was unmeasured.
A new valu_bfe_past31 group in tools/int_hw_probe.py runs four 4-word cases
natively (VGPR, inline-constant and literal operands): offset + width > 32,
the sign of a field cut at bit 31, offset/width bits above [4:0], width 0.
On an AMD Radeon 610M (gfx1036) wave32 and wave64 give the same words and
all four cases match the translator, so no translator change is needed.
The measured words are pinned on the CPU in tests/test_int_hw_probe.py, the
contract table gets a v_bfe row, and the bfe_width docstring no longer says
RDNA2 is unmeasured.
8x8x64 R8, 16x16x16 RGBA8, 16x16x17 RGBA8 and 8x8x8 RGBA32F were in the
table twice with the same expectations. The deep-volume set is 32 new
layouts, 79 distinct in all; the header comment and docs/d3d12_vulkan.md
section 4.2 now say so.
AI-assisted (Claude Code).
docs/d3d12_vulkan.md left root-parameter visibility open: one block in
root order (the layer's model) or the console omitting a stage's invisible
parameters, which would put different parameters at the same SGPR in a VS
and a PS. The game's shaders carry no RTS0 and the executable that pairs
them into pipelines is not in the package, so --pairs pairs a VS with a PS
by technique name (names alike apart from the VS_/PS_ token) and compares
the user SGPRs both read, with all VS x PS combinations as a control.
On the 1.0.2.1 corpus: 166 techniques have both stages, 358 combinations.
All 379 shared reads have the same kind (pointer or constant), against
25.5% different over all 26,196,976 combinations; and all 111 shared
reads above an SGPR only one stage reads still agree, where omission
would have moved them. The doc records the counts and the limits: names
approximate the pipelines, and a visible parameter a stage doesn't read
looks like a hidden one.
The tests build both models from one root signature and check that they
give different counts. Names are used for pairing only, never printed.
AI-assisted.
--run-tests runs what ci.yml's loop runs; tests/semantic and the files
that need pytest or numpy are not in it. Say so, and how to bring them in
through --junit. (TurboSosiska304's review of #2681.)
The layer clamped every HighestVersion above 1.1 to 1.1 and returned S_OK.
The host only does that for versions it defines: on an RTX 4070 Laptop
(621.24) and WARP, anything above 1.2 is E_INVALIDARG with the value left
unchanged. Keep the clamp for 1.2 and refuse the rest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neighbor colors can remain in a disabled lane. Use the same masked lane read as backward permute so an active fragment gets zero for a disabled or absent neighbor while a disabled destination keeps its previous value.
ID3D12Fence::Signal from the CPU called vkSignalSemaphore at once, also while a queue Signal of a lower value
was still pending on the GPU. Vulkan requires a host signal to stay below every pending signal
(VUID-VkSemaphoreSignalInfo-value-03259), and D3D12 allows the order. The fence now records the highest value a
queue will signal, under the same lock as the claim, and a CPU signal above a value the GPU has not reached yet
(or made while an earlier one is held) is handed to the fence dispatcher, which applies it once the GPU passes
that value, in the order the signals were made. The callback holds no pointer to the fence; when the fence is
released (cancel) or the device is lost before the queue value is reached, the held signal is dropped, since
signalling then would break the same rule. Until a held signal is applied, GetCompletedValue reads the GPU's
progress.
d3d12_fence_timing_test: a queue Signal kept pending by a Wait on a gate fence, a CPU Signal above it (held, then
applied), and two CPU signals held behind one queue signal (applied in order). Fails on main's Fence at the first
check: the event for the CPU value fired while the queue signal was still pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The API table still listed CreateAggregateDevice under "not implemented",
but the shim answers it (one device per kind, readings from every connected
device of that kind, callbacks filtered on it refused with E_NOTIMPL) and
gameinput_test covers it (test_aggregate_device). Move it to the implemented
column, say what is refused, and describe the behaviour under the table.
The scan read each digit count and stored its prefix sum over it. MoltenVK 1.4.2's SPIRV-Cross
(6c09849f; MoltenVK main pins aa217aeb, also affected) moves a load through a pointer bitcast
from a uvec2 past a later store to the same address, so the MSL read back the sum it had just
written. The radix path (more than 1,024 elements) then lost and duplicated elements:
blas_three_sort_tiles and blas_refit_in_place failed xdxr_build_check in 10 runs out of 10.
SPIRV-Cross 38abe362 fixes it upstream.
The prefix sums now go to their own scratch array (XdxrLayout::scratch grows by 64 bytes per
tile), so no invocation stores to a word whose loaded value it still uses. xdxr_build.inc
regenerated with glslc (shaderc 2026.4) --target-env=vulkan1.2 -O -mfmt=c.
Tested on an Apple M3 Max, macOS 27.3: xdxr_build_check passes 10 runs out of 10 on Homebrew
MoltenVK 1.4.2 (0/10 before), MoltenVK 5189f8de with SPIRV-Cross 57e4efcc, KosmicKrisp and
llvmpipe. The full native ctest passes 36/36 on each driver, with the same two skips as before.
AI-assisted.
Seven opcodes (v_sad_u8, v_sad_hi_u8, v_sad_u16, v_sad_u32, v_msad_u8,
v_qsad_pk_u16_u8, v_mqsad_pk_u16_u8) against an ISA-written reference and
the translated SPIR-V in spirv_mini_interp, four exported words, bit for
bit. A 785-program sweep covers every source-kind combination (the 64-bit
constant rule pinned both ways), random seeded programs widen the values.
12,810 programs across six seeds match with zero mismatches and zero
skips; two translator mutations make 36/60 and 17/60 programs fail.
clamp, op_sel/neg/abs, v_mqsad_u32_u8 (#1926/#2163) and null as a 64-bit
quad source (#2650) are out of scope, on purpose.
An empty result has two very different causes and the tool said neither: the drawable may be outside the
exported window (a window holds one region's drawables), or the model's geometry list may not follow the
triangle-count rule. Both now come with a line saying so, and a manifest that holds no model at all says that
too instead of reporting only "no Items".
While reviewing it, two traces were still possible instead of a message: an OBJ with fewer `o` groups than the
manifest's geometry arrays (now an error naming both counts) and a non-string shader hash (now reported per
candidate, not as a traceback). Exit status is documented in the docstring.
Reported by @kacper-serewis: an independent run against a 1 GiB window cut at 10 GiB exported 3,731 models with
no failures and found no candidate for the first ten BLAS of the comparison pack, whose drawables are in the 3 GiB
window this PR measured. The run was correct; the report did not name its window, and docs/bvh.md now does.
Synthetic tests only; three cases added, 16 in total.
The mesh shaders build a tangent from the bits the normal leaves: with bit 31 set, bits 20-29 are an angle
(v * 2pi/1023 - pi) that turns a basis made from the normal alone; with bit 31 clear, bits 16-22 and 23-29
are a 7-bit octahedral tangent. Bit 30 is the bitangent sign. tangent_0x21 is that decode, and the tool
now counts each tangent against the texture-coordinate gradient dP/du of its triangles, with a randomly
turned tangent as the chance level, and bit 30 against the side of dP/dv. docs/restofworld.md records
the counts on two archive samples.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nine archive scanners sliced every gap out of the mmap to test whether it
was all zero (`gap = m[last:s]; gap.count(0) == len(gap)`). The slice is a
copy, so a gap of N bytes allocated N bytes at once; about half of
story000.rpf (~20 GB) is non-zlib, which ends in MemoryError on a 16 GB
machine.
tools/zero_span.py compares the gap with zeros 4 MiB at a time and stops at
the first non-zero window, with the same counts (all of a gap is padding
when every byte is zero, otherwise all of it is unread). rpf9_carve,
rpf9_names, bvh_index, navmesh_index, navmesh_decode, rbf0_index,
anim_index, restofworld_index and story_index use it.
tests/test_zero_span.py checks the counts against the old expression and
runs each scanner on a 48 MiB gap under tracemalloc: 50-51 MiB heap peak
on main, under 24 MiB with this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rpf9-explorer's RageModelDecoder reads vertex slots this way; it sizes all
99,184 slot words of the minigame archive's 63 30 and 42 40 blocks (counts
only), so tag_stride replaces the per-tag table (for the six types seen) and
the archive walk gives identical totals. docs/story.md gets the tag/type
table, the +0x7C meaning (snorm16 UV scale, rpf9-explorer) and the slots
actually used (0-4, 11-15, 18; #2424 said 0-4 and 11-14).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>