intersect: pin the shadow-ray stand-in for a node test with no structures #638
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!638
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:intersect-occlusion-test"
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: nothing. This is a tests-only change (no production line is edited).
What it pins:
Lower::bvh, withno_hit()orbvh_miss()on, gives a program whose rays are shadow rays the occluded stand-in — a box entersOCCLUDER, a triangle one node past the structure's start, and every triangle test hits just short of the ray's end — and gives every other program the plain miss (crates/darner-shader/src/emit/intersect.rs, theOCCLUSIONbranch around the old:258). Nothing tested that branch:shadow_ray_programs_are_told_by_nametests the name predicate only, and no test read or setOCCLUSION, so an inversion of it, or a kind comparison that stopped holding (pointer & 6 == 4for kinds 4 and 5,pointer & 7 < 4for kinds 0 to 3), would not have been noticed. It is the branch that decides whether a shadowed pixel is lit — the live path underDARNER_HW_RT=1.This change adds
intersect_tests::a_shadow_ray_that_answers_no_hit_is_occluded: it lowers the same program twice, withOCCLUSIONon and off, asserts the two DXIL forms differ and that neither loads the memory directory or notes a fault, then dispatches the 32-thread record and checks what each thread gets — kinds 4 and 5[8, NONE, NONE, NONE], kinds 0 to 3 the hit at 0.996 of the extent with weights 1, 1/4, 1/4, kinds 6 and 7 the triangle miss, and the shadow-ray state off[NONE, NONE, NONE, NONE]with the miss. It serialises withONE_AT_A_TIME(the same lock the neighbouring valu tests take) and restores the thread-local switches in aDropguard, so a failing assertion cannot leak them into another test.How it was tested
5d1f949(one commit onc8258f9).cargo test --locked -p darner-shader --lib -- intersect— 13 passed, 0 failed.cargo clippy --locked -p darner-shader --all-targets -- -D warningspasses.OCCLUSIONfails the new test on the first thread (the plain miss where the hit is), and makingis_boxcompare with 6 instead of 4 fails it on thread 4 (the plain miss where8is). Each mutation was reverted with file copies, nevergit stash.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.darner-gpuissues on this machine (#224, #150), and the fulldarner-shaderrun takes minutes because of the oracle sweep, so the change was gated by theintersectmodule (13 passed) plus both clippy runs.OCCLUSION) was observed by a tester as a grid of white dots in the shade, per the finding.bvh_missroute to the same stand-in is exercised only throughTEST_NO_HIT; a real structure that answers "no hit" on its own is not.Checklist
main.docs/asset-policy.md(cargo xtask policy: passes).Checked for overlap
crates/darner-shader/src/emit/intersect_tests.rsorintersect.rs(checked against the file list of all 189 open pull requests), and no open or closed issue mentionsOCCLUSIONor the shadow-ray stand-in.[pr-tests][shaders] intersect: pin the shadow-ray stand-in for a node test with no structuresto intersect: pin the shadow-ray stand-in for a node test with no structuresView 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.