Avoid native stack exhaustion in BDD analysis #4863

Open
github-bot wants to merge 1 commit from github-bot/gh-4862 into main AGit
Owner

@⁠VazirAPI on GitHub · 2026-12-01 11:59 UTC · original
VazirAPI:fix/bdd-traversal-stack → main · +235 −82 · 1 files · 1 commits · open

What it changes

Bools::forget, Bools::restrict and the meet search recurse once per decision-diagram level. A synthetic, valid 16,384-variable conjunction exhausts a 256 KiB worker stack in each operation and terminates its process with 0xc00000fd. All three now use explicit heap work stacks, following the iterative ite already in this module. Low-before-high traversal, early returns, memoization and resulting boolean nodes are preserved; the search also retains its conservative budget semantics and negative-answer memo accounting.

Adds isolated child-process regressions for all three deep traversals (including satisfiable and unsatisfiable searches), plus exhaustive six-variable truth-table checks for quantification and restriction, terminals, absent variables, shared subgraphs and memo reuse. Children must emit completion markers so an exact filter matching no tests cannot falsely pass. The existing randomized search oracle compares both results and remaining budgets.

This fixes a reproduced compiler failure; it does not attribute or claim to close any gameplay crash without a matching stack trace. The translator's source fingerprint changes normally with this source change.

How it was tested

  • Tested commit: 286ca92f7ea376159f81c495e4e6dd63f9531e12 (same tree as the final local checks).
  • GPU and profile: synthetic inputs on Windows 11, RTX 4050 Laptop; no game files, game run or FPS measurement. The broad existing suite also exercises GPU/WARP paths.
  • Toolchain: pinned Rust 1.98.1, native x86_64-pc-windows-gnu with MinGW. MSVC and upstream CI are not claimed here.
  • Before: the exact production BDD and new tests compiled in isolation from clean main: truth-table check passed; all three deep traversals failed with 0xc00000fd.
  • After: isolated production tests: 4 passed, 0 failed, also with a single-threaded test harness; cargo test -p victory-shader --lib --locked --offline structure::tests: 19 passed, 0 failed.
  • During investigation, a broad shader-suite run was interrupted to investigate two failed WARP checks and long-running hardware tests. Both failures reproduce on clean main 5fabb46e in an isolated target directory: emit::rayquery_tests::a_ray_query_program_validates_and_makes_a_pipeline_on_warp and emit::bitcode::opt::tests::hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity. This host's WARP reports only SM 6.2. The final change was checked with the focused tests above; no full-suite pass is claimed.
  • For shader changes, wave sizes tested: the new regressions operate on host-side decision diagrams; no title-shader Wave32/Wave64 corpus was run.
  • cargo test passed for the crates it touches: focused structurizer tests yes; full crate suite no, as described above.
  • cargo clippy -p victory-shader --all-targets --all-features --locked --offline -- -D warnings: passed.
  • Repository-wide limitation observed separately on clean main 5fabb46e: all-feature workspace Clippy stops at five findings in host/font.rs, host/menu.rs and host/panel.rs, tracked by existing repair #4680. The focused package check above passes for this change.
  • cargo xtask policy --staged: 1 file OK. git diff --cached --check: passed.

Checked for overlap

  • Searched open and closed PRs/issues by symptom and Bools, forget, restrict, and inspected the open-PR file listing. Related PRs touching this file: #4788, #4481, #4171, #3501, #3402, #2993 and #831. #4788 bounds the ite answer table; #3501 optimizes support traversal. Neither replaces the recursive operations changed here. The other changes concern different analysis paths. This extends the iterative traversal approach already adopted for ite from #1103.

AI-assisted implementation and review with OpenAI Codex.

**@⁠VazirAPI** on GitHub · 2026-12-01 11:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4862) `VazirAPI:fix/bdd-traversal-stack` → `main` · +235 −82 · 1 files · 1 commits · open ## What it changes `Bools::forget`, `Bools::restrict` and the `meet` search recurse once per decision-diagram level. A synthetic, valid 16,384-variable conjunction exhausts a 256 KiB worker stack in each operation and terminates its process with `0xc00000fd`. All three now use explicit heap work stacks, following the iterative `ite` already in this module. Low-before-high traversal, early returns, memoization and resulting boolean nodes are preserved; the search also retains its conservative budget semantics and negative-answer memo accounting. Adds isolated child-process regressions for all three deep traversals (including satisfiable and unsatisfiable searches), plus exhaustive six-variable truth-table checks for quantification and restriction, terminals, absent variables, shared subgraphs and memo reuse. Children must emit completion markers so an exact filter matching no tests cannot falsely pass. The existing randomized search oracle compares both results and remaining budgets. This fixes a reproduced compiler failure; it does not attribute or claim to close any gameplay crash without a matching stack trace. The translator's source fingerprint changes normally with this source change. ## How it was tested - Tested commit: `286ca92f7ea376159f81c495e4e6dd63f9531e12` (same tree as the final local checks). - GPU and profile: synthetic inputs on Windows 11, RTX 4050 Laptop; no game files, game run or FPS measurement. The broad existing suite also exercises GPU/WARP paths. - Toolchain: pinned Rust 1.98.1, native `x86_64-pc-windows-gnu` with MinGW. MSVC and upstream CI are not claimed here. - Before: the exact production BDD and new tests compiled in isolation from clean main: truth-table check passed; all three deep traversals failed with `0xc00000fd`. - After: isolated production tests: 4 passed, 0 failed, also with a single-threaded test harness; `cargo test -p victory-shader --lib --locked --offline structure::tests`: 19 passed, 0 failed. - During investigation, a broad shader-suite run was interrupted to investigate two failed WARP checks and long-running hardware tests. Both failures reproduce on clean `main` 5fabb46e in an isolated target directory: `emit::rayquery_tests::a_ray_query_program_validates_and_makes_a_pipeline_on_warp` and `emit::bitcode::opt::tests::hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity`. This host's WARP reports only SM 6.2. The final change was checked with the focused tests above; no full-suite pass is claimed. - For shader changes, wave sizes tested: the new regressions operate on host-side decision diagrams; no title-shader Wave32/Wave64 corpus was run. - `cargo test` passed for the crates it touches: focused structurizer tests yes; full crate suite no, as described above. - `cargo clippy -p victory-shader --all-targets --all-features --locked --offline -- -D warnings`: passed. - Repository-wide limitation observed separately on clean main 5fabb46e: all-feature workspace Clippy stops at five findings in `host/font.rs`, `host/menu.rs` and `host/panel.rs`, tracked by [existing repair #4680](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4680). The focused package check above passes for this change. - `cargo xtask policy --staged`: 1 file OK. `git diff --cached --check`: passed. ## Checked for overlap - [x] Searched open and closed PRs/issues by symptom and `Bools`, `forget`, `restrict`, and inspected the open-PR file listing. Related PRs touching this file: #4788, #4481, #4171, #3501, #3402, #2993 and #831. #4788 bounds the `ite` answer table; #3501 optimizes support traversal. Neither replaces the recursive operations changed here. The other changes concern different analysis paths. This extends the iterative traversal approach already adopted for `ite` from #1103. AI-assisted implementation and review with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 12:04: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 origin '+refs/pull/4863/head:github-bot/gh-4862'
git switch 'github-bot/gh-4862'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4862'
git switch 'github-bot/gh-4862'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4862'
git switch 'github-bot/gh-4862'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4862'
git switch 'main'
git merge --squash 'github-bot/gh-4862'
git switch 'main'
git merge --ff-only 'github-bot/gh-4862'
git switch 'main'
git merge 'github-bot/gh-4862'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!4863
No description provided.