Open question 19 asks what the 0x03000000 flag bits mean. Their origin can
be measured statically: of the two console-compiled clients only
XboxBvhBuilder.dll sets them. All 52 RTS0 parts in its shaders carry
0x03000000, and the function at 0xc2d0, which holds its only
D3D12SerializeVersionedRootSignature call (0xc32f), ORs them into the
stack copy's v1.1 Flags at 0xc30e with no branch before it. The FSR DLL's
29 RTS0 parts carry 0 and its code never uses the constant. The meaning
stays open, as does what the executable's root signatures carry.
Open question 19 asks what the 0x03000000 flag bits mean. Their origin can
be measured statically: of the two console-compiled clients only
XboxBvhBuilder.dll sets them. All 52 RTS0 parts in its shaders carry
0x03000000, and the function at 0xc2d0, which holds its only
D3D12SerializeVersionedRootSignature call (0xc32f), ORs them into the
stack copy's v1.1 Flags at 0xc30e with no branch before it. The FSR DLL's
29 RTS0 parts carry 0 and its code never uses the constant. The meaning
stays open, as does what the executable's root signatures carry.
Describe the post-pass pipeline and draw that are omitted, and the shader files, library entries and descriptor setup that remain required. Addresses the scope feedback on PR #1825. AI-assisted with Codex.
Translation of the stable onboarding text only, synced to 003e781.
Adds its row in docs/i18n/README.md and `ja` in the docs/README.md
language list. Docs only.
AI-assisted.
A GDK title reaches XTaskQueue/XAsync/XThread/XError through
xgameruntime.lib thunks, not named imports: QueryApiImpl(class, class),
one vtable slot with `this` first, then Release. QueryApiImpl refused
every class, so none of those calls could work.
The slot order is xgameruntime-docs' Layout list after IUnknown, and is
measured: the thunks linked into the package's libHttpClient.GDK.dll and
XCurl.dll (disassembled, not run) call IXThreadingImpl slots 3-7 and 9-30
and IXErrorImpl slot 3, each with the argument shape of the documented
function at that position (docs/runtime_imports.md, "Class layouts,
measured").
- XThreadingImpl: 28 slots forwarded to third_party/xtaskqueue (the same
code the named exports use), a per-thread time-sensitive flag, and the
two private slots (XAsyncBeginAlloc, XTaskQueueIsEmpty) logged once.
- XErrorImpl: XErrorReport (the docs' "_unknown_" slot; HRESULT + string)
logs and calls the XErrorSetCallback callback; XErrorSetOptions is S_OK.
- Process-wide singletons; QueryInterface answers IUnknown and the class.
- xgameruntime_test drives both slot by slot; tiny_gdk_load (under
gta6rt --run) creates and closes a queue through slots 12 and 17.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_vulkan.md listed its RTV/DSV bullet twice (the second an older
version) and the "Hash-table cost" and "Wave64" risks twice each; keep the
current copy of each (the hash bullet with the Intel/RTX 5070 Ti/RDNA3
measurements, the wave64 bullet with the per-stage subgroup rule).
character_models.md kept the first line of a rewritten bullet. The new test
flags a list item whose opening repeats within a few lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Formats 5, 6, 11, 12, 18, 19, 28, 61 and 70 (8_UINT, 8_SINT, 16_UINT,
16_SINT, 8_8_UINT, 8_8_SINT, 16_16_SINT, 8_8_8_8_SINT, 16_16_16_16_SINT)
were missing from Gen.FORMATS: a MUBUF load through one read 0 and a
store wrote nothing. UINT channels zero-extend and stores saturate; SINT
channels sign-extend and stores clamp the signed value. Every expected
word in the new semantic test was read back from a gfx1036 run of the
same instruction (tools/hw_oracle, wave32 and wave64).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The zh-CN quickstart was last synced at e7584c5. Since then the English
onramp gained --pick, --check --full-check, the RDNA2-Windows wave64
exception (#857), the four fallback flags and the clang-cl 22.1.7/22.1.8
note. Translate those stable onboarding lines and bump the sync commit
in the header and in docs/i18n/README.md.
Five warm-up dispatches are too few to bring the GPU clocks up: with the old
default the first placement of --memory all read 30.4 us/1M (RTX 4050, 1k
uniform T# hit) against 23.3 for the same memory type measured warm. The new
--warmup-ms (default 300, 0 = off, --quick off) re-submits the command that is
about to be timed until the time has passed. Self-test covers the option.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both commits of #1653 and #1656 landed by hand on main, which left the
Known-problems table with the implicit-layer row twice and three
overlapping overlay rows, and the validation paragraph saying overlays
ignore VK_LOADER_LAYERS_DISABLE=~implicit~ outright. Keep one
implicit-layer row and the overlay row that has @Rainmaker33's finding
(the loader ignores the variable only in an elevated terminal, and RTSS
adds STORAGE only while it runs), and correct the paragraph to match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
s_and_b32 s20, exec_lo, 1 put each lane's bit in s20, which lane_masks.py
classifies as data when the other operand is a constant, so s_bcnt1 of it
counted 32 / 0 instead of 1 (found by @Pierre-Kookis on #1792, reproduced
on AMD RDNA2 and an RTX 4070 Ti SUPER; main was right). The mask read is
now only for an EXEC / VCC destination; into a plain SGPR the op keeps the
data read. test_mask_src_sgpr_const.py has the case.
RADV runs the VS stage as wave64 by default and as wave32 with
RADV_PERFTEST=gewave32, so w64_graphics.py now draws seven vs_w64_*
fixtures (tiers A, B and C) both ways and compares the words each vertex
stores to the heap. vs_w64_c_lane_id is the probe that the wave size
changed. vk_harness gets VKH_VERTICES to draw enough vertices to fill
waves. Checked on an RX 9070 XT (GFX1201) and a Ryzen 9800X3D iGPU
(GFX1036), RADV Mesa 26.3.1: 21/21.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
003e7812 loads EXEC before OpSelectionMerge in global_atomic and global_atomic_x2,
so FindTreelets assembles and validates. The 10 left are still the four rules.
The 52 containers in XboxBvhBuilder.dll carry an LLVM bitcode blob and an
XDAT/XBCH record. The console record decompresses to FSSM: 52/52 unpack, 42
translate, 41 pass spirv-val with the existing translator. The 10 left need
global_atomic_fmax/fmin, buffer_load_ushort and tbuffer_load_format_x (format
8), plus one OpSelectionMerge emission bug. Correct the DXIL-front-end premise
in d3d12_vulkan.md (4.8, 7.1, 7.2, M6, Q7, Q20, A.2) and index the new note.
CreateUnorderedAccessView on a buffer with a typed Format writes a typed V# (GFX10_FORMAT code, element size as
stride, element count, OOB_SELECT structured, the format's own DST_SEL), and a structured view with pCounterResource +
CounterOffsetInBytes writes a second raw 4-byte V# in the upper 16 bytes of the slot (a hypothesis for the console
contract, documented in section 3.4). The combinations D3D12 documents as invalid leave a null slot.
d3d12_buffer_uav_test runs two hand-written RDNA2 compute shaders through the translator (typed store/load/atomic on
five formats with NUM_RECORDS as the bound; append by 256 lanes and consume by 128 on a counter at offset 4096, read
back with CopyBufferRegion) against a CPU reference, then compares typed-buffer and counter clears with the host D3D12
runtime on the same adapter (LUID).
Depends on: #1791
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tbuffer_store_format_* and its d16 forms were Unsupported, though every
tbuffer_load_format_* form translates. They now go through buffer_store
with the instruction's format, as the loads go through
buffer_load_format:
- only that format is encoded, with no branch on the V#'s FORMAT;
- the bounds check uses its element size;
- a V# whose FORMAT is 0 (INVALID) still disables the store, as measured.
(@Vonsek covers the MTBUF loads and @opit80 the raw MUBUF accesses
through such a V#.)
The format parsing the loads did inline becomes mtbuf_format(), shared by
both: no modifier is GFX10's default BUF_FMT_8_UNORM, and a format
FORMATS has no encoder for stays Unsupported. read_before_write_vgprs
now counts a tbuffer store's data VGPRs as reads, as for buffer_store.
cs_tbuffer_store.asm stores into 13 sentinel-filled regions through V#s
whose format differs from the instruction's or is 0, and reads them
back. Every
expected word was measured by running the same body natively on a
Radeon 680M (gfx1035, RDNA2); wave32 and wave64 gave the same 52 words:
- the instruction's format decides the encoding, the element and the
bounds;
- components the format has but the store doesn't give are 0, and extra
ones are dropped;
- the default format is one byte, and its neighbours are kept;
- a FORMAT-0 V# leaves the region untouched.
check.py and run_gpu_tests.py compare the dump. The semantic fixture
runs through the interpreter in tests/semantic/test_tbuffer_store.py,
which fails on the old translator (Unsupported). It also fails on
versions that take the bounds from the V#'s element (5 words differ),
take the format from the V#, fill missing components with anything
but 0 (1 word), or drop the FORMAT-0 guard (2 words).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/saves.md and the tools/saves.py docstring named
runtime/shims/xgameruntime_services.cpp as the runtime's save store; that file
is only in the open #279, and on main XGameSave* imports get the loader's
default answers. docs/shader_validation.md named spirv_mini_interp without
its .py. tests/test_docs_repo_paths.py checks that backticked tools/,
runtime/, tests/ and scripts/ paths in docs/ name tracked files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
read_index did not check that the stream opened and returned an empty index,
with no error, for an empty input, so a wrong directory exited 0 after checking
nothing. Both now set the error (exit 2, before Vulkan is loaded); a valid {}
stays an intentionally empty index. tests/test_vk_pipeline_check_index.py covers
missing, empty, whitespace-only, malformed and {} (no GPU needed).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
s_mov_b32 s20, 0x3ffffc00; s_and_saveexec_b32 s6, s20 left all lanes on:
mask_src read the SGPR's raw value, the same non-zero constant in every
invocation. The 32-bit bitwise SOP2 ops read constants raw too, so
s_and_b32 exec_lo, exec_lo, 0xff00 (inline or in an SGPR) kept every
lane, and s_mov_b32 exec_lo, sN did the same.
mask_src now takes bit L of an SGPR holds_lane_mask doesn't flag (the
high SGPR of a pair for lanes 32-63 in wave64). In wave32, a bitwise SOP2
on masks (EXEC/VCC destination or a mask source) reads both operands
through mask_src (sop2_b32_srcs), and s_mov_b32 exec_lo/hi from a non-mask
SGPR takes each lane's bit. A real mask is unchanged (0 / ~0 per lane).
tests/semantic/test_mask_src_sgpr_const.py covers saveexec, SOP2 on EXEC
(inline and SGPR), exec_lo from an SGPR, v_cndmask, a wave64 pair and
masks from compares. cf_diff (self-test, 800 runs) and salu_diff (500)
pass. docs/design.md row updated.
CopyRaytracingAccelerationStructure and EmitRaytracingAccelerationStructure-
PostbuildInfo were not implemented, and the postbuild descs of
BuildRaytracingAccelerationStructure were ignored.
- CLONE and COMPACT copy the structure's bytes (MODE_COPY_AS). XDXR records
are position-independent: node pointers count from the structure's start
and a TLAS names its BLASes by address. The size comes from the source
header, so a copy can follow a build in the same list; the destination
resource bounds it.
- COMPACTED_SIZE and CURRENT_SIZE (MODE_POSTBUILD) are totalSizeIn64BNodes *
64: a build is already exactly its layout's size. Written for
EmitRaytracingAccelerationStructurePostbuildInfo and for each postbuild
desc of a build, after it.
- New IR commands CopyAccelerationStructure and AccelerationStructurePostbuild.
Serialization, deserialization and tools visualization are refused at
replay. With LEONIDA_RT_AS=khr the postbuild descs stay ignored, as before.
- vk_xdxr_build_test: a clone of blas_random, its COMPACTED_SIZE (== layout
size), a compaction into exactly that size with a guard word after it, and
a clone of the refitted TLAS.
- d3d12_xdxr_rt_test: EmitRaytracingAccelerationStructurePostbuildInfo for
both structures and a TLAS rebuild with a CURRENT_SIZE desc (all equal to
the prebuild sizes), then COMPACT into a buffer of that size, checked as
d3d12_blas_compacted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds docs/i18n/ru/quickstart.md, translated from the current English sources
(README.md, CONTRIBUTING.md, docs/testing.md) and synced to a0acd33. It covers
what the project is, the own-copy and no-game-data rules, prerequisites, both
build paths, the stage order and the flags around it, the Linux path, common
troubleshooting, and where to claim work and post GPU results.
The row goes into the docs/i18n/README.md table with the maintainer, and the
language is listed in docs/README.md. No build or CI changes; the daily-moving
status table and the format notes stay out, as docs/i18n/README.md asks.
- "f16 inline constants": the translator matches the hardware on the
float constants and on the integer constants as f16 halves, not on
`1`/`64` as f32 operands (f32 denormals gfx1036 flushes and the
translator keeps; difference 4 in docs/shader_validation.md).
- "Known approximations": nearest-mode v_fma_mix{lo,hi}_f16 rounding is
no longer unmeasured: gfx1036 rounds once on all seven probe ties,
the translator still rounds twice (one f16 ulp off on those ties).
Docs only; no game files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/README.md listed models.md, audio.md and rsc8_audio.md twice with
different text; keep the current row of each. docs/testing.md had the
RTSS/OBS overlay advice in four rows that partly contradicted each other;
keep the implicit-layer row and the newest overlay row (the elevated-terminal
cause), with OBS's layer named. The row test now covers both pages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mission table id is not joined by name hash. The Pipework text names Mandy and Bert; the common schedule and SixNG name dictionary resolve them to link hashes, and five of 2,309 story000_script PSINs carry those hashes in 28 pool elements. Records the method, the three per-state archetypes for each character, and what the binding does not prove.
PROC-96: the Known approximations row still listed mix ops with the packs that
round to nearest because the mode says so. SHADER-135 (#1722) measured
v_fma_mixlo/mixhi_f16 on gfx1036: they round the exact x*y+z once in every mode,
7 of 7 discriminating tie inputs. The toward-zero path already does that; the
nearest-even path narrows an f32 Fma, which is 1 f16 ulp off on ties until
#1774 (SHADER-296) lands, so the row now says which of the two is the
approximation instead of implying both are correct by construction.
The f16 inline constants row needed no change: #1722 already replaced its
"Not measured" note with the measured per-operand rule.
Hardware measurement on RDNA2 (gfx1036, finding 7079901079) confirms that
v_fma_mixlo_f16 / v_fma_mixhi_f16 round the exact fma once, straight to
f16, across all rounding modes (7 of 7 discriminating cases in
tools/fma_mix_probe.py match single rounding). The translator previously
double-rounded in nearest-even mode (f32 Fma then f16 narrow).
Change v_fma_mixlo_f16 / v_fma_mixhi_f16 to use Gen.fma_mix_odd across all
modes, which rounds to odd at f32 so that narrowing to f16 gives the
exact single-rounded result in both nearest-even and toward-zero modes.
Update tests/test_fma_mix_probe.py and docs/shader_validation.md to reflect
the RDNA2 hardware measurement, and add discriminating semantic tests in
tests/semantic/test_valu_fma_mix.py.
AI-assisted.
Merges that kept both sides of an edited row left twenty topics in design.md's
tables two to six times, each copy with facts the others lacked. Merge each
topic into one row that keeps every fact, and drop only sentences a newer copy
replaced (e.g. "Not GPU-verified" where the row is now hardware-verified).
tests/test_docs_design_rows.py fails on a repeated first cell in one table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--isolate (POSIX only; an error on Windows) runs the check in child processes
over --isolate-batch modules at a time. A child killed by a signal has its
batch bisected to the module, which is reported as MODULE CRASH, counted as a
failed pipeline and makes the exit status 1; the rest is checked as usual.
Children share cache.bin one after another (atomic saves). The test hook
VK_PIPELINE_CHECK_SIMULATE_CRASH=<name substring>[:SIGNAL] raises a signal
before a matching pipeline is created, so tests/test_vk_pipeline_check_isolate.py
checks this with five hand-assembled compute shaders and no crashing driver.
Normal (non-isolated) output is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rounding the view's minLod to the nearest level fixed point-filtered
samples on drivers that use minLodInteger, but integer texel fetches
and gathers use floor(minLod) on every driver, as D3D11.3 5.8 also
requires for ld and gather4. With a 0.75 clamp the rounded view gave
1.0, so a Load of mip 0 would read zero. No single view value is right
for both, so the sampling fix belongs in the translator (a MinLod image
operand on sample ops only). This keeps the bindless capacity fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateHeap checked only for a null description and a zero size. A shared
heap_desc_refusal now also refuses an alignment other than 0, 64 KiB and
4 MiB, a heap with all three DENY_* flags, and the heap properties that
heap_properties_refusal already refuses for committed resources (a type
outside the enum such as 0, a custom heap without a CPU page property or
memory pool, a non-custom heap with either). CreateHeap1, a stub until
now, wraps CreateHeap and refuses a protected session.
Tests: direct E_INVALIDARG/S_OK checks on the standalone device for both
methods, and host comparison cases in compare_invalid_arguments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use a write-free single-output probe with the same rectangle and depth/stencil tests before the original MRT draw. Keep exact query and pixel comparisons and add first-pass isolation alongside the full test. AI-assisted with Codex.