Commit Graph

767 Commits

Author SHA1 Message Date
chrg6
65dacfa7c7 Ask the write watch once per run of regions in the texture pool's check, and pass released entries by.
At every submission that binds the texture pools the replay checks each listed texture for CPU writes, and takes the write-watch snapshot of the 2 MiB regions that have none yet as the list comes to them: one query a region, since the list is in no address order. Standing still that is 5 to 10 queries and the check takes 0.11 ms. While the player runs through Kakariko or Castle Town the game writes about 32 textures into new storage every four or five frames, a region the CPU wrote is not frozen again for 1,800 submissions, and the check asked for 100 to 500 regions one by one, 2.7 times a frame: 0.5 to 1.5 ms a check, about 3 us a query, in five sessions of one player. The regions are now collected for the whole list first and asked in one query per run of adjacent regions. On this machine 400 queries of 2 MiB take 727 us and one query over the same 800 MiB takes 360 us. The same regions are queried and the same pages stamped, all of them before the list is looked at, as each entry's were before its own look; a run across the edge of a watched reservation is left to the queries by range. pool_presnap_runs = 0 asks region by region as before.

A released entry stays in the list until it is destroyed, the check does nothing for it, and the stamp it compares stays as it was at the release, so one whose region took a write later missed the region check at every submission from then on and was fetched only to be passed by: 1,000 to 6,300 entries a check, with up to 8,192 released entries kept. The list now carries the released state, set at the release and cleared at the take-back, and the check passes such an entry by without touching it or asking for its regions.

The pool log's freshness line counts the released entries passed by, and its snapshot queries count the queries either way. --probe-vkmem has a case for the queries by run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:49:54 -05:00
chrg6
0cc247b513 Record the flight recorder's thumbnails at 640x360.
At 320x180 a frame of a 2560x1440 picture kept one texel in eight each way, and a flicker of a small object or of fine shading while the camera stands still did not show in a dump. The ring of 600 thumbnails takes 553 MB of host-visible memory instead of 138 MB while the recorder is on.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:43:10 -05:00
chrg6
5ec1008709 Make a newly registered slot's texture at its first lookup too.
The rule for a slot that shows another texture left out the slots that showed nothing when the game registered them: the game takes slots whose texture it finalized some time ago for its next textures and draws with them at once. Past the 16 a refresh makes, such a slot kept its stand-in until the next round. One of them was an effect's texture with a transparent ground, which drawn with the stand-in was a flat grey patch for one frame, at each of two rounds of registrations four frames apart in a player's recording. A slot registered since its last lookup that found a texture now counts with the shown ones, within the same 64 a present.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:33:59 -05:00
Leonardo Chappuis
82e093ef93 Fix a deadlock between the replay workers in vk_exec_pass_end.
vk_exec_pass_end took tfr_lock and then, in vk_texture_gpu_written, the texture lock. A chunk recorded by another
thread can hold the texture lock in the pool sync and end its pass there (a lookup's alias copy through
vk_exec_inline_begin), and then wait for tfr_lock. The two chunks waited for each other and the other chunks spun in
their turns, so loading after Continue never finished with replay_workers = 3. The targets are now marked written
before tfr_lock is taken, which guards only the target history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:30:14 -05:00
chrg6
a374e778fa Keep a released texture's image while a registered slot still names it.
The game finalizes a texture object while another one it initialized at the same storage with the same parameters stays registered in the pool, and the entry the two share is released all the same. Two frames later its image went to the next texture of its parameters and the entry was dropped; the slot then had nothing to show, because the pool makes no entry for storage the CPU cannot read, and kept its stand-in until the game drew into the texture again. Ocarina's 384x384 shadow maps are such textures: a player's recording has four slots of them sampled as stand-ins in the frame after three of their images had gone to other shadow maps, and a house front without its shadow in that frame. The reuse now passes over a released entry that a slot which is not finalized names; tex_reuse_named = 1 restores the old choice.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:25:41 -05:00
chrg6
fe468f7ec6 Make a slot's new texture at once when the slot is showing another one.
Ocarina streams its textures by detail level: while the player moves it registers about 32 pool slots with their next level every four or five frames. A pool refresh made 16 of them and wrote the stand-in into the set for the rest until its next round; the set is read as it is when its submission goes to the queue, so an object whose slot was among the rest could be drawn grey for a frame. A player's recording shows 1,525 such slots in 600 frames, each with its texture made later in the same frame. A slot whose entry in the set is a texture's view when it is looked up now has its texture made by that lookup, beside the count budget and the frame's creation time, 64 of them a present; pool_shown_first = 0 leaves them to the budget. The flight recorder also notes a slot that still had no picture when its submission ended.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:19:19 -05:00
chrg6
95fb707bcb Record a pool slot losing its picture in the flight recorder.
When the pool's entry of a slot goes from a texture's view to the stand-in, events.tsv gets a line with the slot and what its own texture was at that moment: finalized, released, superseded, overwritten, uploaded, its storage readable, held out. The set is written with update-after-bind, so every draw of the submission that samples the slot reads the stand-in from then on; the check at the marks' read-back comes a frame later and finds the slot resolved again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:12:23 -05:00
chrg6
bbaf732b81 Record what an upload read, slot registrations and sampled stand-ins in the flight recorder.
Three more texture events for a dump's events.tsv: after each upload a hash of 64 probes of the storage and how many of them were all zero, so a second upload a frame later tells new bytes from the same ones and a first upload of unfilled storage shows; a slot registered with a CPU-written texture, with what the slot named before; and a slot a shader sampled that has no image of its own and follows none, so its stand-in was on screen. They are for telling why a texture shows wrong for one frame while the game streams textures in.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:04:25 -05:00
chrg6
fe95c0b60b Count only the making of textures against a frame's texture creation time.
The limit on what a frame's pool refreshes may spend creating textures was charged with the whole refresh, including its check of every entry the pools hold. In Kakariko that check takes 0.8 ms a submission, six submissions a frame, so most of the 6 ms was gone before a texture was made and the frame's later refreshes made none: 87 refreshes in 600 frames, with 1,090 slots left between them. The game moves about thirty textures to new storage every four or five frames there, and the ones a refresh left were on screen as their grey stand-ins for a frame; a player's recording shows three lamp posts turn grey for one frame that way. The limit now counts the time the lookups spend making entries and uploading them the first time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 09:47:27 -05:00
chrg6
99bdecd725 Bring the graphics notes' checks up to the code: dual-source blend and depth compare in compute are done, and what the timestamp mismatch can change.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 09:31:49 -05:00
chrg6
518d55ed07 Draw lines as wide as the game sets them.
The game's line width was dropped at the call and every line drawn 1 pixel wide; the game draws two lines a frame at 4.5 pixels into a 144x144 mask. The width is now recorded with the draw state and set as dynamic state for draws of the line topology class, held to the device's range. Only pipelines of that class list the new dynamic state, so the others keep their entries in the pipeline caches and the driver's. line_width = 0 draws every line 1 pixel wide as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 09:31:04 -05:00
chrg6
ef3466ce4f Merge main into the 0.9.1 release: the launcher's Mods screen, the anti-aliasing choices beside FSR and DLSS, and the scene's last row and column filled before an upscaler reads it.
The 0.9.1 notes keep the release branch's text and take main's sections: New, the edge line under Fixed, and Changed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
v0.9.1
2026-11-12 09:00:37 -05:00
chrg6
baad032500 Keep the fast link's waits at 3 ms a pipeline and 6 ms a frame.
The 8 ms and 16 ms tried in their place left fewer draws out in a scripted walk, but in play a frame that takes 10 to 14 ms longer felt worse to the player than one that is left out, in two sessions on the same install. The wait stays counted once for each pipeline, and a frame that has left a draw out already still waits for nothing more.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 08:49:26 -05:00
chrg6
b5aea4808b Say in the 0.9.1 notes which compute variants the preparation cannot read yet.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 08:37:34 -05:00
chrg6
8a61fcacaf Stop waiting for fast links in a frame that has already left a draw out.
Such a frame is held back or shown without that draw whatever its other pipelines do, and with hundreds of pipelines new at once every frame of an area's load spent its whole 16 ms budget on waits that could not complete it: 49 frames over 25 ms in a walk with no pipeline recorded, against 17 with the earlier 3 ms waits. With the rule the same walk has 15, the picture stands still 15 times instead of 50, and 1 frame is shown incomplete instead of 22.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 08:35:47 -05:00
chrg6
9f7c8ae810 Wait 8 ms once for a pipeline met for the first time, and carry the compute variants in the pipeline list.
A draw that met a new pipeline waited 3 ms for its fast link, in every frame, which is just under what the link takes with the stage libraries in the driver's cache: in a first-visit session on a new install 66 of 87 such draws gave up at the end of the wait and their frame was held back. The wait is now 8 ms for each pipeline, counted from its first miss and shared by all its draws, and 16 ms for a frame, so a pipeline the driver has to compile costs one frame the wait and the frames after it nothing.

The pipeline list tool also takes the compute variants a game folder dispatched, which no pipeline record names and which were translated in the middle of play, and reads a list made before as one of its inputs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 08:25:42 -05:00
epicmeme546
37dc8a85b8 Move the Mods bullet from the 0.9.0 notes to the 0.9.1 draft.
0.9.0 is tagged at fbd4067 without the launcher's Mods screen, which came after it (89c453d), so its bullet goes under "New" in docs/releases/v0.9.1.md, unchanged. docs/releases/v0.9.0.md is back to how it was at the tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:25:25 -05:00
epicmeme546
2d09c220bf Fill the scene's last column or row from the one next to it after a jitter to the left or up, before DLSS or FSR reads the scene.
With FSR 4 or FSR 3.1 a light line flickered along the bottom and right edges of the picture. The jitter moves the scene's viewport by under half a pixel, which keeps every pixel centre inside it. Yet on an RX 7900 XT, a viewport moved up left the last row undrawn in every scene pass, and one moved left the last column. A frame dump showed the depth's last row at its clear value and the light target's last row holding the fog's colour, which the upscaler blended into the edge. NX2NAVI_DLAA_EDGE_FILL=0 turns the fill off for testing.

Hyrule Field, 3416x1440, present screenshots: the outermost rows averaged 40 against 20 just inside without the fill, and within 1 of the inside with it. The same held with FSR 4.1 Native AA and Quality, FSR 3.1, SMAA and HDR. Jitter off, and no upscaler, gave no line either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:23:25 -05:00
epicmeme546
1c654ba0c1 Let the Anti-aliasing row's Game SMAA, Off, FXAA and SMAA run together with FSR 4, FSR 3.1 or DLSS, and show the anti-aliasing in the performance overlay.
Choosing one of them while a temporal upscaler was set turned the upscaler off, and the picture fell back to bilinear scaling. vk_aa.c no longer keeps the game's SMAA while DLSS or FSR runs. The chosen pass replaces the game's composition as without them: in the native modes after the upscaler, and in the scaling modes before it. In the menu, a choice leaves the upscaler and frame generation alone, and the row notes that the upscaler's TAA runs too. Picking DLSS or FSR under Upscaling keeps the Anti-aliasing choice. The TAA entry, listed while no temporal mode is set, now sets FSR 4 Native AA where FSR 4 runs instead of forcing FSR 3.1. The overlay gets an Anti-aliasing line under Upscaling, for example "TAA + SMAA (Ultra)".

Checked on an RX 7900 XT in Hyrule Field with FSR 4.1 Native AA and Quality, and with FSR 3.1. The log has "the game's SMAA replaced by" smaa, off and fxaa while FSR 4.1.2 upscales, and the pictures are right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:23:25 -05:00
epicmeme546
89c453d7bb Add a Mods screen to the launcher and build the mods' code patches into the launcher's game.
Mods, on the home screen, opens the game's mods folder, adds a downloaded mod from its .zip, .7z or .rar file or its
folder, switches each mod on or off, and sets the load order (mods_disabled and mods_order in nx2navi.ini, written as
the game writes them). Each mod's description says what it changes, which other mod changes the same files and which
of the two wins, and why the game leaves it off when it does.

Before the game starts, Play puts the mods folder in order (launcher/mods.py prepare): an archive in it is unpacked into
a folder of its name and kept, a mod whose files sit a folder or more down has them moved up, and a romfs, exefs or
cheats folder put straight into the mods folder becomes a mod of its own. An archive that would write outside its
folder is refused, and nothing is deleted.

The launcher's build (tools/make_game.py) left the mods' code cheats and ExeFS patch files out, so those mods stayed
off. The lift now turns them into patch sets first, as the setup does, with the files in the lift's key and
build-cache/mod-code.json recording what it took up. Play builds the game again before it starts when an enabled mod
brings code no build has seen. The shaders' key names the lift and the compile without the mods' code, so such a build
compiles only what the patches change and leaves the shaders prepared. tools/mod_files.py is the one place the tools,
the build and the launcher find a mod's parts.

Tested: a zipped mod holding its own folder, put into a mods folder, was unpacked and moved up by the launcher's code,
and the game served its file in place of the game's. The lifter took a code cheat and a pchtxt patch made for the game's
main as patch sets. The launcher's and the setup's tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:11:57 -05:00
chrg6
d31c3a1036 Make the water corrections in the runtime, on by default, instead of loading replacement modules from a folder.
The coordinate pair and the absorption guard needed modules made on each PC by tools/projective_recipe.py and a folder named in NX2NAVI_SPV_OVERRIDE, so no player had them. runtime/spirv_water.c makes the recipe's edits on the translation in memory, in the recipe's order: on the NVIDIA profile its three modules are byte for byte the recipe's (RTX 5090, game 1.1.1). vk_pipeline.c keeps the edited modules in a small table, made at first use, and builds a pair from them only when both of its stages were made; a module of another shape is built as it is, with a log line. NX2NAVI_WATER_PROJECTIVE=0 turns the corrections off. tests/water_projective_check.py compares the runtime's edits with the recipe's on made-up modules.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 07:55:57 -05:00
chrg6
56e142169c Merge main into the 0.9.1 release: the launcher's animations stopped behind another window, the uniform snapshot's copy split over the replay workers, and the replay workers' default of three with its measurements.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 07:29:41 -05:00
chrg6
fc0202467c Make the release 0.9.1, with its notes.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 07:21:41 -05:00
chrg6
d2ab9a00be Check at startup that the launcher's Python can read zstd files, and say how to fix it when it cannot.
Run from a checkout, the launcher uses the Python that started it. A Python older than 3.14 without the zstandard
package got through the first-run screen and stopped at Gather Build Tools with only "No module named 'zstandard'",
after the packages were downloaded. toolchain.zstd_missing now looks for compression.zstd or zstandard when the
launcher starts. Without either, the log and the first screen name the Python and give the pip line for
tools/requirements-launcher.txt, and Gather Build Tools stops with the same message before it unpacks anything. A
release's own Python always has the package; if it ever lacks it, the message says to reinstall NX2navi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:18:10 -05:00
Sebastian Choperena
ee46a19ede Raise the limit of released textures by the card's video memory budget, from 2048 to 8192 entries (NX2NAVI_TEX_RELEASED_MAX). 2026-11-12 07:13:16 -05:00
TheShinySylveon
0cb2e6f00a Reserve no core for the recording thread by default
On an i9-14900KF (8 performance and 16 efficiency cores, 32 logical processors), with the replay on its own thread,
the core NX2NAVI_RECORDER_CORE=auto reserved (logical processors 14 and 15) left the woken replay thread unscheduled
for about 200 ms roughly once a second while the game stood in Kakariko. During each stall its queue held 40 to 50
items, its lock was free, the wakes had been sent and it used no CPU time, while a game thread waited on a fence of the
work in that queue: 27 frames a minute had a 150 ms or longer frame. With NX2NAVI_RECORDER_CORE=0 the same minute had
none. The default is now 0; auto and 1 still reserve the core, and the log says when none is reserved.
2026-11-12 07:12:41 -05:00
bct8925
6e87c921a1 Start a new DLSS history on a camera cut, and give frame generation the same new start.
vk_dlaa_fg_inputs handed frame generation a reset of 0 every frame, so it was never told of a new history: across an
area load, another scene size or another target it generated frames between two unrelated pictures. It now gets the
reset DLSS ran with on the same frame.

DLSS itself started a new history only for a lost camera, another scene size or another target, not when the camera
jumped. cam_cut takes a move over 5 m, or a turn over 10 degrees together with a move over 0.5 m, per 60 Hz frame
(scaled by the time since the last camera) for a cut, from camera traces of play in the Fire Temple: a median of
0.05 m and 0.08 degrees a frame, area loads of 5 to 180 m in one frame. NX2NAVI_DLAA_CUT=0 turns it off, and each cut
is logged, up to 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:12:16 -05:00
bct8925
20a1410023 Take a pass for DLSS's output only when it has the scene's shape.
Ocarina redraws its 2000x2000 area map into an RGBA8 target of its own on a room change and on the pause menu: one
colour target, no depth, larger than the scene both ways, which was all the output pass had to be. DLSS then wrote
the game's picture into the map (the log's "DLSS feature created at 1280x720 -> 2000x2000"), and the minimap showed
that picture behind its room shapes, a close-up of Navi or of Link from the moment of the room change, until the pause
menu drew the map again. A pass whose width over height is more than 3% from the scene's is not the output; the
first eight are logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:12:02 -05:00
bct8925
ca75294126 Let a texture slot follow another texture at its storage only when the two are the same size.
When a slot's own entry was released, slot_resolve took any live entry at the same address, and Ocarina's per-frame
render targets share storage. The half-size ambient occlusion term (640x360 at a 1280x720 scene) followed the bloom
pass's 480x270 target there every frame: the blur that writes the term kept its top-left 480x270, the upsample stretched
that over the screen, and every contact shadow sat 1.33 times further from the top-left corner than its object (doubled
shadows below and right of Link, shadows of terrain out of view). During a hit effect the same slots followed its
1130x86 strip instead, the term read zero over most of the screen, and the right 44% of the scene went black.

Block-compressed formats keep the old rule, as a GPU encoder renders their blocks through a smaller view of the same
storage. The first eight refusals are logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:11:46 -05:00
Leyukaka
0d564a21c0 Clear the stand-in images: sampled ones to mid grey, storage ones to zero.
The 1x1 images bound where a slot has no texture were only moved to GENERAL, so their content was undefined. A material that read its roughness map through one could see roughness near 0, and on Kakariko's distant cliffs at night the specular term reached 3392 in single pixels of the scene target, which bloom and the temporal upscaler spread into bright white spots. Sampled stand-ins now read as opaque mid grey (a middling roughness, a flat two-channel normal), storage stand-ins as zero.
2026-11-12 07:11:46 -05:00
epicmeme546
432b4e4b1c Turn the replay workers on by default: three of them record a frame's large draw groups beside the submitting thread.
On an RX 7900 XT with a Ryzen 7 5800X3D, Hyrule Field standing went from 41.2 to 50.4 fps in one batch, and the
pictures matched those with the workers off there and in Kokiri Forest, Kakariko, Goron City, a graveyard house and
Gerudo Valley. replay_workers = 0 in nx2navi.ini turns them off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:10:27 -05:00
epicmeme546
7eee4817f9 Split the uniform snapshot's copy over the replay workers at the start of a submission.
The workers have no chunk to record while the snapshot copies the uniform ranges a submission binds (about 700
regions, 0.7 MiB in Hyrule Field), so the replay thread now hands them slices of it through vk_exec_par, a loop the
workers take between groups. Without workers the copy runs on the replay thread as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:10:15 -05:00
epicmeme546
bd94adc9ec Stop the launcher's animations while another window is in front, so a launcher left open behind the game no longer draws every 15 ms.
With Hide Launcher While Playing off, the launcher stayed in its normal state behind the game and kept stepping its
animations: about 0.6 of a CPU core went to a window nobody saw, beside the game's render thread. The animations now
also stand still while the window is not in front, the same check the gamepad polling uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:09:55 -05:00
chrg6
a13af7a8c2 Replace a water pair's vertex module before the vertex output union's additions, keep pairs with dual-source blending original, and log each replacement.
The paired modules were looked up by the hash of the module as built, so a vertex module that had outputs added for its union (which differs from one install to the next) or a fragment module changed for dual-source blending ended the run. The vertex replacement now stands for the translation itself and takes the added outputs as any module does; a pair with dual-source factors is built from its original modules in both stages.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 06:37:04 -05:00
ChurchOfIlias
37e8e6dbda Guard water absorption distance alongside paired coordinates
Add the exact-material nonnegative distance guard and the recorded NVIDIA translation profiles. Keep generated shaders and the private native patcher out of the repository. Document reported cross-vendor testing and the unresolved origin of invalid absorption distance.
2026-11-12 06:34:27 -05:00
ChurchOfIlias
d0d0112c3a Add an opt-in paired projective coordinate correction for water
Carry clip coordinates through perspective interpolation for the identified water shader pair. Keep generated modules private and document the observed results and remaining portability limits.
2026-11-12 06:34:27 -05:00
chrg6
2f39b27fb6 Record the draw replay on three replay workers by default, and start the draft notes after 0.9.0.
replay_workers = 0 records everything on the submitting thread, as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 06:20:05 -05:00
chrg6
6ccd1e224d Build the shared pipeline list before play on every start, and build every listed pipeline at install.
A new install met every pipeline in play: in Hyrule Field one 600-frame stretch of a first visit had 1,769 draws wait 461 ms in all for pipelines, the longest frame 88 ms. The boot now reads seed-pipeline-keys.bin, the release's list, as recorded pipelines after the install's own (keys_open_seed, NX2NAVI_PIPE_SEED, default 1): their pairs go into the vertex output unions and the prewarm builds them as it builds the install's. The preparation builds every listed pipeline (NX2NAVI_PREPARE_PIPELINES now defaults to all), with the unions of the same list, so the first boot of a new install finds them in the caches. The list's mesh pipelines are left out at the boot on a GPU without mesh shaders, as the preparation leaves them out. Nothing of the list goes into pipeline-keys.bin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 06:19:39 -05:00
chrg6
fbd4067460 Merge main into the 0.9.0 release; its one commit, the opaque ASTC textures as BC1, is already here as 4c5855ce with the settings list merged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.9.0
2026-11-12 05:58:16 -05:00
chrg6
34cfb1a6e9 Say in the 0.9.0 notes that Kakariko's haze no longer drops out for a frame, and narrow the known flicker to shadows and lighting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 05:43:33 -05:00
chrg6
4956ef8365 Let a finalized slot sample its own texture's image while that still holds the texture, not the stand-in.
The game finalizes texture objects on its own thread ahead of the replay, which still draws the frame the game recorded
before that; on the console the memory still holds the texels those draws read. Kakariko moves about 30 of its
textures to new addresses every four or five frames, and each move finalized the old descriptors. The replay's draws
of the frame before then met finalized CPU-written slots, and the stale rule gave them the stand-in even when their
own entry was still there with its content. The village's haze dropped out of a frame a few times a minute, and the
haze sprites that met a stand-in left hard-edged clear patches. A play session in Kakariko logged up to 4,805 stand-in
lookups in 60 frames, 1,826 in the 60 frames around one haze dropout, and 612 in the 60 frames after a run of
patched frames.

Such a slot now resolves to its own entry while that entry was uploaded or drawn by the GPU, and was neither superseded
by another descriptor at its address nor overwritten. The lookup samples the image as it is: it neither takes the
entry back nor reads its storage, so freed storage is still never read (the access violation the stale rule was made
for). NX2NAVI_TEX_STALE_KEPT=0 gives the stand-in again. The perf log's finalize line counts these lookups.

In a replay of a recorded Kakariko walk, most 60-frame windows went from stand-ins to the kept image (up to 328 a
window, stand-ins 0). In play, stand-ins remain in short bursts where the entry was already gone (up to about 2,000 in
60 frames, against the kept image in most windows). The tester still sees flicker that the 640x360 frame recorder
does not catch; that is not settled by this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 05:42:43 -05:00
chrg6
4b87606f32 Keep released textures the game takes back intact for as long as their longest release, not 120 presents.
Once the released entries pass RELEASED_MAX, the sweep dropped an entry that comes back intact as soon as its 120
presents were up. Kakariko releases the ASTC textures of its hazy air and takes them back every few hundred frames, so
about 30 of them went each time, and the frame that needed one again sampled its stand-in while it was made and
uploaded anew. Such an entry now waits out GAP_TIMES the longest it stayed released before a take-back, as an entry
whose content lives only in its image does. NX2NAVI_TEX_KEEP_TAKEN=0 goes back to the old rule, and
NX2NAVI_TEX_RELEASED_MAX (a test) lowers the count from which the sweep starts, so a short run reaches it.

The haze still dropped out with this alone: most of those frames came from finalized slots, which the next commit
deals with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 05:42:42 -05:00
chrg6
d6c8b0631c Expect the SMAA lookup textures among the files the shader build embeds as headers, beside the menu font.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 05:33:52 -05:00
chrg6
e97c892742 Write the release notes of 0.9.0: the draft after 0.8.0 with every change since, the install steps, the known issues and the thanks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 05:32:09 -05:00
chrg6
c05b2570eb Make the version 0.9.0, and leave the long-wait watch off by default.
The watch's thread takes the kernel lock every two seconds to look at every guest thread; a release does not need it running, and wait_watch_s = 10 turns it on again for a hang report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 05:29:44 -05:00
epicmeme546
eb7072f90a Make NX2NAVI_REPLAY_PIPE the number of groups the submitting thread may have out at once, from 1 to 4.
Hyrule Field, standing, 3 workers: with 1, 2 or 4 groups out the frame rate stayed within one frame per second of
the 50 the mode without pipelining makes, over three batches, though the replay is shorter. A frame there is the
replay and then about 6.6 ms of GPU work after it, which the next frame waits for; the design comment in vk_exec.c
now says so. Sending a part's finished command buffers while later groups record was tried and gained nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 04:39:12 -05:00
epicmeme546
ffa599ef33 Let the submitting thread go on past the replay workers' groups, with up to four groups in flight.
With NX2NAVI_REPLAY_PIPE=1 (off by default) the submitting thread hands a group's chunks to the workers, takes chunks
of it itself until none is left to take, and goes on with the ops after the group in a new command buffer after the
chunks' places in the part (vk_sync_append_later), also into the next group's front pass.
Up to four groups are handed out and not in their part yet; their chunks wait in one queue in the order of the stream.
The submitting thread waits for them only where the order needs it: for room, before a part goes to the GPU, before
copies and texture or buffer clears, where DLAA's run or the contact shadows' hook acts, and where a lookup would make
a texture entry or take back a retired one (the op goes again afterwards, as a chunk's does in turn).

What the chunks read stays as the stream had it while the submitting thread runs ahead: uniform snapshot drops count
from their place in the stream, a chunk reads only the inline uniform updates before its group, the HDR present's
source goes by stream position, the texture pool set syncs under the chunks' lock, each group keeps its own render
conditions, occlusion segments and closed query slots, and the queries after a group's last report go into the next
segment made after it. A group's first chunk runs its pass hooks after the group before began its pass; turns wait
for every earlier chunk, of earlier groups too. Locks the chunks take, the submitting thread takes while it is behind.

Draws keep the sampled-texture descriptors they resolved per draw context and reuse them without the texture lock
while their slot is unchanged; the workers waited for that lock at nearly every draw. Texture lookups that change
nothing no longer wait for their turn. The perf line says where the submitting thread waited, what the chunks took,
and which texture lookups waited; NX2NAVI_GPU_TIMELINE also shows the chunks and the waits.

Off by default because it does not pay yet: in Hyrule Field with 3 workers it shortens the replay (11.5 against 12.1
ms a frame) but not the frame (49.2 against 49.6 fps in the same batch). The GPU gets a group's commands only once its
last chunk is recorded, so the main thread's wait for the GPU after the frame's first submission grew by 0.8 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 04:39:12 -05:00
chrg6
2ac56ecc6f Add NX2NAVI_VRAM_BALLAST_MB, video memory taken for the session, to test a smaller card on a large one.
NX2NAVI_VRAM_BUDGET_MB changes only the number the decisions compare with. The ballast takes that much device-local
memory right after the allocator is made, in dedicated buffers of 256 MiB, and holds it until the allocator goes, so the
driver's own behaviour at its limit (slow allocations, memory moved to system RAM, refusals) shows as on an 8 GB card.

Checked on an RTX 5090: 24000 of 24000 MiB taken and held; through eight reloads of Kakariko the use went past the card
(32,218 MiB at the end) and Kakariko fell from 118-151 fps in the first four rounds to 10-24 fps in the last four. Texture
detail was still chosen as full: the choice reads the driver's budget, which the ballast does not lower.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 03:54:21 -05:00
chrg6
7f7416b38b Log the voices the game holds in the audio renderer every 10 s with NX2NAVI_AUDIO_STATS.
The game's sound engine takes a voice per sound from the renderer's voice count, so sounds that are never let go
would show as a count that climbs from area to area until new sounds are refused. The line gives the voices in use,
those playing, the renderer's voice count and the most a census found so far.

Used to check whether the sound engine leaks voices above 60 fps: through eight reloads of Kakariko the most was 30 of
96 at a 60 fps limit and 31 at 144, and every return to the title brought the count back to 12 at both rates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 03:54:21 -05:00
chrg6
bd32077e54 Sample a flat texture that a shader reads as a 3D one through a one-slice 3D copy instead of a stand-in.
Maxwell samples a texture by its own descriptor, so a 2D texture under a 3D sample gives its texel at (u, v). Vulkan
has no 3D view of a 2D image, and get_view found no view for such a binding: the draw sampled a stand-in. Such a
texture (plain colour, one sample, up to 1024 x 1024 texels) now gets a 3D image of one slice with all of its levels,
made in the upload batch and copied again when the texture was uploaded or drawn into since, or another layer is
asked for (vk_texture.c vk_texture_flat3d_locked). NX2NAVI_TEX_FLAT3D=0 gives the stand-in as before.

Seen in Kakariko: two of the game's 4 x 4 RGBA8 textures are sampled as 3D textures, and each got its copy; the runs
through eight reloads at 60 and 144 fps ended without errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 03:54:21 -05:00