Shader tracking accuracy #527

Open
tragice wants to merge 1 commit from tragice/Darner:main into Main
First-time contributor

Contributor role (optional)

  • Fluxer ID: 1576470748871012355

What it changes

This is a much more accurate shader tracking percentage. It will tell you the "# of shaders in cache (%) Estimated time remaining".

The percentage comes from a counting pass over the shader files, so it follows real work instead of file bytes and can't jump to 85% early.

Start-up cost: the counting pass reads every shader file once more before the bar starts. It prints a line like 25291 containers in 50 files, counted in 3 s. The bar sits at 0% during that pass.
This should only be a few seconds at most. (TESTED AND VERIFIED WAIT TIME NO LONGER THAN 5 SECONDS)

How it was tested

Only tested in compiled build preloaders.
Shader tracking worked well and smoothly progressed to 100% instead of jumping and hanging in areas due to most shaders bein in a single file.

COMMENT WITH TEST DATA AND RESULTS

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • This PR's Depends on none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
## Contributor role (optional) - Fluxer ID: 1576470748871012355 ## What it changes This is a much more accurate shader tracking percentage. It will tell you the "# of shaders in cache (%) Estimated time remaining". The percentage comes from a counting pass over the shader files, so it follows real work instead of file bytes and can't jump to 85% early. Start-up cost: the counting pass reads every shader file once more before the bar starts. It prints a line like 25291 containers in 50 files, counted in 3 s. The bar sits at 0% during that pass. This should only be a few seconds at most. (TESTED AND VERIFIED WAIT TIME NO LONGER THAN 5 SECONDS) <!-- What was wrong, and what this does about it. --> ## How it was tested Only tested in compiled build preloaders. Shader tracking worked well and smoothly progressed to 100% instead of jumping and hanging in areas due to most shaders bein in a single file. COMMENT WITH TEST DATA AND RESULTS ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] This PR's Depends on none <!-- Address review feedback in this PR. Open a new PR for follow-up work. --> ## Checked for overlap - [X] I searched the open pull requests for the same issue and for the files this touches.
The frame generation loading reserve already includes copies of title buffers. Apply both limits to the original target so the texture park reserves that room once and still protects future copies after the loading reserve settles.
DARNER_RAM_TRIM=soft made its list of ranges again as soon as the last one
was gone through. A list with nothing to take (no range, or only ranges of
classes that are shut or left alone) is gone through in the frame after it
was made, so the walk of the address space that makes a list (VirtualQuery
over some 240,000 regions in play, half a second) ran back to back: 20,589 ms
in 600 frames with 0 MB taken out (v2026.12.03.01, RTX 4050 Laptop 6 GB,
32 GB PC, frame generation on).

A list is now made again when it is a minute old, and sooner (five seconds
after it was made) only when it is gone through and gave something
(list_due). The same scene on f3840d7 with the change: 0 to 648 ms in 600
frames.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
With DARNER_NO_MIRROR=1 a copy no shader writes keeps no mirror: a refresh
only notes what goes up, and the send reads title memory. A page the copy
took before and the title wrote since reaches take() with known = true,
and DARNER_TAKE_BLOCKS (on) sent it to take_landed, which compares title
memory with the mirror 4 KiB at a time and sends only the blocks that
differ. The mirror let go holds what it held when it was let go (a file's
view, DARNER_CARD_CPU_FILE, on in darner.exe) or bytes no longer known
(private pages discarded, DARNER_CARD_CPU_HEAP), not what the card's side
holds: a block the title wrote back to those bytes was not sent, and the
card's side kept what an earlier send put there. The compare also wrote
title memory into the mirror let go, bringing its pages back.

take() looks at blocks (and at landings) only for a copy with its mirror;
take_landed returns to copy() for one without. Copies with their mirror,
and every copy without DARNER_NO_MIRROR, are taken as before.

Test: a_copy_without_its_mirror_is_not_compared_block_by_block.
The title waits at its start screen for A (Enter on the keyboard) before it loads
anything, so a start nobody sits at needs a scripted key (DARNER_KEYS, DARNER_KEYS_FILE)
timed by an outside driver. With DARNER_SKIP_START=1 the pad the title sees gets A for
0.2 s at the end of every 2 s, from the first poll until the world is first shown
(darner_gpu::world_since), and not while the F1 menu is open. Off unless set. The press
goes on the pad overlay, so it reaches the one pad, the first host pad or the keyboard's
stand-in alike. README row, a line in docs/troubleshooting.md, and the switch is one of
the player's own in darner-settings.txt.
refresh_tests::submission took one_submission's lock and then
watch::one_view_test's (the second since 6ecada3), while six tests of the
same module take one_view_test's first and one_submission's second. A test
that calls submission holding neither, beside one of those six, could hold
one lock each and wait for the other; every other test that takes either
lock then waited behind them and `cargo test` never ended.

submission takes one_view_test's first, as those tests do. Both are held
over the same lines as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Adapt the locally saved VIctory-NVIDIA follow-up from December 1, 2026 (6cf5ea7). Use the same process-wide switch when the staging cache creates and rebuilds a view.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (0571ced, f1559d7). Read the pending snapshot when Windows blocks its promotion and leave it in place for a later retry.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg

Co-authored-by: Stas Darevskiy <[email protected]>
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (a225614, cab8245). Keep the legacy factor for files with no F1 selection and apply explicit --set overrides after the saved choice.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg

Co-authored-by: t91a60 <[email protected]>
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (737d443). After cleanup and reporting, return the status already captured from the Darner process.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Apply the same precedence rule in the PowerShell entry point. Keep legacy-only factors and later -More overrides. Based on the tested suggestion in #233 (comment).

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg

Co-authored-by: superhero-520 <[email protected]>
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (060d3d3). Keep waiting for this launch's warm-up and F1 restarts while ignoring older processes using the same executable.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (7639c8c). Apply literal-path handling when checking the Darner binary and entering the checkout.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (e54151a). Read BOM-less UTF-8 first and keep the legacy shell-encoding fallback for invalid UTF-8.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt the launcher part of locally saved VIctory-NVIDIA work from December 1, 2026 (5e2874e). Include the PowerShell process ID, as the Rust launcher already does.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Keep the filename examples in sync with the process-specific launcher logs.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (f017360). Skip waiting on the GPU and notifying DLSS and FSR while the existing resize retry gate is closed.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (c9e0b97). Cache successful gray texture creation, retry failed creation at a bounded rate per kind, and keep already initialized textures recognizable.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (bcebf7d). Use the same early-screen condition to select the queue and to exempt a pipeline from the slow limit.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (b97f584). If starting the dedicated decoder fails, fill the affected voice when it is enabled or advances its read cursor.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (5329ffd). A failed warning write must leave logging on its existing fallback instead of panicking in initialization.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (a32c1da). A failed spawn did not take a sample. Restore the previous interval marker only if the failed spawn still owns that claim.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Blob::read returns Some(Blob::None) for an empty pending file. Preserve the original promotion error in that case so load_cache can use its read-only fallback to the valid primary. Reuse the held-reader setup to cover the empty-file regression reported at #232 (comment).

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg

Co-authored-by: akimfomin <[email protected]>
The first-start offer of auto-detect's picks reads its answer on a thread and
gives up after 20 s (85c11db9). The thread stayed in read_line, so the first
line typed for the next question of the same start (NVIDIA files, AMD files,
MFG Unlocker, "press Enter to close") went to it and was thrown away; the
download questions then took the next empty line as yes.

Every question in play.rs now asks one helper: a read given up on is kept, and
the next question takes its line instead of starting a second read. A line
typed before the next question was shown is dropped.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Since 412a0ec a queue with one out-of-order entry is rotated whole on every drain, holding the shard's lock. Keep entries by submission number instead: a drain visits only what it releases, and entries behind a later one are still released when they may be.

The DARNER_RETIRE_ORDER_DIAG sample counted entries hidden behind the head of a queue, which cannot happen now, so it and its tests are removed.
`gpu_owned::tests::concurrent_faults_on_same_block_serialize_single_readback` failed in
199 of 200 runs of its module, for two reasons.

It sets `TEST_READBACKS` to zero, lets eight threads fault on one trapped block and asserts
that the count is one. The count is one static for every trapped block, and
`veh_read_fault_and_partial_write_zero_clobber`, which traps two blocks and so makes two
readbacks, runs beside it on another test thread: the count was two or three
(`left: 3, right: 1`, "one readback for the block, not eight"; 192 of the 200 runs). Both
tests now hold one lock, `ONE_TRAP_TEST`, for their whole length.

And its stand-in handler gives the block its protection back before the bytes go in, as
`read_back` does, so a thread that came to the block between the two read it with no
fault and not the pattern (`left: 7, right: 8`, "all eight threads read the card's
bytes"; 7 of the 200 runs, and 18 of 200 with the lock alone). The test now holds the
handler's turn until all eight threads have faulted, which is what its name says it is
about, and asserts that they did.

300 of 300 runs of the module pass.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
`host::refresh_tests::unchanged_ranges_are_known` asks the write watch (`ask_once`,
`ask_once_end`) with `one_submission`'s lock alone. The tests of `watch::` that ask hold
`watch::one_view_test`'s lock and not that one, and the asking is one for the process, so
the two ended each other's: `watch::ask_holds::asking_kept_fast_path_guards_ask_ahead_and_done`
failed in 28 of 60 runs of `watch::`'s tests beside this one (20 of them at
`assert!(asked(p, p + 2 * PAGE).is_some())`), and this test failed with "view false:
taken" in one whole run of the crate's tests. It was the only test of the crate that asks
without that lock.

It now asks under `one_view_test`'s lock instead. Every test that holds
`one_submission`'s holds that one too while it asks (`submission` and the six tests that
take both), so they are kept out as before, and holding one lock this test takes no part
in the order of the two.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Have wake_decoder report whether it woke a worker. Both command paths already have the current XMA instance, so use that instance for the fallback after releasing the voice slot. This avoids taking another XMA read guard in the command path. Based on #248 (comment).

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg

Co-authored-by: Jesper-Andersson <[email protected]>
Apply the literal path rule to Streamline, FidelityFX and frame-generation launcher build lookups. Cover the normal SDK discovery paths identified at #240 (comment).

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg

Co-authored-by: Jesper-Andersson <[email protected]>
An empty pending snapshot does not supersede a populated primary. Keep reading the primary while another writer holds the cache lock and skip replacing it after the lock becomes available. Reported and isolated at #232 (comment).

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
check_for_update() ran in play::prepare before darner-settings.txt was read,
and looked only at the process environment. play passes the settings file's
switches to the title's process, not to itself, so DARNER_UPDATE_CHECK=0
written in the file (or given with --set) was ignored and the request went out.

The check now runs right after the settings file is read, and is off when
--set, the settings file or the environment says DARNER_UPDATE_CHECK=0, in
that order. Test: the_update_check_follows_the_settings_file_and_set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the runner start time for observer process selection and log creation time for summary selection. This keeps a still-running previous session from affecting the watcher and history described in #239 (comment).

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg

Co-authored-by: Jesper-Andersson <[email protected]>
Port the two PS5 DualSense behaviours from lobomfz/VIctory-xmem#367 into
Darner on top of DARNER_DS_TRIGGERS=1:

- crates/darner-loader/src/vehicle_notch.rs: wraps the vehicle trigger
  producer call site (0xd1_ab6a -> 0xd1_b510) and applies the PS5 notch
  profile for source 1937662562 (70% R2 pull detent, component 12/17 gear
  check, and +-0.1 throttle hysteresis).
- crates/darner-loader/src/ps5_rumble.rs: replaces the single-strength
  rumble emitter slot (0x619_4e18 -> 0x41c_5e30) with the PS5 build's
  motor curve forwarding to the two-motor emitter (0xc1_6170).
- crates/darner-hle/src/modules/gameinput/playstation.rs: installs both
  hooks inside install_hook() (only when DARNER_DS_TRIGGERS=1) and
  forwards the title pad pointer from apply_hook().

Asset policy checked: cargo xtask policy (557 files ok). No game assets included.
When two DARNER_THIN worker threads enter execute_tlas() for the same TLAS console VA within ~0.5 ms of each other, the first thread's local Arc<HostAs> raises Arc::strong_count(existing) from 1 to 2. alloc_or_reuse_as() treated strong_count > 1 as a shared copy, allocated a brand new unbuilt 4 MiB TLAS buffer, and immediately called descriptor::refresh_tlas_views() to point live shader-visible SRV descriptors at the uninitialized buffer while earlier frames were tracing it on the GPU — causing nvlddmkm Event 13 (SM Warp Exception: MMU Fault) and 0x887A0006.

Track execute_copy() aliasing explicitly via HostAs::copied (AtomicBool) and check !existing.copied for AsKind::Tlas in alloc_or_reuse_as() (with a double-check under the write lock), so concurrent worker threads reuse the same TLAS buffer in place and never expose an unbuilt TLAS to in-flight TraceRay shaders.
The test added with 7a2c516b calls VirtualAlloc in an unsafe block without a
SAFETY comment; every unsafe block has one (AGENTS.md). Comment only.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
69271db4 put load_hint between the first lines of load's doc comment and the
function, so they described load_hint and load kept only its last line.
Comment only.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
no_resizable_bar tested the adapter name for "RTX 20", which the workstation
card "NVIDIA RTX 2000 Ada Generation" contains too. With the card's memory not
mapped, its owner was told the card has no Resizable BAR and that there is
nothing to change, in place of the advice to turn it on in the BIOS. The
GeForce RTX 20 series is now matched as "GEFORCE RTX 20".

Co-Authored-By: Claude Fable 5.2 <[email protected]>
render_submit_begin took the frame id from queue::presented() + 1 when it was
called (c88549fc). The line (queue::behind, on with the relay and thin lists)
calls it when it runs a submission, which can be after the title has presented
that frame: frame N's last submissions then set the marker of frame N + 1,
before that frame's own simulation markers, and N + 1's first submission set
none. The other markers already carry the title's frame.

The frame is now read on the title's thread when the lists are submitted and
goes with the job (Lists, Run, Joined). The paths that run lists at once pass
the same value as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
When moving by copying, stage the cache on the destination volume and rename it into place after the copy completes. If a source file is locked, the old cache remains and the destination does not present a partial copy.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Each list of the F1 menu (the settings, IMPORT's saves, KEY BINDINGS,
AUTO-DETECT's changes) was centred on the line picked. Hovering picks the
row under the mouse, so with 9 rows shown the list slid away under it at
almost every move; hovering the tabs jumped the settings to their top, and
hovering a button to their end. The wheel stepped the line picked, round
the ends, rather than scrolling.

Now each list keeps where it was scrolled (another page starts at its top).
It moves only to show a line stepped to past its edge, by that line, or for
the wheel: by Windows' wheel lines (3 by default; a page for "one screen at
a time"), stopping at the ends, the line under the mouse picked after. A tab
or the Q or E box under the mouse is lit: a soft pill inside the dividers,
the name in the text colour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Supersedes PR #185 (by ItsYusei99, ported from lobomfz/VIctory-xmem#273) and
combines it with our R2 vehicle notch / PS5 rumble split port (a50d132):

- Merge PR #185: PS5 adaptive trigger decoding (ps5_trigger.rs), title light bar
  updates (TARGET 4), release-on-connect, and isolated PadHaptics WASAPI submix
  output on channels 3 and 4 (haptics.rs).
- Add Trigger::MultiVibration (effect kind 9) from lobomfz/VIctory-xmem#367.
- Auto-enable DARNER_DS_TRIGGERS and DARNER_DS_HAPTICS when a PlayStation
  controller is detected via playstation::present() (=0 disables either).
- Update README settings documentation.

Credits: ItsYusei99 (Darner PR #185), k-qno1 (lobomfz/VIctory-xmem#273, #367).
Asset policy checked: cargo xtask policy (559 files ok). No game assets included.
Each first touch of a landed page is also noted by the code's place (module
and offset, through readwatch::module_of): the title's places are logged the
first time each is seen, and the most frequent places, ours and other code's
apart, with the census on the frame-rate line. A touch inside vcruntime140's
memcpy/memset (leaves: the caller's return address is at the stack pointer)
is put on its caller, so the title's copies and ours are told apart.

Refs #287

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep the writer lease through inspection of the empty pending file and the read of the primary. Remove the empty scoped file once the writer owns the lease. Treat an empty legacy pending file as absent when choosing which library to read.

Review: #275 (comment)
https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
A drive root cannot be published by renaming a sibling directory. Reject roots and report destination preparation failures before making the staged copy. Check availability again before copying and retain the staging path only until the rename succeeds.

Review: #293 (comment)
https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Verify that the busy primary is returned and stays intact. The cache can keep its save destination once the empty pending file is cleaned up by #275.

#275
Adds the six missing // SAFETY: comments across darner-core, darner-loader and darner-shader tests, and enables clippy::undocumented_unsafe_blocks in darner-core and darner-loader while leaving darner-shader/src/lib.rs untouched so DARNER_TRANSLATOR does not change.
Routes Config::resolve's default directory lookup through its env closure, ignores empty system base-directory variables before falling back, checks and prints physical_pages_dir in darner config when set, and documents DARNER_HOME in darner.example.toml.
Port the registry type filter from VIctory-NVIDIA #4066. Accept REG_SZ in both Darner readers and retain the existing REG_MULTI_SZ parsing.

Co-authored-by: jebaczydow <[email protected]>
Factors the queue counters, writer loop, filter precedence and sync switch in darner-core::logging into unit-testable helpers without changing runtime behaviour, and adds six tests covering ordering, overflow drop reporting, disconnected receivers, bounded flush and DARNER_LOG/RUST_LOG/DARNER_LOG_SYNC parsing.
Extracts pure helpers for saved settings parsing, language selection, fallback lookup and placeholder formatting in darner-core::i18n, and adds six unit tests covering tag normalisation, override precedence, English fallback and placeholder/key invariants across bundled locale catalogs.
The 50 ms wall-clock limit could fail on a loaded machine even when the
rollback works. flush only waits while written < queued, so asserting
that both counters are equal checks the same thing without timing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open pull requests that add catalogs or i18n helpers (#154, #196, #217)
insert next to lookup. With lookup_in after text instead of before
lookup, they merge without a conflict.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XMemMapPhysicalPagesScatter maps one page per address through
XMemMapPhysicalPages, so each page's unmap walked every ray tracing table
(hwrt::title_memory_freed). In a load with hardware RT, the title's
streaming thread spent about a third of its CPU time there (xperf, RTX 4080).
The call now runs inside darner_gpu::title_memory_freed_gathered, as
map_aliases does since #92: the ranges leave the tables once, before the
call returns to the title. DARNER_HW_RT_FREED_GATHERED=0 restores the walk
per page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Trigger mouse actions on release over the original target, allowing clicks to
be cancelled by releasing elsewhere. Show a subtle pressed tint while the left
button is held, and preserve the distinction between page tabs and Q/E
navigation targets.
The bit reader is checked against a bit-by-bit reader for every width from
0 to 32 bits at every position up to a byte past the data (the 8-byte path,
the tail path and zeros past the end), with overread set exactly when a
read passes the end. Signed reads, ff_wma_get_large_val's four prefixes,
log2 and to_i16's rounding, clamping and NaN are pinned too. Tests only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With DARNER_RANGE_LOCK=1 the thread that lands flights no longer waits for
every mapping call of the title's while it puts a texture read-back into
title memory, only for those touching the texture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With DARNER_CARD_CPU_FILE=1 the CPU mirrors are temporary files in the
cache's cpu-mirrors folder, made without a look at the drive's free space.
They grow all through a session (994 -> 3,385 MiB in one) and took a full
system drive's last bytes: 7 of 8 host pipeline library saves failed with
os error 112 and minutes of the log were lost, while no mirror file failed.

MappedStorage::new now refuses a file that would leave less than 4 GiB
free (io::ErrorKind::StorageFull); the callers' existing fallback keeps
that mirror in private memory. This crate's unit tests keep no room.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`bounded_root_srvs()` took the variable's presence as "go back to root
descriptors", so `DARNER_ROOT_SRV_DIRECT=0` (typed to be explicit, or left
from comparing two runs) chose the unbounded path whose reads past a
buffer's end removed the device (upstream PR #493). It is read through
`crate::switch::on` now: on when set and not `0`, as the README's
"1 = on" row says. Unset and `1` are as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
`plain()` is off under `cfg!(test)`, so every test in slots.rs ran the
opt-in bitmap allocator (`DARNER_SLOTS_BITMAP=1`) and none reached
`plain_alloc` or `plain_release`, which are the default. The new test
runs the plain scan against the file's reference allocator: the same
slots, free count, cursor and occupancy over 4,000 random steps at six
sizes. Test only.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Cache::prune kept every .tmp-* file, so one left by a run that stopped
between writing and renaming stayed for good. They now go by the same
max_age as entries: the shortest age in use (DARNER_SHADER_CACHE_DAYS=1)
is a day, and a write takes far less, so a fresh staging file still being
written stays. The prune test now covers both.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Both were read with .is_some(), so DARNER_STRICT_JOINS=0, typed to turn
it off, turned it on: about 40 shaders stop drawing, and as both names
are in the shader cache key, every shader is translated again. The README
documents both as "1 = on", which is what they now read.

This is a translator change, so it re-keys every user's shader cache once.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
install read the 1.0.2.1 prologue at base + 0xe4e3d0 for every title,
before any setting was checked, and went on to hook it whatever it found.
With a title or build whose image is smaller, that read lands past the
image's end. bytes() now returns nothing past SizeOfImage, which darner-hle
already reads from the mapped headers (runtime::image_size), and install
stops before any hook when the prologue is not the known build's.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The F1 help and the README row said "on by default, not on RTX 30
cards" beside a menu row that shows OFF, and port.rs said "off by
default" above code that is on when unset. Both halves are described as
they are: unset, the card side is on (except on Ampere cards) but xmem
takes unset as off and does not arrange the heap, so nothing is placed.
`port_constants_on`'s doc said xmem asks it; nothing calls it. The
frame-rate line no longer prints "=1" when the variable is unset. No
behaviour changes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
After a question was given up on, the line its read got before the next
question was shown was dropped. Lines typed after that one stayed in the
console's input, and the next question read the first of them as its answer;
an empty one is a yes for the download questions. The read that follows a
dropped line now clears the console's input first.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Each EXCEPTIONS entry now lists the checks it waives (file type, size,
magic, NUL bytes, hex/base64 runs, runs of \x/0x literals). Every other
check still runs on that file, so a PE header pasted into host.rs, or a
base64 blob in frame_users.rs, is refused like anywhere else. The current
tree passes unchanged: each entry waives what it trips today.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The comment it copied says every test that reads DARNER_THREAD_TICKET holds
ONE_AT_A_TIME, which is not true: folded_tests'
two_dimensional_groups_of_several_host_waves_give_every_console_thread_once
reaches ticket_on() without the lock. This pull request should not repeat that
claim; the race itself is left to a change of its own. The comment on set_var
above is main's and stays as it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`parse_tls` checked that the callback *array* lies inside a section but
took every entry in it as a callback address: `va_to_rva` proves only
that the VA is at or above the preferred base, so `ImageBase +
0x4000_0000` was accepted. The loader turns each RVA into a function
address and calls it from `spawn_main` before the entry point, so that
entry ran code 1 GiB above the module.

`parse_imports` already bounds the same kind of untrusted pointer: an
IAT slot is refused unless rva + 8 <= SizeOfImage (`entries`).
`parse_tls` now takes `SizeOfImage` and refuses a callback unless
rva + 1 <= SizeOfImage. That is the same check stopping one step short,
not a deliberate trust of header fields.

The test builds a synthetic PE32+ image with a TLS directory; it fails
on main and passes here. The title image still parses (both callbacks
kept) and still binds with no missing imports.
`write_sites::apply` takes a file name and a hexadecimal offset from a
text file (`DARNER_WRITE_SITES=<file>`) and bounds it with a plain
`offset + 16 > size`. `usize::from_str_radix` accepts any `usize`, so an
offset in `usize::MAX - 15 ..= usize::MAX` overflows that addition: in
the release profiles (release, diag and fast, which inherit it) it wraps
to 15, passes the guard, and `base + offset` wraps to `base - 1`; the
sixteen bytes read there are below the image's first page and the SAFETY
comment on that read ("sixteen bytes inside the image") no longer holds.
In the dev profile the guard itself panics.

`heap_sites` bounds its own site the way this now does, with
`checked_add`, so this is a missed hardening rather than a choice.

The test writes a list naming the image at `usize::MAX` and
`usize::MAX - 7`; it panics on main ("attempt to add with overflow") and
passes here.
`longest_encoded_run` split the file at every byte outside the base64
alphabet and took the longest fragment, so a payload the encoder wrapped
had no fragment longer than its line: GNU `base64` and Python's
`encodebytes` wrap at 76 columns and `openssl base64` at 64, all far
under `MAX_ENCODED_RUN` (512). Any wrapped dump written to an allowed
file type passed the check, and this check is the static half of the
rule that nothing from the game is ever committed.

Lines are now joined back when every line of the group is wholly payload
and at least as wide as an encoder's line, so a wrapped payload counts as
one run while wrapped prose and single-character lines stay prose.

The test wraps 4096 synthetic characters at 76 columns: it passes the
check on main and is caught here. `repository_passes_policy` still passes
over the tree (555 files), so nothing in it trips the new rule.
`darner translate` compared every emitted shader's label with the literal
"02384a60fda6f2d0" and, for that one shader only, printed the LDS-defrag
counters to stderr. That is session-local debugging left in a shipped
tool: it pays a `label()` string and a `contains` for every emitted
shader, writes an undocumented line no switch asks for, and hard-codes
an id taken from the title's own build in a generic translator. The same
counters are already logged through `tracing` by the GPU path, behind the
`diagnostics` feature, and `DARNER_SHADER_CENSUS` is the supported way to
ask for them.

The block is deleted; `label()` is still used by the lines around it.
The environment values are filtered so that empty means unset, and so is
`physical_pages_dir` from the file, but the other file fields are not:
`[paths] cache_dir = ''` became `PathBuf::from("")`. That is not "the
default": `subdir`/`checked_dir` join onto it, and `Path::new("").join("shaders")`
is the relative path `shaders`, so every cache write landed in whatever
folder darner was started from instead of under `%LOCALAPPDATA%\darner`
(it was reproduced with `darner config` and `darner translate --warm` in
a scratch folder). The same held for `data_dir`, `game_dir` and an empty
entry of `test_titles`.

All the file paths are now filtered the way the environment and
`physical_pages_dir` already were. A path that is not empty behaves as
before.
two_dimensional_groups_of_several_host_waves_give_every_console_thread_once
lowers a wave32 program in a 32 x 2 group at host width 32, which reaches
ticket_on() and so reads DARNER_THREAD_TICKET. A wave64 test sets that
variable to "0" for a while, holding ONE_AT_A_TIME; this test read it
without the lock, so it could be lowered without the thread ticket. The
lock is held only around lower(): run() takes it itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
No test passed `TextureDesc.mips = 0` to `Texture::new`, though that is
the D3D12 default ("the whole chain") and the branch that derives the
count from the largest side is what every such allocation takes its
offsets and its size from: `32 - largest.leading_zeros()` at
`texture.rs:1618`. An off-by-one there changes the mip count, and so the
size, of every texture described that way, and dropping the `.max(depth3d)`
gives a 40-deep volume five mips instead of six. Both terms were pinned
only by the comment beside them.

The test asks for 64x16 and 16x64 flat textures (seven mips, so the
height counts as a side) and a 16x16x64 volume (seven, against the five
its face alone would give), and checks that a description naming one mip
still gets one. Pure function: no GPU, no title, no fixture.
Use crate::runtime::image_size(base) instead of the hardcoded 1.0.2.1
IMAGE_MAX constant in haptics::install(), playstation::install_hook(),
vehicle_notch::install(), and ps5_rumble::install(), and bounds-check
APPLY_SLOT_RVA + size_of::<usize>() against it before reading the slot.
IMAGE_MAX stays scoped to capture() pointer validation.

Addresses review feedback from iBooM72 on PR #276.
Asset policy checked: cargo xtask policy (559 files ok).
The row had two values, not set shown as OFF and `1` as ON. Not set is
not off: the card side still looks for the heap (except on RTX 30
cards), and the menu could not write `0`, the one value both halves
read as off. The row is AUTO (not set), OFF (`0`), ON (`1`) now, with a
test. The help and the README rows say that AUTO places nothing, because
the heap is not arranged for it without ON.

Menu fix by the gpu-dig session; text by this one.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The #189 log shows the native mouse capture released for 5.17 s in play
with the window focused and in_menu=true, but in_menu is one boolean for
eleven conditions. menu_or_paused_cause returns the first one that holds,
in the same order and with the same reads, and the "native mouse capture
changes" line logs it as menu_cause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`GetModuleFileNameA` wrote the UTF-8 bytes of a Rust `String` into the
title's buffer, and `__p___argv` built every element with
`CString::new(&str)`, which is UTF-8 too. A-suffix APIs exchange the ANSI
code page: `GetCommandLineA`, six hundred lines below, already encodes
with `host::ansi`, and `files::narrow` decodes every path the title hands
back as `CP_ACP`.

So one path with a non-ASCII character made our own APIs disagree: for
`C:\Spiele\Zoë\game.exe`, `GetModuleFileNameA` wrote `Zoë` as `C3 AB` and
reported 23 where `GetModuleFileNameW` reported 22, and a title that took
its directory from there and opened a file under it handed us bytes its
own code page never produced, so the file was not found. `__p___argv`
contradicted `GetCommandLineA` for the same argument, which the doc above
`GetCommandLineA` says must match.

Both now encode through `host::ansi`. `XLaunchNewGame`, whose path comes
from `GetModuleFileNameA` by its own documentation, decodes the same way
instead of reading UTF-8.
The member loop of `ImportLibrary::parse` kept whatever `object`'s
short-format import reader returned and never read the header's machine
field, so a member from `um\x86` or `um\arm64` parsed as if it were the
console's export map: its `_ExitProcess@4` landed beside the real
`ExitProcess` of the same DLL, with nothing to tell them apart.

`image.rs` refuses a foreign machine for a PE image; this is the one
reader in the crate that did not. A member whose architecture is not
x86-64 now fails the library with `PeError::Unsupported`, the same
variant and the same shape of message the image path uses.

The test builds the existing synthetic archive with one AMD64 member and
one whose machine field is `IMAGE_FILE_MACHINE_I386`; on main the I386
member is merged, here it is refused.
The switch was parsed into an `Option<Vec<String>>` whose `Some` survived an
empty value, so `DARNER_SHADER_ONLY=` (or " " or ",") matched no container at
all: the scan skipped every container before `Container::parse` and the run
printed "containers found 0" with the "shaders may sit in compressed or
encrypted archives" hint — a false negative for a directory full of shaders.
An empty environment value means unset here as it does for the paths in
darner-core's config (`config.rs:100`, `empty_env_values_are_ignored`) and for
`DARNER_TRANSLATE_ONLY`, which only applies a non-empty list (translate.rs:661).
Parse the value in `only_hashes`, which returns `None` when the variable names
no hash, and pin it with a unit test: unset, "", " , " all now scan every
container, while a real hash still selects.
`unmap` computed the end of the range it is given as `base + len`, and
both numbers are the title's own: `XMemMapPhysicalPages` passes the
address and the page count of its own call, and the page-mapping copies
pass their destination and length. A range at the top of the address
space wraps that sum, and the view search that follows —
`BTreeMap::range(base + 1..end)` — then panics on a range whose start is
above its end. The panic is thrown out of `extern "system" fn
XMemMapPhysicalPages`, which aborts the process instead of unwinding. The
comment above the search says the author knew `BTreeMap` panics on this
shape, but the guard that followed only covered `len == 0`.

`map_pages` now bounds the page count times the page and that sum with
`checked_mul` and `checked_add` before anything is touched, and returns
the null it returns for an unknown page, with a warning saying why, so
the title sees a failed call rather than the process dying. `unmap`
bounds its own sum as well, so no other caller — the page-mapping copies
included — can hand `BTreeMap::range` a backwards range.

The test asks for a page at the last page of the address space. With the
old sum it aborts the test binary (`attempt to add with overflow`, then a
non-unwinding panic and `STATUS_STACK_BUFFER_OVERRUN`); with the bound it
returns null and the call is refused.
Off by default and keyed in the shader cache. A mesh program whose
thread 0 requests the group's outputs (s_sendmsg GS_ALLOC_REQ) ahead of a
barrier every thread passes once declares the counts it requested after
that barrier, not the declared maxima at its start; primitives are culled
up front only where the request's own path exported one (the empty or
oversized meshlet's culled primitive), so each primitive is written once.
Programs without such a request keep the maxima.

Why: the Arc A770 lost the device (a page fault in the driver's memory)
in MS_VS_LinearDepthPreSkin's indirect mesh draws (824dc1956e7e38b6), at
the first step outside a building in two runs of two. Skipping those
draws, and exact counts, each got past it; with exact counts, six times
through that door and a walk among people.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console-side OMSetRenderTargets took the title's count as a length: the
one-range form sized a heap vector with it (`collect()`, so a count of
u32::MAX asked for 32 GB, and a refused allocation aborts the process rather
than panicking), and on either form the count reached `State::set_targets`,
where `BoundTargets::restore` binds one view per handle. D3D12 takes at most
D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT (8) render targets: the debug layer
refuses a command naming more, the host list then fails its `Close`, and
`Host::close`'s recovery ends the run.

Eight is what this file already knows: `thin::targets` clamps the same
argument with `(count as usize).min(8)`, and `BoundTargets::restore` binds at
most eight. Take the count as at most `RENDER_TARGETS` (8) before the handles
are built, in a helper (`target_handles`) that both forms go through, so
neither can size an allocation past 8 handles or name more than eight views.
The excess is refused as `thin::targets` refuses it, silently, keeping the
first eight.

render_target_counts_past_eight_take_the_first_eight pins the bookkeeping:
the eight views that follow the first on the one-range form from a count of
nine, the first eight of the title's own array, the first eight from a count
of u32::MAX, and nothing for a null array.
A D3D12_RESOURCE_DESC's DepthOrArraySize is a depth for a TEXTURE3D and an
array size for a TEXTURE2D, so a 64x64x64 volume and a 64-layer 64x64 array
of the same format and mip count produced one key: the read-back cache handed
one shape's GetCopyableFootprints list, and therefore one shape's read-back
buffer size, to the other.

Both users of that list trust it. record_texture recorded the wrong number of
copies, with SubresourceIndex values the texture does not have, and land
paired footprint i with (i % mips, i / mips) of a layout whose slices is 1 for
a 3D texture, so Layout::tile returned Invalid and nothing landed: the title
kept reading whatever the read-back was supposed to replace.

Put the dimension and the sample count (also passed to the call) into
FootprintKey through a pure footprint_key(), and move the count into
subresource_count() so it can be pinned without a device. The new test builds
the 2D-array and 3D descriptions, checks their subresource counts are 64 and
1, and checks the two keys differ; with the old five-field tuple it fails on
exactly that assertion. No adapter is needed.
The 600-frame report tells, for the largest objects of each of the nine kinds
it lists, how many frames ago one was last used; but the frame a use is
recorded in was only ever fed for the four texture kinds, whose two sites call
`touch` from resource.rs. So the buffer of indirect arguments a list keeps
from recording to recording (indirect_scratch, batch_place), the list's card
budget for the clamp's notes, the "before" hashes a submission's compare reads
and the buffer a twin is copied through all kept the frame they were made in,
and were printed as unused since it. Their bytes went into the report's 60+ /
600+ columns, which exist to tell what may be moved off the card: the run
named the buffers in use every frame as the ones to move.

Tell the ledger of those uses at the site of each: the reused indirect
arguments, each batch's buffer and the card budget in host.rs; the compare's
hashes through shadow::card_before_used; the twin's buffer in
record_twin_copy. Two kinds need no new call: the retag that gives a pooled
buffer its kind already records the frame (the take that hands a Kind::Scratch
out, the frame a Kind::AheadStore buffer is set aside in, which is as long as
it has gone unused). The swap chain has no use site to point at: its entry
stands for the back buffers of the chain the presents show, no one place tells
the ledger of a present, and it hangs on no object of ours. The report says
"unused n/a" for it and leaves it out of the sums, rather than print the age
since it was made as if it had been idle all along.

The frame a use is recorded in is one function now, entry_used, which touch
calls. The new test builds one entry of every listed kind by hand (no device,
no title) and pins both halves: a kind with no use site is not told as idle,
and entry_used moves the frame a use is told in.
Windows 10's D3D12Core sets a list's table pointer on Close and back on Reset. Each shim now links to the one made for the object's other table, so the switch reuses two shims instead of leaking a new one (and taking MADE and VirtualQuery) on every Close and Reset.
`s_cmp_eq_u64`/`s_cmp_lg_u64` compare two lane masks, so their SCC is a
per-lane property, not a uniform one: equality sets it when every lane's
two bits are equal, inequality when some lane's differ, and
`s_cbranch_scc1`/`scc0` take the branch where it is set or clear. Every
other `s_cmp_*` in the suite compares numbers, so this per-lane SCC and
its exclusion from the uniform `scc_some` set were only ever reached by a
title program: a lane that took the wrong way would run exactly the region
the console skips, silently and in the wrong direction.

The test builds the four combinations (`eq`/`lg` by `scc1`/`scc0`) from
hand-written instructions and checks that the branch's condition is the
lanes' own two bits — two per-lane atoms in its support — rather than a
uniform value or an unknown. No GPU, no title, no fixture.
#315 makes `default_dir` read the environment through the injected closure
instead of the process's environment, so a test that resolves with
`|_| None` cannot find a user directory once both changes are in: together
they failed `an_empty_path_in_the_file_means_unset` with "cannot determine
a user directory; set DARNER_CACHE_DIR and DARNER_DATA_DIR".

The test now answers LOCALAPPDATA, XDG_CACHE_HOME and HOME through the
closure. That changes nothing while `default_dir` reads the process's
environment (it ignores the closure), and keeps the test about the empty
path once it does not, so whichever of the two lands second needs only the
three-line `default_dir("cache", &env)` conflict resolution.
Shadow::take checks mirrorless() at the top, beside direct_paged(), so neither the
changes_only / send_changed() branch nor the else branch compares with a mirror that
was let go (keep_stores() sets changes_only before revive_mirror() makes the mirror
again). take_quiet checks it too. New test: a mirrorless copy with changes_only set.
In-place refits of BLASes placed in reused units of the shared BLAS
heaps page-faulted on an RX 7900 XTX ("device hung", 0x887A0006) at the
barrier after a wave of refits, at addresses just over 32 GiB away from
any live allocation (the GPU followed a garbage 32-bit node pointer).
Committed BLAS buffers, and heap units never reused, did not fault, and
delaying the reuse of units did not help. BLASes built with ALLOW_UPDATE
now take committed buffers; the rest stay in the heaps.
DARNER_HW_RT_REFIT_COMMITTED=0 places them as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The map of acceleration structures holds an entry from when its build
is recorded. Lists are recorded on several threads and submitted in the
title's order, so a refit could name a source whose build had not been
submitted (or never was) and read whatever its memory held. Such a
request is now built anew. DARNER_HW_RT_REFIT_BUILT=0: as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title takes its display size (window, host output, its two UI targets,
the output its upscaler is made for) from the mode of its own list nearest
to the output setting. The list is four 16:9 sizes and the SDR mode
(3840x2160), so a 3440x1440 output got 2560x1440 (and 5120x1440 got
3840x2160). The output setting reaches the title later, without a new
display size notice when the height is the same, so the scene followed
3440x1440 while everything made at start stayed 2560x1440: blocks of stale
picture, see-through characters, an edge at 2560/3440 of the width (#3246,
(+0x56a2afd at start).

An output the title does not list is now written into the SDR mode entry
(and reported through DARNER_DISPLAY_MODE), the UI pool holds two
output-sized targets, and the host's frontend viewport fix-up looks for the
output's size (DARNER_NATIVE_OUTPUT) instead of 2560x1440. 16:9 is
unchanged (stock mode, 94 MiB pool, same cave).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Series X's 1440p picture takes the chosen shape: 2560x1440, 2304x1440, 3440x1440 or 1920x1440. The window, UI targets and upscaler follow it (the native output change before this). DARNER_NATIVE_SIZE still wins; empty keeps 16:9 or DARNER_NATIVE_WIDE as before. Hidden for Series S.
Over the whole of a 2304x1440 or 1920x1440 picture its right side ran off the screen (the button prompts at the bottom right).
The output path already takes 5120x1440 (its UI pool and display mode are sized for it). Asked for in #110 and #119.
At 21:9 or 32:9 the map, pause menu and briefs are a 16:9 panel with the world sharp on both sides and a hard edge where the panel ends. When the interface plane is opaque along its free edges (a full-screen menu; the HUD is clear there), the composer shows the scene beside it through a 64-tap disc blur (1.5% of the width), at 40% brightness, and fades the panel's free edges into it over 0.75% of the width. Top and bottom on 16:10 and 4:3. DARNER_MENU_SIDES=0 turns it off.
- DARNER_ASPECT left from Series X is dropped on Series S (play.rs settings and run.rs), and a safe start leaves it out: its UI targets would be wider than the Series S UI pool.
- DARNER_RENDER_1080P draws 1080 lines at the output's shape (2580x1080 at 21:9, 1440x1080 at 4:3): the scale is by height, not 1920 / width.
- DARNER_MENU_SIDES only where the interface is centred at its own shape (overlay_centered), as the bar clearing.
- No centred UI target for frame generation with HDR, where Streamline is given no UI plane.
covered_scene_row sampled 0.5% and 99.5% of the output's height and cleared within 16% of it; in a taller output those fall outside the centred interface, so the bars stayed. Both are now relative to the interface. With a regression test that a fully opaque black fade stays.

Patch and test by akimfomin (PR #143 review, pr-143-tall-cinema-bars.patch), applied on the rebase with the root constants moved for EXPOSURE.
A `darner preload <game folder> --all` that finished left no warmed mark, so
the next `darner play` of the same darner.exe ran the whole preload again
(30.6 min here, right after the script's own preload). `darner preload` now
writes the mark the preload window writes, when it warmed every known
pipeline of the whole title and the cache is not a named DARNER_CACHE_DIR.

The mark is the one the next start waits for: `done_mark`, which `prepare`
uses too, so with DARNER_WARM_SHARED=1 it is the shared mark. The whole
title is no folder given, or folders that hold the game's executable or are
the configured game_dir; a subfolder writes no mark.

Refs #128

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DnqmuVZnMPVji1pieTnKH3
Recognise the documented non-hundred DDR4 XMP rates 3333 and 3733 MT/s in Corsair (CM...G...3333C16...) and G.Skill (F4-3733C17...) part-number rate fields inside part_speed, so slow_sticks still reports an XMP-off shortfall when SMBIOS reports only the 2133 MT/s SPD default.

Guarded by vendor prefix, rate allowlist, and 2-digit CAS marker so unrelated OEM or numeric SKU digits continue to return None, leaving existing generic/OEM parsing, rate bounds, and the 200 MT/s slack unchanged.
Replace the generic <digit>G prefix heuristic in ddr4_vendor_rate with an ASCII-byte GX4M prefix check so DDR5-shaped Corsair part numbers such as CMK16GX5M2B3333C16 are rejected, and add the GX5 negative case to the regression test.
Series X, 3440x1440 with DLSS off stopped at the title's out-of-memory break (+0x2219650) a few seconds into the start, and with only the heap bigger at the scene pool's int3 (+0x2473e88). Measured on the retail build, RTX 4090, world loaded: 21:9 ran with 2,600/1,000 MB and 3,000/1,000, stopped with 3,000/850; 32:9 stopped with 4,500/1,400 and 6,000/1,600, ran with 8,000/1,600 (the 4K DLAA sizes). Given 3,200/1,100 and 8,000/1,600 unless DARNER_RT_HEAP_MB or DARNER_SCENE_POOL_MB is set. With DLSS (a smaller scene) nothing changes.
quad_read_guarded kept a quad neighbour's value only when waveActiveBallot named
that lane. The ballot leaves helper lanes out, while the console's whole-quad mode
has them in EXEC, so a helper source fell back to this lane's own value. In the
water (capture 44, DrawInstanced 5178, PSO 378) that made a normal from a zero
cross product: rsqrt(0) * 0 = NaN along every tile's diagonal.

A helper source now counts as present, told by a quad read of its own
isHelperLane. DARNER_QUAD_HELPERS=0 keeps the ballot only. The switch is read by
the translator, so it is in the shader cache key (KEYED 60 -> 61).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Six switches, all off by default (DARNER_NO_VIGNETTE, DARNER_NO_AIM_VIGNETTE,
DARNER_NO_SCREEN_GRADIENT, DARNER_NO_SCREEN_OVERLAY, DARNER_NO_LENS_FLARE,
DARNER_NO_DOF), ported from VIda, each with a row on a new F1 page.
The shader ones patch the PostFX programs before translation and key the
stripped programs on their own; the other two patch the 1.0.2.1 executable
and leave any other build alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The launcher was renamed from play-nvidia.ps1 to build-darner.ps1 on main; the
literal-path changes are carried over to it.
With andrewpozdnakov7-jpg's follow-ups d2d7e3e (unused hover target) and
30d2e05 (press targets scoped to their lists).
Merged after #328: the mouse press/release targets of #328 kept, with #297's
lists that stay put under the mouse, wheel scrolling and lit tabs.
`made_at` began at 0 and `coarse_ms` counts from the process's start, so
`list_due` held the first list back until 60 s after the start, where `main`
made it in the first slice (review of #225). `made_at` is now `None` until a
list is made, and a list is due at once then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
It took the lock only inside `look`, so the test's own writes between the
askings, and its last `nothing_new`, ran outside it, unlike the other tests
of `refresh_tests` that take it (review of #262). Another test's asking could
take one of those writes before this test asks for it. The lock is taken once
at the start now; it is not taken again on the thread that holds it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This is a much more accurate shader tracking percentage. It will tell you the "# of shaders in cache (%) Estimated time remaining".
The percentage comes from a counting pass over the shader files, so it follows real work instead of file bytes and can't jump to 85% early.
Start-up cost: the counting pass reads every shader file once more before the bar starts. It prints a line like 25291 containers in 50 files, counted in 3 s. The bar sits at 0% during that pass.
this should only be a few seconds at most
tragice changed target branch from Test to main 2026-12-05 07:34:37 +00:00
Author
First-time contributor

Here are 2 snapshots of the loader, 1 shows a preload from a cleared cache, the other is a preload after already cached.
Reaches 100% and tracks accurately across all 3 build versions across multiple tests.

Untouched risky preload-window output, this is now a small issue as in example screenshot.
The loader will always be at 0% and main text does not output the command lines properly.

Testing

cargo test --workspace --locked
result there is a long stall just after
test emit::valu_tests::cost_checks::the_median_of_a_value_and_two_constants_is_a_clamp ... ok

There is a weird section towards the end it has a few different iterations of the following code.
Doc-tests darner_shader
warning: --logfile is deprecated
running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

RESULTS NO FAILURES test.txt can be viewed

Here are 2 snapshots of the loader, 1 shows a preload from a cleared cache, the other is a preload after already cached. Reaches 100% and tracks accurately across all 3 build versions across multiple tests. Untouched risky preload-window output, this is now a small issue as in example screenshot. The loader will always be at 0% and main text does not output the command lines properly. Testing cargo test --workspace --locked result there is a long stall just after test emit::valu_tests::cost_checks::the_median_of_a_value_and_two_constants_is_a_clamp ... ok There is a weird section towards the end it has a few different iterations of the following code. Doc-tests darner_shader warning: `--logfile` is deprecated running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s RESULTS NO FAILURES test.txt can be viewed
tragice changed title from WIP [PR-fix][Preload] Shader tracking accuracy to [PR-fix][Preload] Shader tracking accuracy 2026-12-05 09:51:39 +00:00
TrustNo1 changed title from [PR-fix][Preload] Shader tracking accuracy to Shader tracking accuracy 2026-12-06 03:27:41 +00:00
Owner

Test needed — commit c298b234; what to check:

This is a much more accurate shader tracking percentage. It will tell you the "# of shaders in cache (%) Estimated time remaining".

The percentage comes from a counting pass over the shader files, so it follows real work instead of file bytes and can't jump to 85% early.

Start-up cost: the counting pass reads every shader file once more before the bar starts. It prints a line like 25291 containers in 50 files, counted in 3 s. The bar sits at 0% during that pass.
This should only be a few seconds at most. (TESTED AND VERIFIED WAIT TIME NO LONGER THAN 5 SECONDS)

Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.

Reply testing to take this run; it's free again after 24 h with no results.

**Test needed** — commit `c298b234`; what to check: This is a much more accurate shader tracking percentage. It will tell you the "# of shaders in cache (%) Estimated time remaining". The percentage comes from a counting pass over the shader files, so it follows real work instead of file bytes and can't jump to 85% early. Start-up cost: the counting pass reads every shader file once more before the bar starts. It prints a line like 25291 containers in 50 files, counted in 3 s. The bar sits at 0% during that pass. This should only be a few seconds at most. (TESTED AND VERIFIED WAIT TIME NO LONGER THAN 5 SECONDS) Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture. Reply `testing` to take this run; it's free again after 24 h with no results.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'main:tragice-main'
git switch 'tragice-main'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'tragice-main'
git switch 'tragice-main'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'tragice-main'
git switch 'tragice-main'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'tragice-main'
git switch 'Main'
git merge --squash 'tragice-main'
git switch 'Main'
git merge --ff-only 'tragice-main'
git switch 'Main'
git merge 'tragice-main'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!527
No description provided.