The device-removed report (removal_context) said "(nothing of ours was
running on the card)" for every phase of the submitting thread but
"waiting for the card", also when submissions sent ahead were still not
seen finished: the same line's "submissions started X finished Y" could
say otherwise, and the report read as an idle card when it may not have
been.
The phase now carries the number of submissions of ours sent and not yet
seen finished (STARTED less FINISHED), and says nothing of ours was
running only when that number is 0. Nothing else in the report changes.
Same change as TaynanGT/Vice-Tay#451 on the same code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The card 49.8 -> 51.5 ms a frame with LEONIDA_MESH_COUNTS=1, the six heaviest mesh programs the same or slower.
Left off.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main left it off for the RX 6800 it was measured on. On an RTX 4060 Ti with a Ryzen 5 7600X, standing, by turns of
4 s with the three other helper switches (runs whab1 and whab2): the frame's median -0.22 (+-0.29) and -0.73 (+-0.39)
ms, its mean -0.65 and -0.66. The wider pools did nothing and half the processors refreshing copies made the frame
slower; those stay off.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up (timbot103):
- A driver's own variable wins over XDG_CACHE_HOME, so a warm MESA_SHADER_CACHE_DIR, MESA_GLSL_CACHE_DIR or
__GL_SHADER_DISK_CACHE_PATH reached Wine under --cache fresh. A fresh run now unsets them; with a kept cache the
caller's variables stay and win. --help and docs/linux_proton.md say so.
- A run folder whose earlier launch did not start is accepted again: a fresh run now empties its session/cache, and
session.txt is written anew instead of getting a second "shader cache:" line.
- test_run_game_wine_safety's shared fixture passes --cache fresh, so an inherited XDG_CACHE_HOME stays out.
Two new tests in tests/test_run_game_wine.py fail with the old script and pass with this one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
Runs d197 and d199: 23:00 asked 60 s after the start stopped the title within two seconds (an access violation in
KERNELBASE on another thread); asked at 120 s, in the world, it did not, and the night tour's 545 frames show no
one-frame dips or spikes.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick window finds, renderer port 2 and scoped copy forgetting together save about a millisecond here (2-3.4 ms
each on the RX 6800); kept on. Wider views and records pools do nothing, half the processors refreshing copies
makes the frame slower, the list ahead split in two saves about half a millisecond.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run d195 had the native teleport move the player at once, but into the bay far from the deck: the place read from
the ped (+0x70, as Game::position reads it) is relative to an origin of the title's own, and SET_ENTITY_COORDS takes
the world's coordinates (the native database has GET_ENTITY_COORDS decode +0x70 into them).
- Game::world_position: GET_ENTITY_COORDS on PLAYER_PED_ID's reference (its flag 1), the vector's three floats.
- The title's thread reads it every 15 of its updates while the natives are found; game_actions::position() (the
menu's Teleport page and its saved spots) gives that place, never the ped's own for it.
- Request::Lift (lift <metres>): that far above the player's place in the world, through Request::Teleport.
- The info line and the teleport's line give both places.
Also seen in d195: 6,805 natives found by their handlers, PLAYER_PED_ID's reference, god mode on and off.
Tests: the game_actions tests pass (lift read in script_commands_read). Not yet seen in the running title.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The submitting thread works 68% of its samples and waits 32%, half of the waits in the list ahead of each frame
(the views' pool), while our helper pools stand idle (94.6-99.9% of their samples waiting) and the six list threads
are busy 76%, the tables and views a sixth of it. Next: main's wider pools by turns, then views kept past a
recording.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Request::Teleport ( eleport <x> <y> <z>): SET_ENTITY_COORDS on PLAYER_PED_ID's reference, the place as four
packed floats in two slots, the three axis flags off and the area cleared, the last float 0 (nine slots, as the
native database has the native take). warp(), which the menu's Teleport page and leonida.teleport call, asks
for it whenever both natives were found, in place of the experiment that writes the ped's position
(LEONIDA_GAME_ACTIONS_WARP=1, still there without the natives).
- Request::Wanted(0) also calls CLEAR_PLAYER_WANTED_LEVEL on the player's reference: run d179 had the HUD keep
two red stars after the title's own function cleared the level.
Hashes from modpapi/scripthook-vi's native database (CC BY 4.0). Tests: the game_actions tests pass (teleport
read in script_commands_read). Not yet seen in the running title.
AI-assisted (Claude).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Weather, time, wanted level, the health cheat, and the spawn of any vehicle by its model's name (the airport bus, a
model none of the nine cheats holds, came down just ahead of the player) did what was asked on the title's thread.
The HUD kept two red stars after the wanted level was cleared through the title's own function (its state read 0).
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The menu's God mode item (player.god) was dimmed for want of the title's script natives. With the natives found by
their handlers (5f8f20d77) it is available when PLAYER_PED_ID and SET_ENTITY_INVINCIBLE were both found and the
player is in the world; turning it on or off asks for Request::God on the title's thread. While it is on, the
player is made invincible again every 60 of the title's updates: a ped made anew (after a death, or a change of
character) is not. The run script's `god <0|1>` does the same.
Tests: the game_actions tests pass. Not yet seen in the running title.
AI-assisted (Claude).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The natives were never found as a table (docs/mod-menu.md, "Looking for the script natives"): the title builds
its own at run time. Every handler has one shape, though: it checks its argument count first
(`cmp dword [rcx + 10h], 0`) and on a negative one jumps (`js`) to an error block that stores its native's own
64-bit hash where the result goes (`mov rax, [r]; mov r2, imm64; mov [rax], r2`).
- leonida_loader::natives: scan() reads that hash from every such handler in the code and keeps the start of the
function it lies in (from .pdata, at most 0x20 bytes before the check); a hash at two handlers names neither.
find() does it over the mapped image. In the 1.0.2.1 executable: more than 6,000 natives, PLAYER_PED_ID's and
SET_ENTITY_INVINCIBLE's hashes among them (the handler with the latter is the one El1xr's trainer calls for it).
- Game actions: call_native() passes a handler its call context (argument slots, the results' slots, the count;
16-byte aligned slots), on the title's thread that runs its cheats. New requests: God(on), SET_ENTITY_INVINCIBLE
on PLAYER_PED_ID's reference (`god <0|1>`), and Native { hash, args } (`native <0x hash> [slots]`, for tests).
The natives are scanned at install and counted in the console.
The shape and the call context are kylepelham/El1xr's findings (third_party/victory/.../modmenu/natives.rs,
GPL-3.0); the hashes are modpapi/scripthook-vi's native database's (CC BY 4.0). Written here anew.
Tests: natives::tests (a handler's hash names it, near and far jumps; a hash at two handlers, a handler outside the
unwind table, other registers or a load through rsp or a check too deep name nothing; the unwind table read
sorted; the retail executable's natives with LEONIDA_GAME_DIR), game_actions spawn_tests
a_native_call_hands_its_handler_the_slots_and_the_count, and the new commands in script_commands_read. All pass.
Not yet seen in the running title.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X (unit tests and the
executable check only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runs d155, d174, d175, d194 (test build of fix/upscale-alias, not merged: the alias it reads through is not there).
The stretch in DLSS's place gives the same black world; the colour input is no texture placed over another target
and holds the lit world at the end of a frame; the title renders to and writes no texture of the output's size
(3840x2160) in a frame. Leads: the title's upscaler is made for its shipped 1280x720 to 1920x1080, and the frame's
op list stops before the lighting and post-processing.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launcher took the first of py and python, and on a PC whose py is the Python install manager's alias
(WindowsApps\py.exe) that first run waited for an answer: a start from a window nobody types in (a script's)
stood still before the title for 10 minutes, with 0 s of the processor's time, until py was ended. Now python is
tried first (the same manager's alias ran the tool in about a second there), the tool runs as a process of its own
that is ended with its children after two minutes, and the title then keeps its Xbox glyphs, as when there is no
Python.
AI-assisted (Claude). Tested on Windows 11 with the Python install manager: the launcher parses, and python runs the
tool's --help in 1 s; a start from a script went on once the waiting py was ended.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The title's nine vehicle cheats are each `sub rsp, 28h; mov rcx, <model key>; call <spawn>`: the spawn takes one
64-bit model key. A new request, Spawn(key), calls that function with another model's key on the title's thread
that runs its cheats (the deferred queue the other game actions use), as the cheats do: ahead of the player, the
vehicle the spawn made before going as with the cheats.
- The function is read from the cheat table found already (Site::CheatTable): every handler of that form must
call the same function, inside the image, two or more of them (spawn_call_target, spawn_function). No address
and no new pattern.
- A model's key is the low 64 bits of MurmurHash3_x64_128 (seed 0) of its lower-cased name (model_key, written
from the algorithm's definition): checked against the 1.0.2.1 executable, where a vehicle cheat's key is that
hash of a model's name. The form is kylepelham/El1xr's finding (modmenu/names.rs, GPL-3.0); their trainer's
spawn is a port of tsuremen2/MandyMenu (GPL-3.0) after XeMo's PS5 research. No names are kept here: a script
or the user names the model.
- LEONIDA_GAME_ACTIONS_RUN takes `spawn <model name|0x key>`.
Tests: model_keys_are_murmur3_x64_128_of_the_lower_cased_name (the algorithm's published vectors), and
a_vehicle_cheat_gives_the_spawn_it_calls; script_commands_read takes the new command. All of the game_actions
tests pass. Not yet seen in the running title (the game-actions tour comes next).
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three ports of 998fcbcac and 936843f59 in the table of what was fixed, with their switches, tests and the
forks they came from (voidopcode/vilocity 3eda937; kylepelham/El1xr 9372c47f; trustno1-coder/VIctory-NVIDIA PR #65
and El1xr's sim_target.rs).
AI-assisted (Claude).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- LEONIDA_ALIAS_CAST (PR #2660) by turns of 4 s standing, two runs (d156): the card -1.73 +-1.38 and -1.31 +-0.30
ms a frame, the frame's median +0.34 +-0.32 and -0.46 +-0.32 ms: the frame waits for the submitting thread here.
Kept on.
- After chain30's build (new translations) the pipelines not made within their 10 s wait were 10 in the second
run, 55 in the third and none in the fifth and sixth; two timelines of the third run each hold a frame of about
10 s spent on one pipeline worker. Measured runs come after tours.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts in descriptor/host.rs only, where main's twin bias (1bb188cf5) and PR #2660's alias cast (merged into
next as d9a75eb8f) changed the same view-making calls: make_twinned (main) is make_twinned_info (next), which also
gives the cast serial. Kept both: make_twinned_info clears the twin bias first and returns (kept, cast serial);
every maker takes the bias right after it (make_at, make_listed's new records with the bias in the record's stride
word, the slot maker that writes the stride with the bias once the view is made) and keeps the cast serial as next
did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- LEONIDA_SIM_MAX_STEP_MS=100|125|200|250 (unset: the title's own): the title's game timers step
clamp(real time, 1 / rate, 1/15 s) a frame (+0x2226040, run from the frame's timer at +0x22264d0), so a frame
longer than 66.7 ms moves game time only 66.7 ms: under 15 frames a second the world runs slower than the wall
clock. The two loads of that ceiling (vmovss at +0x2226045 and +0x2226833) are pointed at another constant of
the image's .rdata holding the asked value, the constants checked first (all or none). After
kylepelham/El1xr 9372c47f (GPL-3.0), whose runs measured game time 0.92 and 0.89 of the wall clock with the
title's ceiling and 0.97 and 0.98 with 100 ms. The step function's clamp was read in a local decompile
(fast-decomp) of the 1.0.2.1 executable.
- SCRIPTS_59 (vipatch.rs, always on with the 60 fps patch): the function that tells the scripts the frame rate
(+0x3eaf5d0, one million over the interval at +0x98f84ac, truncated) answers 59: with FPS_60's interval of
16 666 it said 60, from which the title halves a per-frame count it hands the scripts (+0x234490). After
trustno1-coder/VIctory-NVIDIA PR #65 (0.985 of real time at 30-36 fps) and El1xr's sim_target.rs (GPL-3.0).
Every place is checked against the 1.0.2.1 executable: the tests the_game_step_loads_point_at_the_ceiling_asked_for,
the_scripts_are_told_fifty_nine, and the retail-executable checks of hooks.rs and vipatch.rs (LEONIDA_GAME_DIR),
all passed; a run with LEONIDA_SIM_MAX_STEP_MS=100 logged every game-step patch applied.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The input poll read the pads, keys and mouse together every 8 ms, so a press waited up to 8 ms for its reading.
Now the poll thread looks every millisecond at XInput's packet numbers of the slots that had a pad at the last
poll and at the Sony readers' count of readings unlike the one before (gameinput/hid.rs), and polls at once when
one moved; the keyboard and mouse stay at every 8 ms (the process runs at a 1 ms timer resolution: runtime.rs).
LEONIDA_PAD_QUICK=0 polls everything every 8 ms, as before. After voidopcode/vilocity 3eda937 (GPL-3.0), whose
poll thread does the same.
Tests: the gameinput module's tests (cargo test -p leonida-hle --lib gameinput), passed.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the second run in the title, Main's initialiser ran (the run-time
sentinels were found, four copies) but lnMade stayed 0: the hook in
mx.core.SpriteAsset never ran. The three movies that load the glyph movie
each define mx.core.SpriteAsset too, and theirs is the one used. The 38
Main_Button_N classes and platform_xbsx.input_icons.Main are defined only
in the glyph movie (the loaders' document classes are generic_movie.Main,
hud.Main and map_scripted_movie.Main), so each Main_Button_N constructor
now calls Main.lnInit(this) in a try block and SpriteAsset is left as it
is. 459 bytes to spare.
A new 64 MiB block of textures (CreateHeap, MakeResident, the wait for its
mapping) or of staging buffers was made inside the pool's mutex, and with
blocks made ahead (LEONIDA_RIPE_BLOCKS) one is made each time one is begun.
Meanwhile every pooled texture let go, every read of texture_room() (the
residency policy and the once-a-second sweep) and every other texture or
staging piece, even one with room in a block, waited for it.
Pool::take_or_need now only finds a piece, or says a block is to be made
first; take_unlocked makes it with the lock released and adds it. One block
at a time is made for want of room: a thread that needs one while another
is made waits for that one on a condvar, and the maker takes the first
piece of its block before the others are woken. Blocks being made count
toward the blocks made ahead. A block that failed is not asked for again
for half a second, and a later failure never shortens that.
texture_room() reads a block count kept beside the pool and takes no lock.
A block is counted as made by the submissions begun when it is added,
after its making. LEONIDA_POOL_GROW_UNLOCKED=0 keeps the old path, with the
submissions begun asked for under the lock as before.
With diagnostics, the memory line gives the blocks made and the time they
took, and the waits for the pools' locks and for blocks being made.
The first run in the title found four copies of lnLo/lnFamily/lnHi eight
bytes apart, wrote them on every switch, and the prompts stayed keyboard.
The sentinels were the slots' defaults, so a template of defaults could
match, and the keyboard pieces were drawn over the PlayStation ones, so
code that never ran looked like writes that missed.
- Main's static initialiser now computes lnLo and lnHi (half of each
sentinel times 2) before its own code: no copy of the movie or of a
slot default holds them.
- lnMade (prompts made) and lnShown (pictures switched) follow lnHi; the
runtime reads them through the found layout and logs them when found,
on each write and every 30 s. A find needs whole numbers there and must
not lie inside a copy of the movie; both rejects are counted.
- Sprites place the keyboard pieces first and the PlayStation pieces on
top (the first named p): if the code does not run, prompts look
PlayStation on every device.
Since the helper counts went by turns, the views pool (8 threads, 4 at
work) and the records pool (10 threads, 6 at work) have a limit function.
Each helper called it under the pool's state lock before every number it
took and after every wake, and the function read the environment
(std::env::var for its _WIDE switch). As the limit was below the thread
count, every batch also woke the parked helpers with notify_all: they read
the environment under the lock and slept again.
The limit is now asked once when a batch begins, kept in the pool's state,
and helpers compare with that. Unless LEONIDA_AB names the _WIDE switch,
the pool is made with exactly the threads that take part, as before the
counts went by turns, so none is parked. By turns, the wide count is made
and how many take part follows the switch, as it did.
The paired form (one 32-lane host wave for a console wave of 64) made exact in more of the console's code:
lane reads in whole-wave sections, v_readlane through the normal path, LDS reads and writes of 2 to 4 dwords,
2st64 pairs, bytes and halves, returning atomics and compare-and-store; loops over partial groups masked and
their regions merged; and a console wave64 program every other form refuses gets one try in it. Merged without
conflicts onto next. voidopcode/vilocity's port of it (c91dff2, 325802c) measured nine more of the title's
programs translating on NVIDIA (the projected decal and liquid trails, two edge particle emitters) and the
"no wave32 lowering" refusals 13 -> 4, the picture as before; it left out the PR's stricter loop check, which
moved nine programs that translate today (the shadow-mask denoise among them) to the approximate form. To do
here before it goes out: the corpus translated before and after (forms by program), and a tour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/live_prompt_glyphs.py builds ps_live_prompt_glyphs.gfx over the
title's glyph movie on the player's PC: each Main_Button_N sprite holds the
PlayStation and the keyboard picture (the first keyboard piece named k),
and the title's ActionScript block gets three static Number slots on Main
(lnLo, lnFamily, lnHi, the outer two sentinels), four static methods that
show the pad or the keyboard pieces when a prompt is made and on each frame
while it is on the stage, and a call from SpriteAsset's constructor, the
base of exactly the 38 symbol classes. Everything added is in try blocks.
tools/abc_file.py reads and writes ABC byte for byte. Both sets and the
code fit the 28,148 bytes with 1,057 to spare on the user's movie.
leonida-hle serves the live movie for a PlayStation pad or the keyboard
(unless LEONIDA_PROMPTS forces a family; LEONIDA_PROMPTS_LIVE=0 restores
one family's movie, LEONIDA_PROMPTS_PAD=xbox keeps a keyboard start on the
keyboard movie), with lnFamily's default set to the family in use, then a
below-normal thread finds the slots by their sentinels through
ReadProcessMemory and writes each change of the active family.
prompt_glyph_movies.py builds the live movie too (only over the title's).
Tested: the added code checked path by path and run in an interpreter over
fake display objects, the sentinel scan and writes on a fake heap. Not yet
run in the title.
wait() started its timer after promote() took the queue's lock, so time
spent waiting for that lock came on top of the frame's budget: in a
synthetic contention test (queue held 240 ms, 80 ms budget) a frame waited
320 ms. The timer now starts before the promotion, so the lock delay is part
of the budget (240 ms in the same test, the lock holder's time itself).
Reported with the test by merzleckeier.
A title buffer copy or a copy at its place in a submission's steps forgot
every copy refreshed ahead, so the refreshes behind it were gathered, asked
about and flushed again. With LEONIDA_COPY_SCOPED=1 (and the submission's one
asking) it forgets only those whose range touches the bytes written or a page
the title shows at another address (inplace::shown_anywhere_else); past 256
such pages it forgets all. Steps that run our code still forget all. RX 6800,
from a new game (run ab-06, LEONIDA_AB by turns of 4 s, 185 world phases): the
frame -2.2 ms (+-1.0) median, -2.5 (+-1.2) mean; ~13 scoped forgettings a
frame kept ~1,600 copies. The frame-rate line counts them.
tools/pc_prompt_glyphs.py draws its own key caps, arrow keys and mouse in
code when --glyphs is not given (no pictures, Pillow or font), with the keys
of the runtime's on-foot table, each inside the outline of the Xbox glyph it
replaces and covering no more of the canvas (measured on the user's movie,
numbers only). tools/prompt_glyph_movies.py builds pc_ and ps_prompt_glyphs.gfx
over the title's movie (standalone if data.rpf cannot be read) into
d3d12/target, where leonida.exe looks; play-nvidia.ps1 runs it before a start
and make_game.py in its runtime stage. A movie the player made is never
touched or shadowed; its own are stamped and rebuilt only when inputs change.
R9G9B9E5 views over R32_UINT/SINT textures the title's compute programs write are read in place
through castable views (CreateCommittedResource3 / CreatePlacedResource2 with R9G9B9E5_SHAREDEXP among
the castable formats, where the card reports enhanced barriers and relaxed format casting), instead of a
copy through a buffer into a second texture at each read in a list (LEONIDA_ALIAS_CAST, on; 0: the copy
as before; LEONIDA_AB can name it). The copies were 1.8 ms of a timing run's card time a frame here
(alias, 86 commands). Merged without conflicts onto next; built, tested and measured before it goes out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A texture whose bytes hashed the same four turns running is hashed one turn in 16 (texture.rs, since
b8bd37111). By turns of 4 s standing at the waterside save, Series X, render scale from 0.75, frame
generation off, two runs (d118): the frame's median -1.67 +-0.81 and -0.76 +-0.82 ms, the submitting
thread -2.88 +-0.50 and -2.62 +-0.49. A recorded tour with it on (d121) showed no texture late or wrong:
the three frames the scan flagged are the camera passing through the player's head on the fast turn back.
'0' in -More gives the old hashing back.
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All 1,078 mesh programs of recent runs are console wave64, and their translations
pay nothing for it on 32-lane hosts: no group-shared memory, no barrier, no ballot,
no exchange between host waves; the only wave operation is WaveReadLaneFirst. So a
paired or wave-wide form has nothing to take away from them (docs/findings.md).
What the translation did pay: the counts were the declared maxima (128 and 128 for
the heaviest), with every slot culled first, so the host's primitive stage takes
every slot of every group. With LEONIDA_MESH_COUNTS=1 the counts are the program's
allocation request: M0 is made again in the deepest block before the request that
every thread runs once and that comes before every export, the group's first thread
gives it to the group through one group-shared dword and a barrier, and outputs past
the counts are not written. A program without such a place keeps the maxima
(LEONIDA_WAVE_WHY=1 says why). Without the switch the emitted modules are unchanged.
The shader cache keys on the switch (translation_fingerprint lists every LEONIDA_*
switch the translator reads; a test checks it is listed).
Tests: the place and the chain on hand-written programs; dxil.dll's validator; on
WARP a group that asks for no primitive draws nothing, as on the console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ported from voidopcode/vilocity's batch of 2026-11-30 (each checked against Leonida's own code first):
- v_cvt_{i32,u32,flr_i32,rpi_i32}_f32 clamp their operand before the DXIL conversion, NaN to 0 and past
the range to its top, as RDNA 2 does (LEONIDA_CVT_SATURATE, on); s_lshl{1..4}_add_u32 set SCC to the
carry of the 64-bit sum (LEONIDA_LSHL_ADD_SCC, on). ReTerryDavis/ReVIctory a892756, 9c99926, through
vilocity eaa934e.
- v_div_fixup_f32 resolves 0/y and x/inf before a NaN quotient's infinity (LEONIDA_DIV_FIXUP_ZERO_FIRST,
on). cool_fox 2b2b00fa, VIctory-NVIDIA feb90ade, through vilocity 83bcc2a. (Its s_min/s_max SCC half
was in Leonida already.)
- BCPack BC7: control bits 4:3 rotate channels in modes 4 and 5 only. fxceless/victory-fork 06702fe8,
through vilocity 4365d81. (Its dictionary half was in Leonida since trustno1 f9de61c5.)
- A constant buffer view made with no description is a null view, and a draw's table nulls that slot.
makmatvey, Marvisak/VIctory#2449, VIctory-NVIDIA 8d2d77c4, through vilocity 12cf6fb.
- XMemFreeDefault's 32-bit path tells the GPU side before it releases the reservation. ZigZagBoi1/
ScarlettPort 745d6f3, through vilocity ed024d5.
Findings: LEONIDA_WC_PARTS_NO_BACK measured and dropped (0.0 MB ever in such parts, d128);
LEONIDA_TEXTURE_HASH_BACKOFF measured by turns (frame -1.2 ms, submitting thread -2.75 ms, d118).
Tests: float_to_integer_conversions_saturate, scalar_shift_adds_set_scc_to_their_carry,
division_fixup_puts_zeros_before_a_nan_quotient (the whole valu suite, 44 passed, on an RTX 4060 Ti,
driver 616.64, and on WARP); bc7_rotation_is_only_of_modes_4_and_5; a_null_constant_view_replaces_the_
view_there_before (to run with the next build).
AI-assisted (Claude). Tested on an RTX 4060 Ti 16 GB, driver 616.64, Ryzen 5 7600X.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>