Update built-in BC1/BC4/BC5 history counts against tools/bcpack_tables.py, reconcile the
descriptor mode tiling note with tools/tex_headers.py, and document bcpack_tool.py
--codec, --history, and --provisional flags.
AI-assisted: Antigravity gemini-4-neon.
Sync the fatal-checked import inventory with main (d1dff7949): VirtualFree is shimmed
by TitleVirtualFree in runtime/shims/xmem.cpp and ReadFile by read_file in
runtime/shims/file_system.cpp.
AI-assisted: Antigravity gemini-4-neon.
Route v_cvt_f32_f16 through f16_in_bits so SDWA/DPP half selection, subnormals, neg/abs,
and IEEE=0 NaN sign/payload bits are preserved without raw UnpackHalf2x16 flush risk,
and clamp v_cvt_f16_f32 and v_div_fixup_f16 directly on rounded f16 bits via shared
clamp_f16_bits. Verified on RTX 3060 (driver 617.14, native + --wave64-emulate: fixed
first word 0x7FFFFFFF -> 0xFFC4A000 on cs_w32_cvt_f16_mods), 13/13 new semantic tests,
501-module semantic suite (6,385 passed, 0 failed), and 100/100 real corpus shaders
passing spirv-val.
AI-assisted: Codex gpt-6.2-sol + Antigravity gemini-4-neon.
Profile M is no longer a guess (one 8 GB laptop card reported on the pull
request), M says laptop or desktop, a hybrid laptop is not profile F.
RUN gains INSTRUMENTS; TEST-WANTED gains to:, EXPIRES, TAKEN/DONE answers
and, with no pull request, becomes its own issue instead of a comment in
the coordination issue.
AI-assisted.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
With LEONIDA_DEVICE_MARKERS=1 every draw the replay records takes a seq from the dispatch numbering and writes the
VK_AMD_buffer_marker pair: started before its helper passes and rendering scope, finished after the scope ends (the
legacy indirect path inside the caller's scope, which the extension allows). The marker history (now 65,536 items)
keeps each draw's kind and counts, pipeline names, execute, list, command and its place among the draws to the same
targets. The loss and stall reports name the last finished item, the likely hang, the rest in flight and an idle
queue's next one not started, for draws and dispatches alike; a device-fault address is followed by the last draw
each queue started. Tests: the CPU marker test records draws and dispatches and checks the lines; the GPU marker
test writes draw markers outside and inside a dynamic-rendering scope.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run fit_distant_mips ahead of fit_decoded_neighbors so mixed-codec BC6H and BC7 streams fit directly against lossless raw/zlib mips across multi-level distances before iterative BCPack sibling decoding, eliminating all 10 remaining BC6H stream refusals on 1.0.2.1 (210 -> 226/256 endpoints, 249 -> 251/256 indices) and cutting fit_decoded_neighbors runtime by 46%.
One page, docs/agent_collaboration.md, linked from AGENTS.md and the docs
index: GitHub as the shared memory of the agents, five machine profiles and
the work each is best placed for, three blocks with fixed fields (AGENT-MSG,
RUN, TEST-WANTED), evidence tags and what an unattended agent may do.
Adds to CONTRIBUTING.md and AGENTS.md; no existing rule changes.
AI-assisted.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add an opening scope note separating the shaders.rpf PS\0\x09 package blob from
host-side Vulkan VkPipelineCache files and the compute pipeline journal.
AI-assisted: Antigravity gemini-4-neon.
Two findings from one world run (every slot records line: 0 refills; fixing slots 18.2 ms a submission).
T#s: the title rebuilds T#s of the layer's textures from 32 bits. The run's unbound T#s name 0x7f0000021400 for the
layer's 0x100021400 and 0x2ef600 for 0x1002ef600 (bits 32-39 clear, 0x7f or 0 in bits 40-47): "its low 32 bits name
a texture of ours that is gone" (291-3,794 a window) and "no title memory and no texture of ours" (270-4,585, low bits
past the last address handed out: textures still to come). They were recorded under that address, while a texture's
arrival is announced at the layer's address, so no arrival ever reached them, and bind_title_image looked them up by
the exact address only. tsharp_texture_key maps such an address outside the title's memory to the layer's texture
address with the same low 32 bits (while fewer than 2^24 were handed out); the T# waits under it, and
bind_title_image takes the texture there when its shape fits (another shape stays unbound, as before).
V#s: about 2,100 rewritten V# halves a submission, 70% resolving to nothing at about 9 us each (the alias table,
the backings, the geometry copies and the title memory walked again, VirtualQuery included), 63% with words seen
before. A waiting record is fixed again by every change that could let it resolve, so while one waits its answer
stands: a rewritten half whose exact range another half of the heap waits for takes that answer
(ConsoleHeapSlotRecords::waiting_answer, one hash lookup; a half that asks for a geometry copy only from one that did,
and not after geometry room was freed since the refresh). To keep answers current, the submission's changes are
applied before the rewritten slots, and the changes noted during the pass (a window a fix made, a buffer another
thread released) are applied to the heap before an answer is taken (sync_slot_changes). The records keep a third
list per range for waiting halves that asked for a geometry copy. The slot records line counts the answered halves.
Tests: d3d12_tsharp_refill_test also writes the texture's T# in the title's two 32-bit forms before the texture exists
and expects both bound at the first submission after it appears, and gone with it. d3d12_unbound_tsharp_rules_test:
the 0x7f form with the texture's shape binds (it expected "no texture"). console_heap_slot_records_test: in the 400
random rounds half the writes take a waiting answer after applying the changes noted so far, and each answer must be
what resolving at that moment gives (a copy that skips applying them fails); the rounds still equal a full
re-resolution. Linux ctest 115/115.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On NVIDIA 621.40 every probe beside a compute create came back in 0-12 ms,
but a run whose gate those probes had turned off lost the device 9 s later
with a submission held 7.8 s beside a mesh pipeline create, and with the
gate off a vkQueueSubmit sat 54 s in the driver beside a 56 s mesh create
before the device was lost. Graphics creates never passed the gate.
- Graphics creates (mesh included) now pass the gate (PipelineState::build
through DriverTurn), and CompileTurn carries the create's kind, name,
trigger and size. The adaptive gate keeps a verdict per kind; a probe
counts for each kind that had a create in the driver from before the
submission entered until it came back, a held one against all of them.
- A kind that is off is still timed: a submission that stays 2 s or more
beside one of its creates turns that kind back on for the rest of the run.
- No submission goes ahead, at the limit or the probe budget, while a create
of a kind that holds submissions is in the driver, and such creates are
waited for even if one went past them before the verdict.
- A create never waits behind the submission of the thread that holds the
submit lock.
- VulkanContext::mark_device_lost logs the creates in the driver (kind,
program, size, thread, how long, whether submissions wait for them) and
each kind's gate.
Tested: submit_mutex (new gate_per_kind case; held-verdict cases adjusted;
also under LEONIDA_COMPILE_GATE=1 and =0), MSVC, Windows 11.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One world run with the merged index showed 60,000-135,000 records looked at per submission for 1,300-2,600 slots
fixed again and 130-210 changes. Two causes in ConsoleHeapSlotRecords::touched:
- An addition (an alias range, title memory, a backing) visited every waiting record whose range overlapped it.
Waiting V#s with large spans (data words that read as V#s of up to 4 GiB into title memory) were visited by every
addition anywhere inside their span, at nearly every submission, and fixed again to no effect. A V# resolves only
through an alias range, backing, copy or title memory that holds its base (or a backing that holds its refused
target), so an addition now visits the waiting records whose range starts inside it; the groups with waiting
records are kept by start a second time for this, so only those are walked. TitleVaAliases tells title memory as
the merged range it is now part of (a V# whose base lies in the older part may fit only now), and nothing for a
commit inside a range it already has.
- A record named by several changes of one submission was looked at once per change. Each group's two lists now
carry the touched() call that last visited them, so a record is looked at once an index a call at most.
Test: 5,000 waiting halves of 4 GiB; 200 additions inside their spans that hold no base look at none (the previous
index looked at all of them 200 times and fails), one that holds 10 bases looks at those 10; 200 removals over the
same 5,000 resolved halves look at each once. The 400 random rounds against a full re-resolution still pass (slots
fixed again there 81,005 -> 75,919, looked at 133,506 -> 97,952); a copy whose removals skip waiting records fails.
Linux ctest 115/115.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/README.md: the console-heap rows come from the refill branch, the shadow rows from #1867.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The T# records, the room lists and the texture and room changes of descriptor-refill now live in the exact-range
index of slot-records-index. src/console_heap_slot_records.h: a third index, by T# address (the exact range
[address, address + 1)), of the same groups with a settled and a waiting list; a texture gone visits exactly the
T#s recorded for its address, a texture added the waiting ones. The records waiting for room (V# halves refused a
geometry copy, T#s refused for a full bindless array) are kept in a list per kind with each record's place, so a
record leaves it in O(1) and room made visits only the records waiting for it. Interface as descriptor-refill
has it (states, set_texture, base, textures, textures_waiting); device code, README rows and both sides' docs kept.
32 bytes a half.
Tests: console_heap_slot_records_test, both sides' cases (60,010-slot release; 300,000 slots in 74 blocks, a
40-byte release looks at 3; 400 random rounds against a full re-resolution; a texture registered looks at the 10 of
60,015 waiting on its address; room changes touch only the records waiting for room); a copy that skips settled
lists on a removal fails. Linux ctest 115/115.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A list value wait (wait32/wait64) that is not met at submission holds its queue until memory meets it. The fixed
200 ms timeout, LEONIDA_VALUE_WAIT_TIMEOUT_MS and the 4 ms demotions are removed (in Linux world runs 14-63 gates a
run timed out with the writer's value not there yet).
A held gate goes without its value only when nothing else can make progress (releaser idle, no title
ExecuteCommandLists in progress, nothing of the pump's running on the GPU; work the layer holds behind a wait is not
running, asked through the new rt::d3d12::fence_signal_submitted), and then only: in a cycle (at once), at a present
queued behind it (VIctory-Belobug-AMD's rule, queue/behind.rs step, queue.rs release_held), or when the title has made
no queue call for 2 s; every gate goes at device loss. src/list_value_progress.h (portable) replaces
list_value_wait_budget.h. Each release is logged with gate, queue, wait and reason; released waits met later are
counted. stop() drops gates it leaves shut so they no longer hold their queues.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A title-written T# that found no texture went on a retry list that every submission tried again, round robin, for
500 us (LEONIDA_CONSOLE_RETRY_US). World runs had up to ~35,000 waiting, 200-550 retried per submission, and every
retry counted again as a T# "naming no texture" (1.56 million in 27 log windows of one run). A bound T# whose texture
went never came back unless the title rewrote its slot.
The per-slot records of RT-VSHARP-SLOT-RECORDS now hold T#s too (src/console_heap_slot_records.h): the exact base
address and bound / waiting / waiting for room, with an index by that address. Texture changes go on the same change
list: note_image_address, a GPU placement added and a streamed texture published (texture_added), forget_image and a
placement removed (texture_gone), freed bindless entries (texture_room), each also at the other view of pool memory.
The next submission fixes exactly the T#s naming the address. A V# refused a geometry copy for lack of room is fixed
again when geometry copies are freed (geometry_room, GeometryViews::free_generation), closing the gap A1 left.
"No texture at the T# address" is counted in "unbound T#s by reason" by what the address is: title memory, a texture
of ours that is gone, low 32 bits naming one of ours (same shape / other shape / gone), or none. The slot records
line gives T#s recorded, waiting, fixes left waiting and refills.
Removed: retry_console_slots. LEONIDA_CONSOLE_RETRY_US applies only to the opt-in GPU heap pass now; slots deferred
by LEONIDA_CONSOLE_FIX_US are fixed first at the next submission (fix_deferred_slots).
Tests: console_heap_slot_records_test (T# and room cases), new d3d12_tsharp_refill_test (the last of 60,001 waiting
T#s samples its texture at the first submission after it appears; its T# leaves the hash table when it goes),
d3d12_unbound_tsharp_rules_test (address classes). Linux ctest 115/115 (llvmpipe); Wine suite (clang-cl, iGPU RADV)
425 pass / 24 fail, against test/three-fixes 425/23: d3d12_tsharp_refill new and passing, xmem (known flake) the
only pass->fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The adaptive gate never probed in two runs because no single wait reached
the 15 s limit: on NVIDIA 621.40, 80 waits of 3-7 s back to back (90 s in
all) kept the title's main loop from reporting for 30 s and its watchdog
ended the run; on an RTX 4060 with the watchdog kept kicked the limit was
0, so nothing could probe, and 459 waits of up to 2.9 s took 155 s by
t=202 s.
Until a verdict is in, a submission now also goes ahead once the waits at
the gate in the last 10 s, its own included, add up to
LEONIDA_COMPILE_GATE_PROBE_MS (2500 ms). A budget over a window rather
than a shorter per-wait limit, because it also counts many short waits and
a single wait reaches it as soon as a 2.5 s limit would; before the
verdict the gate stops the queues for at most about a quarter of any 10 s.
On a driver that holds submissions (630.20) the first probe enters after
2.5 s instead of 15 s and loses the device if the create stays 10 s more;
the held verdict (still 2 s, inside those 10 s) ends the early probes and
leaves only the per-wait limit, so that is one probe per run.
The limit and the budget no longer depend on the title's watchdog. Only
LEONIDA_COMPILE_GATE_WAIT_MS=0 (the budget then defaults to 0) or
LEONIDA_COMPILE_GATE=1 (no limit by default, never probes) waits however
long the creates take.
Tested: submit_mutex (new gate_probe_budget case; also under
LEONIDA_COMPILE_GATE=1 and =0, with the watchdog variables set, and with
LEONIDA_COMPILE_GATE_WAIT_MS=0), MSVC, Windows 11.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The records' two indexes kept each V# half in a bucket per power-of-two span class and 64 KiB-or-larger block,
and a change visited every entry of every bucket it reached, plus resolved halves for an addition that only
re-fixes waiting ones: 82,000-472,000 slots looked at per submission for 2-15 changes and 1,450-3,150 slots
fixed in the busiest world windows of one run, 4.4-13.4 ms a submission.
Now each index holds the halves by their exact range: halves naming the same range share a group with a resolved
and a waiting list, each half keeping its place in its list (a move or a removal is O(1), no stale entries, an
empty group goes). Groups are ordered by start per power-of-two class of their length; a query searches each
class in use once and walks the groups starting less than one class length before the change. A change looks at
exactly the halves whose range overlaps it (an addition: the waiting ones only); the groups compared besides are
those that start within one class length before it and end before it, one comparison each and no slot. 20 bytes
a half (was 24), plus a group per distinct range. Interface and device code unchanged.
Test: 300,000 slots of 16 bytes packed into 74 blocks of 64 KiB; a 40-byte release looks at the 3 it overlaps
(the bucketed index looked at the whole block and fails), by source it also finds a 1 MiB range starting two
blocks earlier, a moved slot leaves nothing behind, and an addition over all of them looks at the 1,000 waiting.
The 400 random rounds against a full re-resolution still pass (entries looked at 792,825 -> 133,506 for the same
81,005 slots fixed); copies that skip large ranges or the waiting lists on a removal fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the bounded wait, the three submissions that went ahead on NVIDIA
621.40 came back from the driver in 11, 1 and 0 ms with the create still
there, but consecutive long creates made submissions wait the full 15 s
again and the title's watchdog still ended the run.
Every submission that enters the driver next to a create the gate went
past at the limit is now a probe. Two that come back in under 250 ms, at
least 1 s apart, with that create still in the driver turn the gate off for
the rest of the run; one that stays 2 s or more keeps it on. Both verdicts
are logged once. Two probes a second apart, because on 630.20 back-to-back
creates take and release the driver's lock and one submission could slip
in between; the second costs no extra wait. LEONIDA_COMPILE_GATE=1 gates
always without probing (and compute builds keep holding the submit lock),
=0 has no gate. The README row now says what =1 does again.
Tested: submit_mutex (new gate_adapts case; also under
LEONIDA_COMPILE_GATE=1 and =0), MSVC, Windows 11.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gate keeps vkQueueSubmit out of the driver while a pipeline create is
in it (on NVIDIA 630.20 a submission that entered during a long compute
create waited 10 s in the driver and lost the device). The waiter holds the
submit lock, so every queue stops behind it: on an RTX 4070 Laptop (NVIDIA
621.40) one compute create stayed in the driver for over 54 s during the
story load and the title's 30 s hang watchdog ended the process.
A submission now goes ahead after LEONIDA_COMPILE_GATE_WAIT_MS (15 s by
default; 0: no limit). The creates in the driver then hold no later
submission back; creates that enter afterwards are waited for again. On
630.20 that only gives up creates over 25 s (15 s here plus the driver's
10 s), which the watchdog ends anyway. With the watchdog kept kicked
(LEONIDA_TITLE_WATCHDOG=0 and LEONIDA_TITLE_WATCHDOG_KICK) the default stays
no limit. The log names each submission that goes ahead and how long it then
spent in the driver. The README row, which still described the gate as
opt-in, now says it is on by default.
Tested: submit_mutex (new gate_wait_limit case), MSVC, Windows 11.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RADV puts sparse buffers 64 TiB above ordinary ones, so with the sparse arena of the previous commit every geometry
copy and title-window block lay below heap_base and TitleBufferWindows::allocate refused it (it accepted only a
positive offset below 2^47). Shaders translated since 2026-11-24 sign-extend a V#'s 48-bit base and say so in their
index entry (vsharp_base_sign_extended), and RADV hands out every address from one 2^47 half of the 48-bit space, so
any block is within reach of heap_base as a signed offset.
- shader_library.h: VsharpBaseCensus counts the marker over every loaded module; signed only when all have it.
- The device reads V# bases signed when the census says so (or with LEONIDA_IMPORT_BELOW_ARENA=1, as before). The
import refusal still follows that setting alone. One line logs the census.
- create_arena: the arena is sparse only with signed offsets; otherwise one allocation, and one line says why.
- TitleBufferWindows::shader_reachable replaces the positive-only check. The first failure of each Vulkan call while
making a block, and the first block refused for its address, are logged.
- rebase_title_vsharp sign-extends a base it already rewrote below heap_base.
- device_arena_memory (for tests); cs_user_data.comp reads V# bases sign-extended, as translated shaders do.
Tests: d3d12_title_va_game_device and d3d12_geometry_views_game_device (d3d12_title_va_test --game-device: the
device the game makes, with the arena's bind queue); geometry_views_test (shader_reachable at the measured RADV
addresses and the range edges); shader_library_test (the census). Wine suite on the iGPU: 429 pass / 23 fail against
425 / 23 on main 8bc59a74c, nothing pass to fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The arena was one allocation of its whole size, made at start: with LEONIDA_ARENA_MB=4095 a world run used about
0.8 GB of it (peak end about 1 GB) and held 4 GiB of Resizable BAR memory. Where the device can, the arena is now a
sparse buffer: LEONIDA_ARENA_MB bounds the address range, and memory is bound as it is used.
- src/arena_backing.h (new): the backing units. A unit is one VkDeviceMemory, mapped once, bound over whole 2 MiB
blocks. An allocation no larger than a block stays inside one block; a larger one takes whole blocks of its own
(the free-block map's keep-out, footprint and alignment). A unit is bound before the first allocation in it is
handed out, and when its last allocation is released it is pending with the release's retire ticket; it is unbound
and freed only once completed_retire_ticket() has reached that ticket. An allocation in a pending block revives it.
- The CPU reaches the arena through one accessor, DeviceState::arena_host(offset, bytes): one table read, null with a
rate-limited line for a range without memory. Callers that name an offset they do not hold (write_arena_value,
read_arena, the fsdraw probe) use ArenaBacking::with_host under its shared lock; copy_destination and
known_view_heap use offset_of. arena.mapped is gone, so every former `arena.mapped + offset` was converted.
- Binds go to a queue nothing else uses (pick_arena_bind_queue: RADV's sparse-only family, or a sparse family with
a queue to spare) and are waited for there, so a bind never sits behind a submission that waits for a fence the
CPU signals later. The device asks for that queue at creation.
- Unbinding is safe because: arena_release records submitted_retire_ticket() + 1 (as defer_destroy), so the
submission being recorded is covered too; reclaim_arena() runs at the start of ExecuteCommandLists, reads
completed_retire_ticket() before taking the arena lock, and unbinds only units whose ticket has completed; the
table entries are cleared under the exclusive lock before the memory is freed. An unbound range reads as zero
(residencyNonResidentStrict is required), never a fault.
- A D3D12 heap in the arena lends its unit's memory (at the heap's place in the unit) to reserved resources' tiles;
Heap::offset() keeps the arena VA.
- Without sparse buffers, strict residency, a sparse address space as large as the arena, or a queue to spare
(llvmpipe), one allocation backs the whole arena as before, through the same accessors. No new setting.
- The arena line at release gains `GPU address arena: bound N MiB now (peak P, U units of 2 MiB blocks, sparse)`;
the mem-probe breakdown's arena `bound` is the bound bytes.
Tests: arena_backing_test (CPU, fake driver): placement never crosses a unit, binds shared per block, unbinding
waits for the ticket, revival, a random workload whose bound bytes equal the blocks live allocations touch, bind
failure, the one-allocation arena, the bind queue choice. arena_sparse_gpu_test (a real device, 77 without sparse
binding): a 256 MiB arena with 40 MiB allocated has 44 MiB bound; CPU writes are what the GPU reads; released blocks
stay bound while a submission that reads them is in flight and are unbound (reading zero) once it completes; a bind
made while the work queue is blocked completes. Both are new (fail to build on main).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2230 bounds a dispatch record by the device's maxComputeWorkGroupCount instead of 65 535. Nothing said how wide
the title's dispatches are, nor when a device's own limit still cuts one (llvmpipe allows 65 535 in x; RADV 2^32 - 1),
which its review asked for. The title's tile passes ask for 67 440 groups in x at 2560x1440 (found in the
VIctory-Belobug-AMD fork of VIctory, crates/victory-gpu/src/indirect.rs; no code of it is used).
- indirect_clamp.comp: stats words 12-15 count dispatch records that run wider than 65 535 groups in x, the widest
x that runs, those cut at the device's limits (and still running), and all of them.
- vulkan_indirect_clamp.h: the counters, read with the others (16 words a slot, words 8-15 zeroed before the pass),
and a line every 10 s while dispatch records are clamped: `indirect clamp dispatch: N records, W wider than 65535
groups in x, widest x X, C cut at the device's limits (x x y x z)`.
- indirect_clamp_spv.h regenerated from the .comp as its header says (glslangValidator 16.6.0).
- docs/d3d12_vulkan.md section 4.7: the device's bound per dimension (it still said 65 535), the line, and the test.
Tests: indirect_clamp_test's cases 6b and 6c check the counters (70 000 x 1 x 1: wider than 65 535 where the device
runs it, cut at its limit and counted where not). tests/test_indirect_clamp_telemetry.py checks the new atomics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changed:
- victory/ is now d3d12/;
- its crates are leonida-* (leonida_* code paths);
- the program is leonida.exe;
- settings are LEONIDA_*, and the older VICTORY_* names still work through apps/leonida/src/leonida.rs;
- the config file is leonida.toml;
- log names and user-facing text say Leonida.
What did not change: lines that credit upstream projects or people, URLs, copyright notices and the
GPL-3.0 LICENSE. d3d12/README.md opens with a Leonida section that says the runtime grew from
Marvisak/VIctory through trustno1-coder/VIctory-NVIDIA. The rest of that README is labelled as
trustno1-coder's.
The launchers (scripts/play-d3d12.ps1, scripts/play-linux.sh), docs/linux.md and
scripts/sync_victory.py (prefix d3d12) follow the move. Future upstream merges will need a
mapping from upstream's names onto these.
Builds with `cargo build --profile diag -p leonida --features diagnostics`. The settings alias
tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
victory/ builds as leonida.exe ([[bin]] in apps/victory; the package keeps VIctory's name so upstream merges and cargo -p victory still work), the window caption reads Leonida, and the launchers (victory/scripts/play-nvidia.ps1 and play.ps1, scripts/play-d3d12.ps1, scripts/play-linux.sh) start leonida.exe; the Smooth Motion copy is leonida_sm.exe. VICTORY_* settings are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Linux the D3D12 runtime (victory/) runs under Wine. Its Direct3D 12 now comes in the package, so
players download nothing else for D3D12.
- scripts/fetch_vkd3d_proton.py puts VKD3D-Proton 3.1's unmodified 64-bit d3d12.dll and
d3d12core.dll in the package. It also adds the LGPL-2.1 text and notice from the v3.1 tag and a
note on where the source is. Every download is checked against a pinned SHA-256. Standard
library only; Python 3.14 for compression.zstd.
- scripts/play-linux.sh installs the bundled DLLs into Leonida's own Wine prefix (no other prefix is
touched) and sets WINEDLLOVERRIDES=d3d12,d3d12core=n. It runs the runtime with the measured
NVIDIA defaults of play-nvidia.ps1.
- docs/linux.md describes the package and what is still untested: the launcher is syntax-checked
only; it has not run on a Linux machine yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
World runs fill one bindless image array a few minutes in: `a bindless image array is full; dimension 3: 4096
indices, 4092 T#s of 4090 textures`. Dimension 3 is 1D (ImageDimension: 2D, 2D array, 3D, 1D). From then on every
new 1D T# reads the fallback's zeros, and the console heaps count it as "no view for the T#'s format or range",
which went from 2-28 a window to over 4000.
Nothing leaks: the 4096 indices are the fallback, 4092 entries of image_entries and 3 replaced views, every one
held by a texture the runtime still has registered, and a texture's indices go back when it goes (forget_image,
the deferred bindless_slot release, remove_image). The cause is the size: size_bindings grew 2D images to 65536
but 3D and 1D only to 4096 and 2D arrays to 16384, constants that guessed how many textures of each dimension a
title keeps, whatever the device holds (RADV allows 8388606 sampled images, llvmpipe 1015808).
- vulkan_bindless.h: one maximum (max_images, 65536) for the sampled array of every single-sample dimension, in
place of max_2d_images, max_2d_array_images, max_3d_images and max_1d_images. The 2D-array, 3D and 1D arrays
grow together after 2D and the storage arrays, so on a device whose limits stop growth earlier none of them is
favoured. The bound is memory (each generation's pool holds every element): 325729 descriptors on an RTX 5070,
10-20 MiB at 32-64 bytes a descriptor. The shaders declare runtime arrays, so no shader changes; the set layout
changes, so compute pipelines get new journal names (hash_bindless_layout) and the pipeline cache is rebuilt.
- BindlessSet::image_refusal says why add_image returned 0: no array for the dimension, the array is full, or only
its shorter storage range is.
- d3d12_vulkan_device.cpp: bind_image_locked and bind_image_views_locked report that reason; bind_title_image
counts it ("the bindless array of the T#'s dimension is full", or "the bindless storage arrays of the T#'s
dimension are full") instead of "no view for the T#'s format or range". The once-per-dimension line names the
dimension, the storage range and how many of the textures holding indices are still registered at their address.
- docs/d3d12_vulkan.md: the sizes, and the new reason.
Tests: bindless_sizing_test checks RADV's and llvmpipe's limits (every sampled dimension at 65536; on main 1D and 3D
stop at 4096) and that the three dimensions share a short budget alike. vk_bindless_dimensions_test (new, GLSL
shader) sizes a set from the device, gives 5000 live 1D, 2D-array and 3D images an index each and reads every one
through its index, then fills the rest of the array: the next is refused as full, and removed indices come back at
once or, after an erased key, at the next flush. On main it fails at "1D: 4096 indices in the set".
vk_bindless_test's index-space case filled 1D expecting the first index to be 1, which held only while the 1D
array was as short as its storage arrays; it now checks every index once and that indices above the storage arrays
go first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After any arena release, title-window or geometry block destroyed, or alias change, the next submission walked
every live V# slot of the console heap (about 580,000 in world runs), reading each from the copy in ReBAR VRAM:
1.1-1.5 s a walk whatever the scene, about 2.9 s of a 4.6 s frame. It existed only because nothing recorded
which slot resolved into which backing.
Each V# half of a console resource heap's copy now has a record in host RAM (src/console_heap_slot_records.h):
the title's base and span, the device address its copy names, and whether it resolved or waits. Two indexes
(by base, by target; per power-of-two span class and 64 KiB-or-larger granule) find the halves near a range.
fix_console_slot, the only writer of a slot's copy, writes them; a zeroed range, a deferred slot and a
rewritten slot drop theirs; a destroyed heap takes them with it.
Releases (backing(), title_block_gone), alias ranges removed or replaced (TitleVaAliases tells its listeners
as it happens, forget_copy included) and additions (backings, alias ranges, title memory) go on an unbounded
per-device list. refresh_console_heaps takes it whole; every heap re-fixes exactly the slots it touches: a
release or removal every half naming the range, an addition the waiting halves over it. A new heap log line
gives the changes, slots looked at, slots fixed again and ms per submission.
Removed: the live_vsharps walk and its bitset (console_heap_vsharp_slots.h and its test), the release
generation checks (released_backings, TitleVaAliases::invalidations), LEONIDA_CONSOLE_RELEASE_FILTER, the
4,096-entry DescriptorRangeChanges ring with its full-sweep overflow and changed_ranges(), the empty-slot probe
and retry_unmapped_slots (unreachable: nothing set its flag). LEONIDA_CONSOLE_GPU_FILTER now defaults to unset
instead of the removed variable's value. The T# retries (retry_console_slots) stay.
Tests: console_heap_slot_records_test (portable): releasing a buffer 10 of 60,010 slots name looks at 10
entries and fixes 10 slots; an alias moved, removed and added back; overwritten and zeroed slots; partial
overlap; two slots on one backing; a buffer back; a refused alias copy backed later; a large span; a destroyed
heap; and 400 random rounds compared with a full re-resolution of every slot. d3d12_unmapped_vsharp_test now
expects all 128 waiting slots restored at the first submission after their alias comes (was: 16 by the probe in
64 submissions), none after it goes, and the slots naming a released buffer null. title_va_alias_test and
geometry_views_test check the listener in place of the ring.
Linux ctest 113/113; Windows suite under Wine (clang-cl, iGPU, RADV) equal to main 2d43417d4 test by test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A GFX10 mesh epilogue marks a primitive null (bit 31) when an index field
is at or past the vertex count and keeps the field, so a null primitive can
carry indices up to 511. Vulkan leaves such an index undefined even on a
culled primitive. Both mesh finales (MeshEXT and --mesh-compute) now write
index k as null ? 0 : umin(field_k, vertex count - 1), as Mesa clamps them,
and a primitive count of 0 when the vertex count is 0. CullPrimitiveEXT is
unchanged.
Test: test_ms_prim_export.py gains MeshNullPrimitiveClamp with a
hand-written 128-thread wave64 fixture at vertex counts 0, 10, 100 and 128;
it fails on the old translator. docs/design.md moves the Open note into the
mesh primitive export row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gt9hwNPurxyJ9LAfUbNiYr
docs/gameinput.md conflicted on two passages, both kept:
- main's new LEONIDA_INPUT_FILE paragraph, with this branch's sentence on
make_game.py running build_runtime.ps1 with -FetchSdl3 (and --no-sdl3)
added to main's wording of the build paragraph;
- the settings table keeps this branch's LEONIDA_KEYBOARD_PAD default (1,
focused; off removes it), which gameinput.cpp reads, and takes main's longer
LEONIDA_INPUT_SCRIPT row (button@seconds:hold, the six-reads rule), saying
"on unless LEONIDA_KEYBOARD_PAD=off" for the keyboard pad.
No code conflicted. Tested: full ctest, 113 of 113, on Linux (the portable
subset; the gameinput shim is Windows-only).
Changes made by Claude Code (AI-assisted).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3