structure: walk a deep diagram in forget and restrict without recursing #651
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!651
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:structure-recursion-depth"
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:
forgetandrestrict(crates/darner-shader/src/structure.rs:375and:394) recursed into both of a node's children, so their native depth was the diagram's path length — as long as the chain of mask steps that built it.mkbounds the number of nodes, not the depth, andite(:212) andvarswere already rewritten with an explicit worklist for exactly this reason (ite's comment says so). Thedarner-pipelines-*workers are spawned without astack_size, so the 2 MiB they get is what a title's long straight-line region has, and that region's chain ofs_and_saveexecsteps putsforget— called once per back edge on every round ofpaths— past the stack: an abort, not theTOO_LARGEsuch a shader is refused with.This change takes the same walk in ascending node order in both functions.
mkmakes a node only after both its children, so a node's index is above theirs and one pass over the arena in order resolves every node after its children.How it was tested
b369678(one commit onc8258f9).cargo test --locked -p darner-shader --lib -- structure— 21 passed, 0 failed.thread ... has overflowed its stack), which is the defect.cargo clippy --locked -p darner-shader --all-targets -- -D warningspasses.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.structuretests are green; the fulldarner-shaderrun is minutes long because of the oracle sweep (see #619), and the whole-workspace run is not green on this machine for the pre-existingdarner-gpureasons (#224, #150), which this does not touch.Bools::varsquadratic in a walk that runs once per guarded instruction) is a separate change and is not addressed here.Checklist
main.main.docs/asset-policy.md(cargo xtask policy: passes).Checked for overlap
crates/darner-shader/src/structure.rs; neither mentionsforget,restrictor recursion depth. No open or closed issue mentions a stack overflow in structurisation.[pr-fix][shaders] structure: walk a deep diagram in forget and restrict without recursingto structure: walk a deep diagram in forget and restrict without recursingTest needed — commit
b3696782; what to check:The problem on main:
forgetandrestrict(crates/darner-shader/src/structure.rs:375and:394) recursed into both of a node's children, so their native depth was the diagram's path length — as long as the chain of mask steps that built it.mkbounds the number of nodes, not the depth, andite(:212) andvarswere already rewritten with an explicit worklist for exactly this reason (ite's comment says so). Thedarner-pipelines-*workers are spawned without astack_size, so the 2 MiB they get is what a title's long straight-line region has, and that region's chain ofs_and_saveexecsteps putsforget— called once per back edge on every round ofpaths— past the stack: an abort, not theTOO_LARGEsuch a shader is refused with.This change takes the same walk in ascending node order in both functions.
mkmakes a node only after both its children, so a node's index is above theirs and one pass over the arena in order resolves every node after its children.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.