Eight compute programs the translator gives an approximate form on 32-lane
hosts (each half-wave its own results) go in LEONIDA_PAIRED_FOR beside the
launcher's three: the four opaque temporal resolves, CS_GenerateShadowMasks
and its hair variant, and the two light-cluster passes. On two recorded
tours of one build from one save, approximate against paired, the player's
cap came out black as if in shadow in sunlight with the approximate forms
and lit with the paired ones; indoors both were alike. Only the named
programs are translated again.
AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Xbox console list slot 129 (DispatchMesh -> PC slot 79) was silently dropped as unforwarded, skipping all direct mesh-shader 3D-to-UV ped/decoration texture bakes and leaving 9/10 BC3_UNORM_SRGB (and BC7/BC1) composited textures 100% all-zero on the GPU.
Forward list slot 129 -> PC 79 (DispatchMesh) with bundle deferral and z==0 draw guard, forward live query slots 28..30 -> PC 52..54 (BeginQuery/EndQuery/ResolveQueryData, updating kConsoleBeginQuery/kConsoleEndQuery), implement CopyMemoryToMemoryX (slot 62, older layout slot 60) via VA-based CopyMemory replay with split-chunk and overlap-staged copies, and add replay + mock unit tests.
Xbox Series shaders (10,584 shaders / 39.9% of the corpus) index directly-indexed sampler heaps at 16-byte stride (4-dword hardware S#). Previously the runtime hardcoded 32-byte stride for SAMPLER heaps, so every odd sampler slot (0x430, 0x4b0, etc.) read zeroed upper bytes and fell back to fallback_sampler_ (NEAREST + CLAMP_TO_EDGE -> 1D clamped road stripes and nearest-neighbor textures), while even slots read wrong sampler N/2.
Introduce sampler_descriptor_size = 16 and descriptor_increment(type) across GetDescriptorHandleIncrementSize, CreateSampler/CreateSampler2, DescriptorHeap, CopyDescriptors*, scan_title_table, materialize_table, console_heap_range_plausible, local_write_through/copy_title_slots/pull_title_descriptors/local_mirror_table, proxy_create_sampler_x, and d3d12_com.cpp; add packed 16-byte even/odd sampler regression tests.
Ped head compositing writes BC3/BC7 blocks into placed slot-133 TitleTextures via CopyTextureRegionX (slot 85) and CopyResourceX (slot 86). Previously slot 86 was dropped as unforwarded, and placed BC textures (which cannot carry RT/DS/UAV flags) stayed gpu_written=false, causing place_title_view() and refresh_title_textures() to overwrite GPU-composited ped skin with zeroed CPU pages (intermittent pitch-black heads).
Forward list slot 86 (CopyResourceX) to PC slot 17 (CopyResource); synchronously promote placed texture destinations of CopyTextureRegion/CopyResource/ResolveSubresource to gpu_written=true on ExecuteCommandLists (preserving unmodified mips on partial copies and avoiding fill_unlocked TOCTOU); add UNORM/sRGB mutability on placed textures for cross-alias format_family matching; fix evict_and_replace() gpu_placements cleanup; and add unit + Wine regression tests.
GFX10.3 V# buffer descriptors require w[3][31:30] == 0 (SQ_RSRC_BUF.TYPE == 0); descriptors with w[3][31:30] != 0 are image T#s or non-buffer resources. Previously Gen.scalar_load and Gen.buffer_address ignored w[3][31:30], so an async-compute s_buffer_load reading a console-heap slot overwritten with a T# computed a huge limit and dereferenced an unmapped VA (SQC data GPUVM fault at t ~184-203 s).
Gate Gen.scalar_load (sbuf == True) and Gen.buffer_address on uint32(w[3]) < 0x40000000 (skipping the runtime check when w[3] is a known literal < 0x40000000 and forcing OOB when >= 0x40000000), document the rule in docs/design.md, and add 7 semantic + CPU ReadLog regression tests.
Under OpMemoryModel PhysicalStorageBuffer64 GLSL450 (and for plain Aligned PSB loads/stores even under VulkanMemoryModel), OpControlBarrier 0x948 does not invalidate per-CU GL0 vector caches on AMD RADV/ACO (Navi31). Multi-wave workgroups communicating through global buffers across s_barrier (or wave64-emulate ordering barriers) read stale GL0 values across CU0/CU1, corrupting facial-rig compute graph evaluation (collapsing character jaws).
Detect workgroup barriers paired with PhysicalStorageBuffer or storage-image writes+reads (236 shaders, <0.9% of corpus), promote them to VulkanMemoryModel with NonPrivatePointer/NonPrivateTexel and 0x6948 barriers, leave non-writing barrier shaders on GLSL450, document the rule in docs/design.md, and add 9 semantic regression tests.
On GPUs with native VK_FORMAT_D16_UNORM_S8_UINT (e.g. AMD RADV), Resource::enable_depth_stencil_uav created the plane-0 storage shadow as non-mutable DXGI_FORMAT_R16_UINT, causing CreateUnorderedAccessView to reject DXGI_FORMAT_R16_UNORM (format 56) views such as MaterialDepth (dsv=118) with all-zero descriptors. Use DXGI_FORMAT_R16_TYPELESS for depth16 plane-0 storage shadows across native and widened paths, allow R16_UINT and R16_UNORM views while rejecting typeless texture UAVs, and extend xbox_depth_storage_test.
- U1b: track depth_writes/stencil_writes on GraphicsPipeline so writable DSVs bound with DepthWriteMask=ZERO PSOs stay in GENERAL and decompress RADV HTILE
- T3: reject WORD4 reserved bits (0x6000C000) and fmt==0 as not_tsharp, gate 3D UAV slice check after owner lookup, and cap tsharp-refuse per reason (<8)
- Stage linking: add runtime/src/spirv_stage_link.h + unit tests and wire into create_graphics / lazy stage_words to remap PS Input Locations via FSSM + DXBC OSG1/PSG1/ISG1
- U1: preserve D3D12_DSV_FLAG_READ_ONLY_* on TargetView; remap read-only depth layouts to GENERAL when sampled_in_general; emit shader-read barrier visibility and gated VK_ATTACHMENT_STORE_OP_NONE
- U2: add VK_FORMAT_D16_UNORM_S8_UINT to gfx10::format_table so DXGI 119 SRVs succeed on AMD/RADV
- T1/T2: decode non-array GFX10 image_1d/image_2d/image_2d_msaa as layer_count=1 (ignoring linear pitch/depth in WORD4[12:0]); route image_1d_array to TEXTURE1D
- P0: keep capture_ptr_ alive across splash handoff when LEONIDA_PRESENT_DUMP is enabled
- Add capped tsharp-refuse and slot-57 fallback diagnostics + unit/VVL GPU tests
- LEONIDA_PICKED_WRITES now 1 by default (0 off): buffers shaders write
through views they pick from the heap are declared, so no refresh puts
title memory's older bytes over them (aki-gta6/aki-runtime 975f161 turned
its own on for skinned characters' torn and flashing triangles). In turns
of 4 s standing it cost nothing to see (frame median -0.02 +-0.75 ms, card
+0.06 +-0.45, submitting thread +0.08 +-0.47) and found 60 of 575 buffers
so written; a recorded tour of 598 frames had no fault. LEONIDA_AB can
turn it now.
- LEONIDA_PARTIAL_WRITTEN (on): a partly mapped texture is read again the
frame after the guards see a write to it, not up to 30 frames later (blocks
of noise on a close-up's shirt there). Moving, in turns of 4 s: frame
median -0.45 +-1.58 ms, card -0.47 +-0.44. After trustno1-coder/
VIctory-NVIDIA dbba4ad7 (101Leafy).
- LEONIDA_PAINTED_EVERY (8 frames): a texture picked by index that a look
found changed with nothing told of it is looked at on that beat for good,
and at its memory under any slot. After trustno1-coder/VIctory-NVIDIA
cbf5d68d and 76db3ec3 (Chris James).
- Whether a copy is asked about ahead is noted when its list closes
(Fronts::watched) instead of asked of every copy at every submission.
After ReZOnGithub/VIctory-lap 2a31a14.
AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64: unit tests
(partial_due, front_tests) and the A/Bs above.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The BC7 dictionary's entries are read with all 32 index slots in order: in
every entry but the first, the word after the index widths (the widths again)
is pixel 0's index. The decoder skipped that word, so every stored index sat
one pixel early, and a block predicted from a wrong entry was wrong, as was
every block predicted from it in turn.
Each reading passed its own unit test, so it was settled against Microsoft's
decoder (the GDK's BCPack.dll, used on this PC only, never in the repository):
the title's own streams, saved as DirectStorage hands them over with the new
LEONIDA_BCPACK_DUMP=<folder> (local only), were unpacked by the DLL and by
this decoder. Of 381 BC7 streams (2,866,176 blocks), 2,101,646 blocks were
unlike the DLL's before and none now. BC1 (400 streams), BC3, BC5 (120) and
BC6 were alike already. (Blocks packed by the DLL's own compressor never use
the dictionary, which only blocks before a stream's 255th can reach.)
After trustno1-coder/VIctory-NVIDIA f9de61c5 (GPL-3.0).
AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64: leonida-formats
unit tests, and the comparison above.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From ReZOnGithub/VIctory-lap (GPL-3.0-or-later), each with its switch, on as
there, and its check mode where it has one:
- LEONIDA_LIST_FRONTS (0ced255): what a list's steps refresh is found once,
when the list closes, instead of twice per submission on the submitting
thread. Standing: that thread worked -0.81 +-0.27 ms a frame.
- LEONIDA_FRONTS_LEAN (91ca3fd, with 9ea4cac's single-list join): the fronts
joined without a table of their copies, let go on the reaper. -0.68 +-0.27.
join_keys now folds a refresh of no bytes as front_spans does; the test
covers such refreshes.
- LEONIDA_SEND_TAKE_BESIDE (003e55a): a submission's own bytes copied on the
kept threads while its list is recorded, waited for before it closes.
-0.54 +-0.33. (shadow::wide split into wide_queue and wide_help.)
- LEONIDA_HURRY (ac97e48): what the submitting thread stands at is translated
first, above normal. It never fired here; on for scenes where it does.
Check modes, moving: 78,426 fronts and 21,883 takes (49.6 GB) compared, 0
that differed.
LEONIDA_SCRATCH_CARD: lists' scratch memory (tables' constant buffers made
afresh, root constant buffers, the batch pass's job table) in the card's own
memory the CPU maps (GPU upload heap) instead of upload memory in the PC's,
whose every first read crossed the bus. Card busy -1.70 +-0.41 ms a frame
moving, -0.92 +-0.44 standing (frame mean -1.47 +-0.65). On where the card's
budget is 9 GiB or more.
A/B phase lines now give the card's busy time and the submitting thread's
work a frame; LEONIDA_PICKED_WRITES can be turned by LEONIDA_AB.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5
7600X: named unit tests, both check modes in play, A/Bs moving and standing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_text_encoding.py flagged tools/chain_check.py:230, 425 and 624
(DadaCap asked for this fix on #2231). The calls go to the file's own
helper, which opens with encoding="utf-8-sig", but the test takes any
call named read_text for pathlib's unpinned method. The helper is now
read_utf8; nothing else changes.
Tested: test_text_encoding.py names no chain_check line any more (its one
remaining failure, scripts/windows-boot/test_crash_monitor.py:37 and :90,
is red on main too); test_chain_check.py 24 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDMsHtPdJ5kt8t7A5i2fzu
lixonik (review, resource.rs:1903): targets that settle under the cap and
then grow straight to it flip the flag and write "taken back ... 0 MB
kept", which a reader takes for textures losing room. The turn is now a
pure function, targets_turn: given up when nothing is kept below the cap,
taken back only with kept > 0, no line otherwise. The reserve itself is
unchanged.
Tested: the new asserts in room_for_targets_is_given_up_once_they_settle
(lixonik's fixture: 2432 MiB settled, then 3072 MiB) compiled and run on
their own with rustc; the crate's lib tests build on Windows only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDMsHtPdJ5kt8t7A5i2fzu
The bake's synchronous upload was the one submission waited for in play: 0.2 a
frame, 20 to 60 ms each on a list thread. With LEONIDA_BAKE_AHEAD=1 the uploads
go as a flight of their own, a thread of ours shows the slots once the card has
run them, and the list with the bake's draw waits at a fence in the card's
queue (Host::execute_gated, HostList::wait_gate) that opens then. No submission
made the card wait at it on a tour, the tour's 546 frames had no fault, and two
moving A/Bs (33 pairs each) showed the frame the same, so it stays off.
A GPU test checks the order (and fails with TEST_NO_GATE=1).
Lists run synchronously are counted by caller (diagnostics). The frame
generation cap stays at 28: six starts gave rendered frames of 72 to 76 ms
whatever the cap, with the most even pacing at 28.
AI-assisted (Claude). Tested on an RTX 4060 Ti, driver 616.64.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/spirv_opt.py: both pinned_ids (main) and the SROA parameters (PR); main's id_type Result Type check kept after the PR's const_type check on null-zero loads; main's OpUndef/OpSpecConstant* const_type kept. tests/test_spirv_opt.py: both sets of new tests.
Co-authored-by: JARVIX <273200855+jarvixaiassistant-glitch@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/run_semantic_tests.py: main's runner (process tracking, exit-code descriptions, result validation, serial CHILD_PROGRAM) kept; the PR's run_worker/PackageLoader run as WORKER_PROGRAM, its result file also carries exitCode, read_result returns includeChildren, and children are submitted after their package initializer.
Co-authored-by: Abdullahi A Ahmad <104858675+abdoulaahmad@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/bvh_tri_probe.py: PR's --kernel expansion, validate_json_path, family check and r.get('lane') kept with main's --write-kernels check, skipped-row count and skip note; write_report now writes through main's _write_text_atomic; the skipped count reads r.get("status") like the PR's r.get("lane").
Co-authored-by: abnalstlll-byte <284980532+abnalstlll-byte@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>