Shader tracking accuracy #527
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!527
Loading…
Reference in a new issue
No description provided.
Delete branch "tragice/Darner:main"
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?
Contributor role (optional)
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
main.docs/asset-policy.md.Checked for overlap
0is off where it was read as set or not b89f06df9b`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.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.mips: 0description 2efc784b18No 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.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]>47d21cd) into pr-xmem-scatter-freed-gathered 637b1dda126a9b0df) 78b42fe12dHere 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:
--logfileis deprecatedrunning 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
WIP [PR-fix][Preload] Shader tracking accuracyto [PR-fix][Preload] Shader tracking accuracy[PR-fix][Preload] Shader tracking accuracyto Shader tracking accuracyTest 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
testingto take this run; it's free again after 24 h with no results.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.