replay: --dump checks the shader a capture names, and its length #602
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!602
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:replay-dump-bounds"
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
The problem on main:
dump(crates/darner-gpu/src/replay/play.rs:377) walks a capture's pipelines and writes each shader blob out, indexing the capture's code table with an id read from the same file and allocating the length it finds there:A capture is untrusted input —
darner replay --dumpreads whatever file the user points at — so a bad id is an out-of-bounds panic and a bad length is a multi-terabyte allocation. Neither says what was wrong; the command aborts.This change checks the id against
frame.codes.len()and the length against the capture file's own size, and answers with the error the command already uses for an unreadable capture, naming the pipeline, the id and the length. Both new error paths are tested with synthetic captures.How it was tested
f071e51(one commit onc8258f9).cargo test --locked -p darner-gpu --features diagnostics --lib -- replay— passes, with the new tests among them.cargo clippy --locked -p darner-gpu --all-targets -- -D warningspasses.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.cargo test --workspace --locked: not run to completion here; the pre-existingdarner-gputest deadlock (#224) anddarner-shaderwaterfall fixture failure (#227) make the whole-workspace run non-green on this machine. The crate'sreplaytests pass.dumpparts (roots, constants) andcompareread their own recorded lengths and were not reviewed in this change.Checklist
darner replay --dumpis an offline tool; the evidence is the two tests, which abort the test process onmain.main.docs/asset-policy.md(cargo xtask policy: 576 files ok).Checked for overlap
crates/darner-gpu/src/replay/play.rs; neither mentionsdumpor the shader table. No open or closed issue mentions the replay dump.[pr-fix] replay: --dump checks the shader a capture names, and its lengthto replay: --dump checks the shader a capture names, and its lengthView 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.