WIP: Preload window mark by exe path, translator, card and driver (DARNER_PRELOAD_MARK_BY_PATH, off by default) #451
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!451
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:up-preload-marks-pathfree-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #128 (stage 4 of the plan in that issue; not a full fix)
Contributor role (optional)
What it changes
darner.exe(mark_pathinplay.rs), but the driver's pipeline cache follows the exe path. The two disagree in two cases:darner.exeover the old one): the driver's cache, the done marks, the shaders and the library are all still there, but the bytes changed, so the window opens and runs the whole preload again.Evidence that the cache follows the path:
D3DSCachecache has a small database with anapp_idtable that holds the exe path. On NVIDIA 621.40 we counted 133 folders with 130 different paths, one path per folder (counted once, on our PC). Three system programs have two folders each (after updates), so the key may hold more than the path. Fordarner, the path decided it in our data.darner.exe(the same SHA-256) in three different folders got three separate cache folders, each 1.0 to 1.8 GB. The second copy's preload was as slow as a cold one (step 2 782 s, step 3 813 s), so NVIDIA's sharedDXCachedid not answer for the new path either (one run, on our PC).darnerorvictoryexes rebuilt at the same path, after their folder was created, each still have exactly one folder: new bytes at the same path keep the folder (counted once, on our PC).warm.rs:186-190("The driver keeps what is made here by program path and card"); TrustNo1's review of #153 (comment 858094: a new exe skips the whole preload, "so the driver's cache for its path is built during play"); and blazecoding2009's laptop in #128 (comment 852854): a new release at the same exe path with an unchanged translator finished the window in about 80 s with every mark reused, while a diagnostics build of the same commit in another folder made all 76,725 pipelines again (one PC, not like for like).What it does not change. A path-free "done" mark is not right for the warm-done marks, which exist to fill the driver's cache for the exe that will play: their path in the key (
warm.rs:203) is correct and stays. #153's shared mark stays an opt-in trade that TrustNo1 reviewed and accepted. This PR does not move #153.The change. New switch
DARNER_PRELOAD_MARK_BY_PATH=1, off by default. With it on, the window mark and the preload mark are bothwarmed/path-<first 16 hex of blake3("program-path", translator id, 0, card, 0, driver, lowercased exe path)>.DARNER_WARM_SHARED=1wins when both are on (the user asked for path-free).main+ #153 behaviour, unchanged.needs_pipelines(an empty library opens the window) is unchanged.Caveat (the same as #153, accepted there): a change outside
crates/darner-shaderthat changes pipeline names (the pipeline state code indarner-gpu) is not in the translator id. Such a build at the same path skips the window and builds the changed pipelines in the game. Possible hitches; not measured.Known follow-up: #435 (Skanzinho) lets
darner preloadwrite the byte-hash mark (record_preload). WithDARNER_PRELOAD_MARK_BY_PATH=1the play start looks for the path mark, so a command-line preload under #435 would still open the window. This PR puts the choice in two helpers:content_mark(shared or path mark from the settings) andpreload_mark_for(that, else the mark by bytes), whichprepareuses for both the window's mark and the preload's. #435'srecord_preload()takes no settings today, so it would have to read the start's settings, callcontent_mark, and pass the result topreload_mark_for(aspreparedoes) to write the same mark the window waits for.Not in this PR: compacting
warm-done.txt(TrustNo1's first point on #264) was raised in #264 (merged); it is for a separate follow-up PR, not this one.Files:
apps/darner/src/play.rs(path_marks,path_mark,path_mark_in,content_mark,preload_mark_for, the choice inprepare, 4 tests),README.md(a switch row),docs/findings.md(an entry).One commit on
main(47d21cd3b), which has #153 and #215:git diff --stat trustno1/main...HEADis 3 files.mainhas since moved tod91d8e4d6(the F2 RAM-speed note; other files). The branch was not rebased; a trial merge with it is clean (checked 2026-12-05).How it was tested
Tested revision: branch
up-preload-marks-pathfree-v2@efebde3af, onmain@47d21cd3b.Commands and results (there is no CI upstream; these are the ones I ran on
efebde3af):cargo test -p darner --bin darner --locked: 196 passed, 0 failed, 1 ignoredcargo clippy --workspace --all-targets --locked -- -D warnings: cleancargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo xtask policy: ok (564 files)path_preload_mark_is_by_translator_card_driver_and_path(each input changes the key, and it never equals the shared mark),path_mark_follows_the_exe_path_not_its_bytes(same path with new bytes counts as done; identical bytes in another folder does not; switch off ismain's behaviour),path_marks_follow_the_setting,content_mark_picks_shared_then_path_then_nothing.Changes a default: no. The switch is off by default.
A/B result: the switch is off by default, and it was checked by unit tests only. Not run in a game, so there is no A/B and no timing. The evidence above is from the driver's cache folders.
Gates run on that revision: clippy workspace: yes. Clippy workspace with
--all-features: yes.cargo test -p darner --bin darner: yes. Fullcargo test --workspace --locked: not run. There is no CI upstream.Gameplay: not run in a game. The machine for the later run: RTX 2070 SUPER 8 GB (Turing), driver 621.40, ReBAR off, Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 26320; Series S, DLSS Performance, frame generation off, ray tracing off.
Shader wave sizes tested: not relevant.
Hardware dependence: likely general (launcher logic); the path-keyed driver cache was observed on NVIDIA 621.40 only. Details in "Spec dependence".
Coverage gaps: every game run (the steps below); AMD and Intel drivers; the case of a build that changes pipeline names outside the translator; the full workspace tests.
In-game check, to run before WIP comes off
Use
darner playwith--set DARNER_PRELOAD_MARK_BY_PATH=1and a test cache.warmed/path-<hash>exists.crates/darner-shader) and replace it at P. Start: no window, no newD3DSCachefolder, and in-game pipeline builds ("being made") about the same as before the rebuild.D3DSCachefolder is made for Q.main).Checklist
main.main; ticking waits for the in-game check.docs/asset-policy.md(cargo xtask policy: ok).main; this uses #153'swindow_mark,adapter_driverand the settings-only read)Spec dependence
Checked for overlap
window_mark, so it follows the path mark too), #264 (merged;DARNER_PRELOAD_KEEP_MARKS: a different file,warm-done.txt, and a different trigger, a translator change; with both on, a translator change opens the window and the still-true marks are reused), #270, and #435 (Skanzinho, open, tested in its description): it moves the mark write intowrite_mark, sodarner preloadalso writes the byte-hash mark. It is in the sameplay.rsarea; the second to land rebases. See the known follow-up above.MARK_BY_PATHand "preload exe path" found no PR that does this.This change was made with AI assistance (Claude Code).
Brutu583 referenced this pull request2026-12-05 00:37:10 +00:00
efebde3afeto3e16dbb4afClosing this old-engine PR because post-merge replaced the preload window and its exe-path "done" mark; the mark there is
preloaded.txt(preload.rs:38-41). It can be redone on post-merge if the problem shows there.Written with AI assistance (Claude Code).
Reopened: Main is the default branch again, so the close note above no longer applies.
Written with AI assistance (Claude Code).
WIP: [pr-feature][startup][shaders] Preload window mark by exe path, translator, card and driver (DARNER_PRELOAD_MARK_BY_PATH, off by default)to WIP: Preload window mark by exe path, translator, card and driver (DARNER_PRELOAD_MARK_BY_PATH, off by default)View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.