Threads that fault on the same CLWB site together lost the race: a #UD handled
after another thread rewrote the site decoded CLFLUSHOPT (or the NOP), did not
know it and returned EXCEPTION_CONTINUE_SEARCH, which ends the title.
- The handler continues at a site that already holds the form written on this
host (or the NOP's halfway state): the CPU runs it.
- One lock around unprotect, re-check, write and protect again, so two threads
never interleave on a page; a site found rewritten under it is not written.
- The NOP is written opcode first (66 0F 1F /6 in between is a NOP too).
- The sites counter counts each site once, by the thread that wrote it.
cpu_emulation_test calls the handler with a made-up #UD, so it runs on hosts
with CLWB: first #UD, a second one on the rewritten site, and 16 threads on
2048 fresh execute-read sites. Before the fix 27958 of 32768 concurrent #UDs
were passed on, 4810 rewrites were counted for 2048 sites and pages were left
writable; with it all checks pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record independent synthetic GPU validation at baseline 02f71ccf and with existing PRs #1518 and #2261. Includes before/after counts, focused controls, exact source heads, and coverage limits. One report file only; no performance benchmark or game data.
The 12 to 13 frames a second were measured on the working branch, with a fix for waits on the card that is not on
main yet. The status now says so, and gives what main measured at the same place that day (about 10, median frame
about 102 ms), so that the figure on main is not one main cannot reproduce.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The status section and the platforms table opened with "Nothing is playable yet", which is true of the recompiled
runtime with the Vulkan layer and not of the Direct3D 12 runtime in d3d12/, where a save loads into the open world
and the game is played from there with the HUD, the map, the weapon wheel and the pause menu (measured 2026-11-27:
12 to 13 frames a second on a Ryzen 5 7600X and an RTX 4060 Ti, Series X profile, 2560x1440). The two runtimes are
now told apart at the top, and the measurements say what is played with.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The download step still named the repository's old address (ubiquitarianism/leonida), which trackers list as a
copy. The status section said nothing of the second runtime: it now has this project's own measurements of
2026-11-27 (Ryzen 5 7600X, RTX 4060 Ti 16 GB, Series X profile, 2560x1440: a save loads into the world, 12 to 13
frames a second at the save point, what is known to be wrong, what was not measured).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
After the merge the tree held this branch's older states of files main maintains. Run against main's code,
tests/test_acphal_abi.py and 11 of the 15 translator tests that differed failed, and the C++ runtime would have
been built from two generations of its sources. So that the merge cannot break what main builds and tests:
- runtime/ is main's, file for file (68 files only this branch had are not carried over);
- every file under tools/, tests/ and docs/ that both sides have is main's (80 files);
- ten translator tests only this branch has, which test rules main's translator does not have, and their
fixtures are left out.
What main gains: d3d12/ (the Rust D3D12 runtime), its launchers and helpers (Launcher.bat, scripts/play*.ps1,
play-linux.sh, port_ctl.py, smooth-motion.ps1, fetch_vkd3d_proton.py, sync_victory.py), mods/example_lua, eleven
notes under docs/, seven tools and the tests that pass with main's code, the README's sections and credits, and
the "Runtime traps" section of AGENTS.md. Everything left out here is on the branch port/d3d12-nvidia.
Checked: compileall; make_game.py --help; check_no_game_data.py over every file this adds to main; the
line-ending, docs-encoding, CI-registration and docs tests; each test file that differs from main, on its own.
Not run: the whole translator suite, the C++ build, cargo over d3d12/ after the merge (d3d12/ is byte for byte the
branch's), CI.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Brings the D3D12 runtime branch (d3d12/, its launcher scripts and notes, and the pull requests reviewed and applied
on it) together with mandy's main.
Conflicts (67 files, none under d3d12/): docs/, make_game.py, runtime/, scripts/build_runtime.ps1, tests/ and
tools/. Every one takes main's side: main is where that code is maintained, and this branch's copies were older
states of the same files or the same pull requests in another form. tests/test_fspx_unpack.py is main's too, as it
tests main's tools/fspx_unpack.py. Nothing under d3d12/ is changed by the merge.
Checked before pushing: python -m compileall over make_game.py, tools and tests; make_game.py --help;
scripts/check_no_game_data.py over the files this adds to main; tests/test_text_write_line_endings.py. The
translator suite, the C++ runtime build and CI have not run on the result.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What was taken from aki-gta6/aki-runtime (Aki-Developer, GPL-3.0): the frame line's reasons for dropped draws,
descriptor tables' slots given back as soon as the card has run a flight, four small faults (a pipeline build that
panics, a stale texture read-back, a fence of a removed device, tables of split submissions), the two-plane
composer's NaN and 10-bit output, a pipeline's skip-list answer kept, and in the translator the pixel colours held
to the console's HDR range and LEONIDA_PAIRED_LANES=exact.
Conflicts: draw.rs takes host::table_slots at its three places; host.rs keeps both sides, and table_slots ends in
wait_for_slots (8cc5193ec) instead of settling at once, so LEONIDA_DYNAMIC_WAIT=1 and its counts still apply.
TablesHeld's maps take the state's hasher.
Checked: cargo check --profile diag -p leonida --features diagnostics,mimalloc. Not run in the game yet.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Every translator change taken from aki-runtime is in this one commit: the
translator's source is part of the shader cache key, so every shader is
translated again once after it (the launcher's precompile does it at the
next start: minutes).
1. Pixel colour outputs held to [-65024, 65024] (emit/lower.rs clamp_hdr;
LEONIDA_HDR_CLAMP=0: written as they are, as before). The title renders
light into R9G9B9E5 targets, which clamp at 65408 on the console; the
host stand-in is a 16-bit float target, where a value past 65504 is
stored as infinity, and the title's tonemap makes black of it (the black
sun, black glitter on water and bright sky, in aki-runtime's runs).
LEONIDA_NAN_SCRUB already held an infinity the program computed; a
finite value too large for the target was still stored as one. A NaN
becomes the maximum, unless LEONIDA_NAN_SCRUB made it 0 first (the
launcher's setting). On by default, as there. Only colour targets, not
depth; the view's format is not known to the translation, so a 32-bit
float colour target is held too.
From aki-gta6/aki-runtime 01f6f31.
2. LEONIDA_PAIRED_LANES=exact (emit/mod.rs): once the forms that are exact
without a group barrier have refused a console wave64 compute program,
the paired form is tried, before the exact forms that cost barriers and
before each host half-wave is given results of its own ("local waves
(APPROXIMATE)"). aki-runtime fe9c736 does this by default (about 30 of
the title's programs take the paired form there on a 32-lane card);
here the paired form is asked only where the wave-wide form would be,
so those programs run approximately. The new test shows one: a console
wave's OR inside a lane branch is by default an OR of each half.
Opt-in, not the default: this tree's paired form of the water programs
still draws blocks, it takes 32-bit float sums in the host's order
where theirs refuses them unless told the guest mode, and none of it has
run in the game. Not counted over the title's shaders here.
Already here from their paired work: a reduction's unseen partial sums
stand as zero (59e298a: paired.rs unseen_after, from Vice-Tay 5e588e8), the
rules of what the form takes (spilled programs, groups that fill their
waves, the LDS operations, the group rendezvous), the FP64 constant sums.
Not taken: their replay of FP32 reductions in the console's order
(paired_fp32.rs; needs AKI_WAVE_PAIRS_FP32 there and their notes say the
water's blocks are the same with it).
Files: leonida-shader/src/emit/lower.rs, mod.rs, paired_tests.rs,
wave64_tests.rs (a fixture made visible to paired_tests).
Tests: emit::barycentric_tests::a_pixel_colour_output_is_held_to_the_consoles_hdr_range,
emit::paired_tests::the_paired_form_before_the_approximate_ones_when_asked,
the_switch_reads_its_modes. The translator's suite on the card was not run
(the game was running), apart from the 14 tests of barycentric_tests.
From aki-gta6/aki-runtime 01f6f31 and fe9c736 (Aki-Developer), GPL-3.0.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The credit line names each thing ported from aki-gta6/aki-runtime (Aki-Developer, GPL-3.0); the commits carry the
hashes.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
With the output at 2560x1440 the title's settings.xml still said 0x0 for its UI (as the console: 3840x2160)
and the weapon wheel and menus came out half again too big. The launcher writes the output size into
uiResolution and resolutionFullscreen before the start (the first file is kept as settings.xml.original).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Every draw, dispatch and indirect execution asks whether the skip list (LEONIDA_SKIP_PIPELINES; the launcher puts the
seven water programs on it) leaves its pipeline out, on the threads that record lists, and each ask hashed the hash
string of every shader of the pipeline and looked it up. The list is read once and a pipeline's shaders do not
change, so the pipeline keeps the answer in a byte (pipeline.rs kept_answer): about 9,500 draws a frame ask with
one load each. Diagnostics builds only, as the skip list is (they are the builds played).
Not taken from the same commit: its tune.rs (numeric switches of the copy path read again from a file while the
title runs). Leonida's switches made with toggled! are flipped while it runs through LEONIDA_AB, and the F1 menu
holds the rest.
Files: pipeline.rs. Test: pipeline::kept_tests::an_answer_is_asked_for_once_and_kept. Not run in the game yet, and
its share of a frame is not measured.
From aki-gta6/aki-runtime f8cdc2d (Aki-Developer), GPL-3.0.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
DLSS frame generation makes its frames from the swap chain's picture. The two-plane presentation (Series S: the
scene and the interface) was composed into R8G8B8A8, and generated frames of an 8-bit picture came out in bands
(sky, skin) in aki-runtime's runs of 2026-11-27; composed into R10G10B10A2 the bands were gone there. Here the same
while frame generation's Streamline is started (fg::active). If the swap chain refuses the format once, 8 bits are
composed from then on, with a warning.
Not taken: their conversion of a single presented plane into 10 bits (bdcb503's ps_one). A single plane is copied
in the title's own format here (swap_format), which is 10 bits or more where the title has them, and an 8-bit
plane gains no levels by being copied into 10.
Files: host.rs (planes_format, present_tenbit, two places in present_planes). Test:
host::relay_tests::two_planes_are_composed_into_10_bits_under_streamline_only (the choice; the composing itself needs a
card with Streamline). Not run in the game yet.
From aki-gta6/aki-runtime 2f43f8b and bdcb503 (Aki-Developer), GPL-3.0.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Measured like for like at the save (three minutes of the idle camera each, Series X, 2026-11-27): 92.5 ms a
frame and 6,353 draws with the console's settings.xml, 90.9-101.7 ms and 6,636-7,079 draws with aki-runtime's
lighter set, and 338-350 draws a frame dropped for want of a pipeline against 191. The earlier figure in
8576e3d5c (7,700-9,500 draws to 3,100-4,800) compared a night drive over a bridge with the save and was wrong.
LEONIDA_TITLE_GRAPHICS='performance' writes the set; the default leaves the file as the title wrote it.
LEONIDA_PROFILE_ONLY also matches a thread's start (module+rva), for the title's own threads, which have no name.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
saturate() makes a NaN 0: black specks and a black sun where the upscaler or frame generation handed one over (sun
glints on water). The composer's pixel program clamps through a test on the bits instead (NaN and +infinity 1, negative
and -infinity 0), which the compiler cannot fold away as it may x != x. Only the two-plane presentation composes
(Series S); with the sharpening on, a NaN in the scene already came out as its neighbours' darkest, so this is for the
interface plane, its alpha, and LEONIDA_SHARPEN=0.
Files: compose.rs. Test: compose::source_tests (the program compiles both ways and the two differ; no card needed).
Not run in the game yet.
From aki-gta6/aki-runtime 33c21b9 (Aki-Developer), GPL-3.0.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>