Make the scoped owner-panic test independent of claim order #549

Open
holoslicer wants to merge 1 commit from holoslicer/Darner:test/deterministic-scoped-panic-schedule into Main
Contributor

Refs #539.

Contributor role (optional)

Fluxer ID 1577921940104949761. Please grant the Contributor role when this merges.

What it changes

Section 3b of nested_wide_each_scoped_handles_overflow_concurrency_and_panics gives the pool two chunks, then expects the owner to panic inside its callback. Helpers can legally claim both chunks before the owner runs. In that order the workload returns normally and the test reports owner panic did not unwind.

The test parks helpers inside their first callback and submits one more chunk than there are helpers. The owner waits for helper entry, then unwinds with a typed payload. Dropping the channel sender during unwind releases the helpers. The test checks the payload, the helper's observation of the disconnect and the scoped slots after the join. The helper-panic case checks that a helper actually entered before accepting the propagated panic.

How it was tested

  • Upstream baseline c8258f9. Tested revision aaf411c4. Windows x64. Tests only. The worker implementation and defaults are identical on both revisions.
  • To reproduce the order on stock, enable two or more helpers and run section 3b. In a local test build, wake the eligible helpers and gate the owner's first chunk claim on two helper callback entries. The opposite control gates helper claims on the first owner callback. Record who enters to establish the actual schedule. Applying the same gates to the changed test exercises the same production pool.
  • In the native Darner GPU test binary, the upstream test passed all 24 owner-first schedules and failed all 26 helpers-first schedules with the reported assertion. With the fix, all 50 passed. Matched process inputs used seed 0xC0FFEE and 2–8 helpers.
  • On ordinary scheduling, 29 fresh processes passed on each revision across helper counts 1–32. The clean candidate worker-test family passed 9 tests with 2 ignored measurements.
  • Run the regression in a fresh process at each width so the pool picks up the environment. For example, set DARNER_WIDE_THREADS=2, then run cargo test --locked -p darner-gpu --lib shadow::wide_tests::nested_wide_each_scoped_handles_overflow_concurrency_and_panics -- --exact --test-threads=1.
  • Verification on this revision used both strict workspace Clippy commands (default features and all features), cargo xtask policy, and the full serial cargo test --workspace --locked --offline --no-fail-fast suite with --config profile.test.package.darner-shader.opt-level=3. All exited 0. Top-level harness totals were 3,519 passed, 0 failed and 121 ignored.
  • This depends on CPU scheduling. No game, adapter benchmark, shader translation or frame-rate measurement is involved.

Checklist

  • Tests only, exercised directly in the test harness.
  • One change based on upstream main.
  • The diff follows the asset policy.
  • This change has no prerequisites.

Checked for overlap

  • Searched open and closed PRs/issues and the open PRs touching shadow.rs.
  • #539 records this assertion in its full-suite results. #334 and #115 mention the existing test. Open PRs #543, #508, #494, #440, #345, #332, #321, #319, #310, #221, #219 and #218 also touch the file. I found no competing fix for this test's schedule assumption.
Refs #539. ## Contributor role (optional) Fluxer ID `1577921940104949761`. Please grant the Contributor role when this merges. ## What it changes Section 3b of `nested_wide_each_scoped_handles_overflow_concurrency_and_panics` gives the pool two chunks, then expects the owner to panic inside its callback. Helpers can legally claim both chunks before the owner runs. In that order the workload returns normally and the test reports `owner panic did not unwind`. The test parks helpers inside their first callback and submits one more chunk than there are helpers. The owner waits for helper entry, then unwinds with a typed payload. Dropping the channel sender during unwind releases the helpers. The test checks the payload, the helper's observation of the disconnect and the scoped slots after the join. The helper-panic case checks that a helper actually entered before accepting the propagated panic. ## How it was tested - Upstream baseline `c8258f9`. Tested revision `aaf411c4`. Windows x64. Tests only. The worker implementation and defaults are identical on both revisions. - To reproduce the order on stock, enable two or more helpers and run section 3b. In a local test build, wake the eligible helpers and gate the owner's first chunk claim on two helper callback entries. The opposite control gates helper claims on the first owner callback. Record who enters to establish the actual schedule. Applying the same gates to the changed test exercises the same production pool. - In the native Darner GPU test binary, the upstream test passed all 24 owner-first schedules and failed all 26 helpers-first schedules with the reported assertion. With the fix, all 50 passed. Matched process inputs used seed `0xC0FFEE` and 2–8 helpers. - On ordinary scheduling, 29 fresh processes passed on each revision across helper counts 1–32. The clean candidate worker-test family passed 9 tests with 2 ignored measurements. - Run the regression in a fresh process at each width so the pool picks up the environment. For example, set `DARNER_WIDE_THREADS=2`, then run `cargo test --locked -p darner-gpu --lib shadow::wide_tests::nested_wide_each_scoped_handles_overflow_concurrency_and_panics -- --exact --test-threads=1`. - Verification on this revision used both strict workspace Clippy commands (default features and all features), cargo xtask policy, and the full serial cargo test --workspace --locked --offline --no-fail-fast suite with --config profile.test.package.darner-shader.opt-level=3. All exited 0. Top-level harness totals were 3,519 passed, 0 failed and 121 ignored. - This depends on CPU scheduling. No game, adapter benchmark, shader translation or frame-rate measurement is involved. ## Checklist - [x] Tests only, exercised directly in the test harness. - [x] One change based on upstream main. - [x] The diff follows the asset policy. - [x] This change has no prerequisites. ## Checked for overlap - [x] Searched open and closed PRs/issues and the open PRs touching `shadow.rs`. - #539 records this assertion in its full-suite results. #334 and #115 mention the existing test. Open PRs #543, #508, #494, #440, #345, #332, #321, #319, #310, #221, #219 and #218 also touch the file. I found no competing fix for this test's schedule assumption.
holoslicer changed title from WIP: [pr-tests][memory] Make the scoped owner-panic test independent of claim order to [pr-tests][memory] Make the scoped owner-panic test independent of claim order 2026-12-05 12:04:30 +00:00
TrustNo1 changed title from [pr-tests][memory] Make the scoped owner-panic test independent of claim order to Make the scoped owner-panic test independent of claim order 2026-12-06 03:27:22 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'test/deterministic-scoped-panic-schedule:holoslicer-test/deterministic-scoped-panic-schedule'
git switch 'holoslicer-test/deterministic-scoped-panic-schedule'

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.

git switch 'Main'
git merge --no-ff 'holoslicer-test/deterministic-scoped-panic-schedule'
git switch 'holoslicer-test/deterministic-scoped-panic-schedule'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'holoslicer-test/deterministic-scoped-panic-schedule'
git switch 'holoslicer-test/deterministic-scoped-panic-schedule'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'holoslicer-test/deterministic-scoped-panic-schedule'
git switch 'Main'
git merge --squash 'holoslicer-test/deterministic-scoped-panic-schedule'
git switch 'Main'
git merge --ff-only 'holoslicer-test/deterministic-scoped-panic-schedule'
git switch 'Main'
git merge 'holoslicer-test/deterministic-scoped-panic-schedule'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!549
No description provided.