D3D12's baseline is 5.1, and both WARP and the RTX 5070 runtime answer a 5.1 request with S_OK and 5.1; the layer
refused everything below 6.0, so a caller asking for the minimum got E_INVALIDARG. The host comparison now covers
5.1, the test pins it, and the docs record both measurements.
OpFDiv is allowed 2.5 ULP, and on an RX 6700 (AMD Windows 26.11.2) and an
RTX 5090 it returns the reciprocal-multiply bits, so #599's decode was only
correctly rounded in the CPU model (8_UNORM 130/256 exact on the RX 6700).
x/(2^n-1) in binary is x's n bits repeated, so a 64-bit multiply by the repeat
pattern, FindUMsb and the round bit give the correctly rounded f32 with integer
ops only; the tail never ends, so there are no ties. SNORM uses the same on the
magnitude with n-1 bits; the most negative code is -1.0.
Formats 2 (8_SNORM), 8 (16_SNORM) and 15 (8_8_SNORM) were missing from
FORMATS and decoded to 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LSCH holds 32-byte struct headers followed by 16-byte members; LENM
holds 24-byte enum headers followed by 16-byte values. Neither stores
the header count; it is the one count that fills the payload. Names
are case-sensitive joaat. Counts and layouts only, no game data.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 45 shared_minigame000 streams that docs/story.md listed as undecoded float
records are mesh pages: 16-byte-aligned vertex blocks (a 0x60-byte header of
tagged slot offsets, then position/colour/normal/float2 streams) and meshlet
groups (<=128 vertices and triangles per meshlet, 7-bit packed triangles,
u16 vertex references). tools/meshlet_page.py walks them with layout checks
and writes counts only; tests build every page by hand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateRenderTargetView refused D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY, so after the DSV change in
#683 a multisample array could be a depth target but not a colour target (found by @Derpbeat on
#683). The view is {resource, mip 0, FirstArraySlice, ArraySize}, as for the DSV; the replay
already checks the range and clears through a view of those layers.
d3d12_vulkan_device_test: a 4-layer 4x RGBA8 target is cleared red through a whole-array view and
green through a view of slices 1-2; every slice is resolved and read back, so slices 0 and 3 must
stay red and 1-2 green. A view of slices 3-4 is refused at execute (invalid_subresource). Without
the change the test fails at the captured-range check.
docs/d3d12_vulkan.md: the RTV/DSV bullet lists TEXTURE2DMSARRAY for both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted. Set 0 binding 2 is the table every T#/S# lookup probes.
BindlessSet allocated it HOST_VISIBLE | HOST_COHERENT and flush() memcpy'd into
the mapping, so a divergent lookup read it over PCIe: 19.5x slower for T#+S#
pairs and 46.2x for a divergent miss at 100k entries on an RTX 2060 SUPER
(vk_descriptor_bench, #639; 58-796x on the 5080).
The table now lives in DEVICE_LOCAL (HOST_VISIBLE kept as a fallback for a device
without it). flush() takes the command buffer that will use the set and uploads
only what changed: the whole table from a mapped staging buffer when the buffers
were just created (first use or growth), and the changed slots with
vkCmdUpdateBuffer otherwise, which copies the data into the command buffer while
recording so no staging bytes are read at execution. A TRANSFER_WRITE ->
SHADER_READ barrier follows, before the draws. DescriptorTable tracks the slots
that insert, replace, erase, clear and grow touched, including both slots of a
relocation, so a flush no longer rebuilds an 80 MiB table for one descriptor.
A command buffer whose vkQueueSubmit is rejected never runs the upload, so the
set keeps the obligation: VulkanQueue::execute reports the submit result through
a commit callback, and the set rebuilds the table on the next flush, which also
reports flush_needs_idle() and makes the device wait before it. The same wait now
honours the pre-existing contract for replaced/erased entries and for growth
(the device ignored flush_needs_idle() before), and frees the retired buffers
once the queue is idle instead of at teardown.
Verified on an NVIDIA RTX 2060 SUPER, Linux 620.73.04, Vulkan 1.4.357:
- ctest 10/10, including descriptor_table cases for the change list, relocation
marking and consume-once reads.
- vk_bindless_test with LEONIDA_VK_VALIDATION=1: 14 draws (probe depth, erase,
relocation, growth 64 -> 512 slots, rebind, failed-submit retry, other view,
removal) read back exact, table in device-local memory in both
descriptor-indexing configurations. With the retry disabled the test is red.
- GPU suite 64/91 with the same 27 64-wide skips as main, 0 failures; 91/91 with
LEONIDA_W64_EMULATE=1.
No game data; synthetic fixtures only.
Follow-ups to review points on three merged PRs.
#658 (@VictorJulianiR): rtti_scan.py opened the report in place, so a write
that failed after the open (full disk, locked range) left a 0-byte file and
the previous report was gone. The report is now written to a temp file next to
it and swapped in with os.replace; on failure the temp file is removed.
#627 (@Caasares): three subnormal cases pinned the translator's result as if
it were RDNA2's. v_mad_f32, v_mac_f32 and v_mad_legacy_f32 flush f32
denormals on RDNA2 (LLVM SIISelLowering.cpp, isFMADLegal). They move to
DenormalDivergenceTests, which pins the translator result and records the RDNA2
one; docs/design.md lists the flush as not modelled. No translator change.
#645 (@esteban-dcp): crosslane_fuzz.py still called permlane FI=0
unmeasured; comments now point at the measurement and at #580.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fresh scan/recover at the new pin, no cache, across every model-bearing archive. The new pin recovers 350,248 models (159,483 drawable-dictionary children) against 190,792 at c3708fb.
Per archive: levels.rpf 314,000 (130,225 children), story000 7,460 (4,156), packs 24,034 (23,720), data 2,581 (268), shared_minigame000 1,288 (317), core_restofworld 885 (797). The standalone total is 190,765, 27 below the c3708fb recovery (duplicates merged). levels.rpf is the sum of ten parallel recovery shards over 206,981 candidates; the last shard rejects 1,009 incomplete/duplicate tail pages. Triangle totals and the C# TTPF texture counts were not re-run.
Single-sampled attachments and storage images could bypass the device's format limits. Use the same query for allocation info and committed creation so unsupported requests get the same answer before Vulkan allocates an image.
parse_rts0 read 1.1/1.2 descriptor-range records with Flags and
OffsetInDescriptorsFromTableStart swapped (offset at +16, flags at +20).
The PC serializer writes D3D12_DESCRIPTOR_RANGE1 order: type, count, base
register, space, Flags, then the offset. Both values were discarded, so
nothing broke yet, but the descriptor-table layout would have read flags as
offsets.
DescriptorRange now keeps all six fields; the canonical codec stores them
(codec version 2; nothing persists version 1 blobs). The hand-built 1.1
fixture in root_signature_test had the same swap and is corrected; a 1.0
fixture is added, and root_signature_oracle_test checks every range field
against the host serializer for 1.0, 1.1 and 1.2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Byte 0x28 is a u8 default height: 23 in both MHIU payloads, the value the
empty rows hold, and the value the encoder crops each row by (0 of 6,902
span ends are 23 although 23 is 82% of cells). The decoder now reads the
default from the header, reports the three following bytes as pad_29 and
counts span ends on the default. A scan of all 12 archives finds 2 MHIU
payloads, both in common.rpf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A depth clear of any D24 texture, native D24 or stored as D32, now clears with
depth24_to_float(depth24_quantize(v)), an exact 24-bit value, so no driver's
tie rounding is left and NVIDIA's native D24 matches WARP and AMD.
- d3d12_depth24_compare.h checks the layer's clears against the reference
(depth24_quantize, stencil value) and fails on a difference; the host is
compared byte for byte only when it agrees with the reference, otherwise
the difference is logged as a host quirk (NVIDIA's D3D12 rounds some ties
the other way: 478 of 5215 values).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recovered from the package DLL's own reads (field accesses, element strides,
the standard-build and prebuild wrappers that construct a BATCHED_DESC2):
BATCHED_DESC2 is the public build desc, the postbuild count and pointer and
a 16-byte XDXR_STREAM_DESC (0x50 bytes); the stream desc is a size and a
pointer to 16-byte typed records, whose offsets, value types, defaults and
lookup rule are measured. The DLL rejects the offline-statistics postbuild
type for every build, so that layout is not in the package.
docs/xdxr.md has the evidence per field (RVAs only, nothing quoted from the
DLL). runtime/src/xdxr_descs.h defines the structs with static_asserts and
the DLL's stream lookup and flag defaults; xdxr_descs_test checks them and,
with a DXR d3d12.h, the public part against the SDK.
docs/testing.md asks for LLVM 21+, but says a distribution's llvm-mc is
enough on Linux, and the fuzzer does not say what it needs. Measured with
Ubuntu 24.04's llvm-18 (18.1.3): valu_fuzz --family mem and lds_fuzz
assemble and run, but every --family f16 program fails, because 18
rejects op_sel on the 16-bit integer VOP3 forms; 23.1.6 assembles them.
Both places now say so.
The credited song is the Home Sweet Home mission song, not a radio track. The mission and its localized objective/fail strings are in data.rpf; the song audio is absent from every searched container.
Records the measured coverage (story000 streamed/plain/Bink, movies.rpf Bink, audio.rpf short and all banks, loop banks, packs/data/script/common inflated, raw levels.rpf ADAT/KB2), the 19,807-file / 653-hour Chromaprint sweep with its tempo range, the positive controls, the 12 joaat(burn) data hashes that are not audio, and the remaining levels.rpf/RSC8 uncertainty. No game audio or localized strings are included.
The Vulkan path can sample a top-level mip with partial edge blocks, but callers querying OPTIONS8 receive E_INVALIDARG. Report the logical device's enabled BC feature so callers can select the matching upload path.
- A dispatch honours conditional rendering and the layer's copies do not, so a
SetPredication that skips copies also skipped the D24 conversion while the
copy ran. Conditional rendering is ended around the dispatch and begun
again; a test runs an upload and readback under a skipping predicate and
compares with the host's unpredicated run (it fails without the fix).
- A copy larger than maxStorageBufferRange (queried; 128 MiB assumed if not)
is split into dispatches by slices, or by rows of one slice; the descriptors
bind 256-byte-aligned windows of both buffers. depth24_convert_test splits
the 4096x4096 copy with a 1 MiB range and a pitched one with a 1 KiB range.
- make_pipeline destroys the layouts it made when a later step fails.
- depth24_convert_test is in the CI tool list; the docs say which GPU each test
exercises.
- R24G8_TYPELESS with a typed D24 DSV is compared with the host. SRVs of
R24_UNORM_X8_TYPELESS and X24_TYPELESS_G8_UINT are an empty slot in the
layer (no format mapping; stencil-plane views refused): reported by the
test and documented as a known gap.
- depth24.h: the D3D11.3 spec's FLOAT -> UNORM wording (3.2.3.6, 3.2.2) next to
what WARP and AMD were measured to do; "159" is 5215.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game sets MODE.FP_ROUND[3:2] (f16/f64 rounding) inside its shaders: 9,417 writes in 6,333 of 26,503
shaders, 6,694 toward zero (3) and 2,723 back to nearest even (0); no other MODE field, no s_denorm_mode or
s_round_mode. The translator ignored it.
- The field is kept in a per-invocation Function variable (%mode_r16) when the program writes it.
- Every VALU f16 result (f16_out, v_pk_*_f16 via f16_pack2, v_cvt_f16_f32, v_sin/cos_f16, v_interp_p2_f16,
v_fma_mix{lo,hi}_f16) goes through f16_res: main's integer f16_bits, or f16_bits(rtz=True) while the mode
is toward zero. Integer ops only either way (SHADER-56).
- f16 add/sub and v_pk_add_f16 step the f32 sum one ulp toward zero when its exact TwoSum error shows it
rounded away from zero (2 - 2^-24 is an f32 tie that rounds to 2.0; toward zero it is 0x3FFF). f16 FMAs
need nothing extra: fma_f16_odd's round-to-odd f32 value (SHADER-55) narrows exactly in either direction.
- v_add_f64 steps one ulp toward zero the same way (finite overflow -> +-DBL_MAX), on the raw sum, before
clamp/omod.
- Other MODE writes (other bits, partial field, +inf/-inf, register values), s_denorm_mode and s_round_mode
raise Unsupported; none occur in the corpus.
- Shaders that never write MODE emit the same code.
tests/test_mode_round.py; tests/spirv_interp.py gains binary64 arithmetic, double <-> v2uint bitcasts and
vector Fma/FMin/FMax/FClamp. docs/design.md: Known approximations and the f16 rounding row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CheckFeatureSupport fell through to E_INVALIDARG for
D3D12_FEATURE_SHADER_MODEL and D3D12_FEATURE_ROOT_SIGNATURE, so a game
asking either got an error where the PC runtime answers. Report DXIL 1.0
and root signature 1.1, the versions this layer can honour rather than
the driver's maximum, clamp higher requests down, and refuse an undefined
value, a wrong DataSize and a null buffer, as the host runtime does.