buffer_store_format_d16_xyzw into every narrow UINT/SINT format, read back
from gfx1036 (wave32 and wave64 alike): a SINT half is sign-extended before
the clamp. Dropping the signed d16 source for sint now fails 10 rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Apple GPUs MoltenVK samples a vkCmdWriteTimestamp in a blit pass of its own at the end of the current Metal
encoder. Nothing orders the vkCmdCopyQueryPoolResults resolve after that pass. The copy read the old value, or 0 for
a timestamp never written, so d3d12_vulkan_device failed under Wine on a Mac (t1 == 0). A minimal Vulkan program
reproduces it natively on MoltenVK 1.4.3 and 1.4.2: the copy was right 0 to 43 times in 200, in the same command
buffer, the next one or the next submit. KosmicKrisp and llvmpipe were right in every case.
Where driverID is MoltenVK, the queue sets and waits for a fresh VkEvent before each timestamp resolve that copies.
A submission with such a resolve also waits on the queue's timeline for the submission before it. Both measured
200/200 and 500/500. The timestamps are still the GPU's own. The events go back to a pool after a host reset once
their submission completes. d3d12_vulkan_device also checks a resolve in the execution after the write. Documented
in docs/d3d12_vulkan.md section 4.6.
The 42 40 block has a 0x80-byte header with the same slot words; tag 0x42
streams are 8 bytes a vertex and tags 0x21/0x26/0x27/0x28 4 bytes. Over
shared_minigame000.rpf 14,671 headers fit exactly and every one is followed
by a recognised chunk. The walk used to stop at these blocks; it now reads
1,569 streams instead of 335 (159,387 meshlets, 16.9M triangles), 0 left
unparsed. A 63 30 block slot past 4 takes its tag's stride. Positions and
attributes are not decoded. Counts only in docs/story.md; synthetic tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in tools/rdna2spirv.py: both sides added a module function
before cs_dispatch_state (ds_const_extent, check_printed_encodings);
both kept. main's new ds_mskor path now goes through lds_access, so it
is bounds-checked like the other LDS accesses (test added), and the
mock Gen in main's new test_lds_atomic_minmax/xchg tests gains
lds_bound/lds_access/lds_atomic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Console structures keep offsetToParents negative: the entries of the low units
(the leaves) fall before the header and are not stored; only the ones between
the header end and offsetToElements are. validate() read the field unsigned and
raised struct.error on 7 of 8 rehydrated BLASes (@wildheathen, @Flyander). It
now reads it signed and compares only entries whose address is in
[header end, offsetToElements). A synthetic structure in console layout
(negative offset, leaf entries dropped) covers it; a wrong stored entry and a
runtime build are still caught. docs/bvh.md 3.1 drops the Open note.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
docs/bvh.md 3.1: u32@0x20 = 0x140 + 64 * totalSizeIn64BNodes, 271,627 of
271,627 streams. xdxr_build.comp wrote total_size / 64; the copy and
postbuild paths read the field as the whole size, and tools/xdxr_bvh.py
wrote and validated it the same way. Now the header writes total / 64 - 1,
MODE_COPY_AS and MODE_POSTBUILD use (field + 1) * 64, validate() and the
reference builder agree, xdxr_build.inc is regenerated (glslc 2026.4) and
d3d12_xdxr_rt_test reads the size the same way.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The f32 OpFMul of the clamped value and 32767 (or 65535) can land exactly on k + 0.5 while the exact product is just
below or above it; RoundEven then picked the even neighbour, one off from the hardware on 28 of 28 such inputs on an
RDNA2 iGPU (gfx1036, SHADER-339). The product's error Fma(c, s, -p) is exact, so on such a tie the translator now
takes floor(p) + 1 when it is positive, floor(p) when negative, and RoundEven when it is 0. Away from a tie both
roundings agree.
tools/pknorm_probe.py --oracle hw on the same iGPU now exits 0: all 134 words equal the translator's in wave32 and
wave64 under five MODEs. tests/semantic/test_alu_cvt_pknorm_f32.py's reference rounds the exact product once and
checks the twelve measured near-tie words (they fail on the old translation); tests/test_pknorm_probe.py expects
single rounding. docs/design.md: the three copies of the pknorm row become one, with both RDNA2 measurements.
ps_texoff_forms runs the three forms on vk_texture_test's texture with ps_texoff's per-pixel offset (all 64 pairs in
-4..3). check.py and run_gpu_tests.py judge it with texoff_words(..., "ps_texoff_forms"); unit tests check that a
dropped or swapped offset fails. 4096/4096 pixels exact on an RTX 4090 and on a gfx1036 iGPU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When one input location is read both through a P0 move and through a smooth interpolation pair, Vulkan interpolation loses the original vertex value. Retain the three vertex values so each instruction can use its own input rule.
Translated from the current README (build, prerequisites, troubleshooting, contributing); synced with 4eb6155d. Adds its row to docs/i18n/README.md and the code to the docs index. test_i18n_index, test_docs_links, test_docs_repo_paths and test_docs_list_items pass.
@AwkGrep256 ran tools/buffer_format_fuzz.py on a real RDNA2 (gfx1036, #2022): the same totals as the
Radeon 880M, 0 mismatches, and 199,144 elements of the 14 GFX10-only codes, also 0. This follows both.
- 16_FLOAT, 16_16_FLOAT and 16_16_16_16_FLOAT format stores round toward zero, saturate at +-65504 and
keep a NaN a NaN (Gen.ufloat_encode_bits, now with an optional sign). d16 data rounding (#1759) is
not touched.
- Every UNORM, SNORM and SCALED store rounds the exact product once (Gen.norm_encode_exact): 0.3 *
65535 stores 19661, not 19660.
- A two-component format stored through a V# takes channel y as its second component when DST_SEL_Y is
Y and DST_SEL_Z a constant (the runtime's X,Y,0,1: gfx1036 narrow-integer fixtures, gfx1150), and
channel w otherwise (identity XYZW, @AwkGrep256 and gfx1150); _xy then writes (x, 0). tbuffer keeps
(x, y). A probe with XYZW alone would have shown (x, w) for every V# and broken the runtime's
selectors, which the oracle now also covers (XY01 runs for the two-component formats).
- Gen.FORMATS has all 77 codes: 30-35 and 37-42 (10_11_11 and 11_11_10 with UNORM..SINT) join.
- buffer_format_fuzz: the model has one store route per path, select_formats runs all 77 codes by
default on a GFX10 device, the known-difference count is gone (0 on the 880M).
The three expectedFailure tests pass; the fixtures that baked the old behaviour (cs_fmt_sint32, test_translate
f16 and int32 store tests, test_value_semantics) take the measured words. Sizes: cs_store 206 KB on
main, 125 KB here.
Co-Authored-By: AwkGrep256 <AwkGrep256@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
breadbbbb/rpf9-explorer#8 (null optional header pointers, range-checked
16-bit fields) and #10 are both ancestors of Leonida's pin e2939175, so the
pinned explorer accepts the fragment headers the sentence said it rejects.
Say that, keep the 41.3% as the figure at the earlier pin 917e9b9, and note
that the 99.96% was measured on 917e9b9 with #8/#10 applied, not recounted
at e2939175.
The real DisableThreadLibraryCalls only accepts a module the Windows loader
mapped, so for a manually mapped image it returned FALSE. A DllMain that
returns its result (the MSVC runtime's msvcp140_1, msvcp140_2,
msvcp140_atomic_wait and msvcp140_codecvt_ids DLLs do) then made
Loader::initialise() throw "DllMain returned FALSE".
shims/library_loader.cpp serves the call next to FreeLibrary: TRUE for a
module the shims own or the loader mapped, the real function for any other
handle. New dll_thread_calls_test (CRT-free fixture DLL) fails on main and
passes with this change; docs/runtime_imports.md counts follow.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Keeps the swapchain_colorspace enable and main's custom border colour extension in
create_vulkan_device_standalone; the present compose path follows main's LayoutPieces.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XCurl.dll reads HKLM\Microsoft\GamingServices ServiceRetryTimeout, then
LoadLibraryExW(L"gameplatformservices.dll", nullptr,
LOAD_LIBRARY_SEARCH_SYSTEM32) and GetProcAddress'es GetApiVersionImpl and
QueryApiImpl (disassembled, no code run). The shims didn't own that module,
so the load went to the host: on a PC with Gaming Services it would reach
the real PC runtime's QueryApiImpl and bypass the offline classes; without
it XCurl returns 0x87E00196. Either way the result depended on what the
player has installed.
The shim table now serves gameplatformservices.dll!QueryApiImpl (the
offline one) and GetApiVersionImpl(uint64_t*, uint64_t*), measured at its
call site (two pointers to 64-bit locals, result unread; XCurl compares the
pair with the last one it saw), writing the same two values every call.
owns_dll() follows from the table, so library_loader answers the load.
xgameruntime_test: the LoadLibraryExW(..., SEARCH_SYSTEM32) load, the
versions and the shared QueryApiImpl (+3, 65). docs/runtime_imports.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A separate ISA model for 55 integer opcodes (VOP1/VOP2 as e32 and e64, VOP3-only ops, VOPC e64 + v_cndmask) with VGPR, SGPR, inline, float-inline and literal sources within the encoding and constant-bus rules, compared one lane at a time with rdna2spirv run in tests/semantic/spirv_mini_interp.py, optionally with the hardware through tools/hw_oracle. A mask read as data (#293) only with --known.
AI-assisted.
Re-measured against the local package: the RPF9 stream boundary that ends a system prefix (and the negative on the 8 MiB rule), the PRD0 member type codes, and the navmesh polygon +4 packing. The navmesh road/pavement bit labels did not reproduce and are recorded as such. 6stars is cited as independent corroboration; no code was copied and the repository has no licence.
With LEONIDA_PC_TAIL_UBO=1, build.py and run_gpu_tests.py translate with --pc-tail-ubo, and the test
programs (vk_compute_test, vk_store_test, vk_harness, vk_texture_test, vk_sampler_test, vk_bindless_test)
declare and push 128 bytes and, when a stage declares set 1, bind the tail block there
(runtime/test/vk_pc_tail.h: a host-visible buffer with one slot per dispatch or draw, bound as a dynamic
uniform buffer). vk_harness refuses --mesh-compute with the flag (exit 77): mesh_compute_vs.py's vertex
shader still reads its address from push constants. Without the variable nothing changes.
Step 2 of the uniform-buffer tail claimed in #1902.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a Ryzen 5 7600's iGPU (RDNA2) with AMD's Windows driver 24.10.24, OpSMod of a negative coordinate came
out with the dividend's sign, so ps_gather_wrap's three cases with a negative wrap or mirror coordinate
fetched outside the image and read zeros. Gen.gather_addr now computes c mod n as OpSRem plus n when the
remainder is negative, the same value for a positive period; the same module is then exact there, and still
on an RTX 4070 SUPER. tests/test_translate.py counts the new instructions; docs/design.md records why.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Keep the per-chunk checks and repeated Opus packet verification alongside the short-final-block fix already on main. Set accurate mono and stereo sample counts in the overlap fixture so it also exercises the current Ogg trimming behavior. AI-assisted.
An EXP component mask can write different channels of the same MRT across multiple instructions. Retain disabled components from that target so a later export does not erase color that an earlier instruction wrote.
libHttpClient.GDK.dll asks QueryApiImpl for XSystemImpl with IXSystemImpl5's
interface id and calls slots 3-8 (thunks disassembled, no code run): three
(size, buffer, used) id queries, then two pointers, one pointer and a bool:
xgameruntime-docs' IXSystemImpl list (console id, Xbox Live sandbox id,
app-specific device id), IXSystemImpl3's (XSystemHandleTrack,
XSystemIsHandleValid) and IXSystemImpl4's (XSystemAllowFullDownloadBandwidth),
IXSystemImpl2 and 5 adding no known method.
Offline answers: the existing 39-byte console-id placeholder, sandbox
RETAIL, a 45-byte app-specific device-id placeholder (short buffers get
ERROR_INSUFFICIENT_BUFFER, null E_INVALIDARG), handle tracking accepted and
never called back, a non-null handle valid, bandwidth S_OK.
docs/runtime_imports.md: libHttpClient calls five classes through thunks
(not only an id table, as the table said): their slot ranges, with the
XSystemImpl and XPackageImpl rows. xgameruntime_test +5 checks (74).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rdna2spirv maps a legacy GS's LDS write to an output slot from its
offset alone and drops the VGPR address (the lane's GSVS area), but
wave64_halves read that address as the store's data, so a GS whose lane
id only forms its GSVS base was tier C lane-id. It now checks only the
data operands of a GS ds_write.
w64_graphics.py draws gs_w64_a_ring and gs_w64_c_lane_id at wave64 and
wave32 (RADV_PERFTEST=gewave32), build.py builds gs_* fixtures with
gs_tri's signatures, docs/testing.md explains how to run and extend the
wave64 graphics checks, and docs/design.md records the rule and that the
corpus GS are written for wave64. Checked on an RX 9070 XT (GFX1201) and
a Ryzen 9800X3D iGPU (GFX1036), RADV Mesa 26.3.1: 23/23.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>