Add opt-in static heap access census #4743

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

@⁠john-9474 on GitHub · 2026-12-01 04:37 UTC · original
john-9474:codex/heap-access-census → main · +425 −0 · 3 files · 1 commits · open

What it changes

Dynamically indexed heap accesses are difficult to diagnose: the current picked-write heuristic answers a conservative yes/no question, without showing operation families, descriptor origins or incomplete analysis.

Adds VICTORY_HEAP_ACCESS_CENSUS=1 in diagnostics builds. The switch is off by default. At the first SLOT_STRIDES binding, it reports static operation/source counts once, then continues the existing renderer path. The three-file change includes the module, its guarded hook and a short usage document.

Counts separate buffer, image, scalar-resource and BVH-node reads/stores/atomics, descriptor-address fetches, source families and unresolved cases. They are not executed accesses, distinct buffers or a physical access-set proof. The physical-owner/index-domain completeness flags remain false. No shader schema or cache-key changes are needed.

The work caps are input-count limits, not a wall-clock guarantee: parsing and SSA construction precede some checks. Analysis can delay the first matching bind. Existing panic-hook and abort/OOM behaviour remains as documented.

How it was tested

On clean main 5fabb46e plus the exact three-file candidate, using pinned Rust 1.98.1, locked dependencies and two jobs:

  • All three exact synthetic classifier tests passed, each with one passed and zero failed/ignored. They cover mixed/fetched/dynamic sources and truncation, unknown operations, and dynamic table versus resource-heap origins.
  • Default and diagnostics GPU all-target checks passed.
  • Staged asset policy (three files) and diff checks passed. Source hashes were unchanged throughout validation; Cargo.lock is unchanged.
  • Both strict GPU Clippy checks failed at the same five unchanged upstream UI findings: font.rs:213,260, menu.rs:667, and panel.rs:602,668. Those files match clean-base CI; #4680 tracks their repair. No authored finding, suppression or UI change is included.

The identical analyzer also ran separately in a broader local diagnostic integration. It reported 19 possible heap-origin reads and two heap descriptor-address loads; those aggregate counts do not establish their exact lineage. That run demonstrates analyzer utility. This public normal-renderer hook has source/cfg and compile validation, without a stock-game playthrough or FPS/visual claim. The full workspace suite was not run.

Checked for overlap

  • Read current contribution rules, checked existing own PRs, and searched the exact flag and related ResourceHeap/census/tracking changes. No equivalent generic runtime census was found.
  • picked::stores_picked supplies a background conservative write-reachability boolean. This diagnostic exposes static operation/source classes and unknown coverage.
  • Related #3066 and #4174 change write selection/tracking; #3712 tests malformed compiler inputs; #809 preserves computed address terms; #3686 and #3869 report different bounds/lifetime facts. Their functionality remains separate.
**@⁠john-9474** on GitHub · 2026-12-01 04:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4742) `john-9474:codex/heap-access-census` → `main` · +425 −0 · 3 files · 1 commits · open ## What it changes Dynamically indexed heap accesses are difficult to diagnose: the current picked-write heuristic answers a conservative yes/no question, without showing operation families, descriptor origins or incomplete analysis. Adds `VICTORY_HEAP_ACCESS_CENSUS=1` in diagnostics builds. The switch is off by default. At the first `SLOT_STRIDES` binding, it reports static operation/source counts once, then continues the existing renderer path. The three-file change includes the module, its guarded hook and a short usage document. Counts separate buffer, image, scalar-resource and BVH-node reads/stores/atomics, descriptor-address fetches, source families and unresolved cases. They are not executed accesses, distinct buffers or a physical access-set proof. The physical-owner/index-domain completeness flags remain false. No shader schema or cache-key changes are needed. The work caps are input-count limits, not a wall-clock guarantee: parsing and SSA construction precede some checks. Analysis can delay the first matching bind. Existing panic-hook and abort/OOM behaviour remains as documented. ## How it was tested On clean main `5fabb46e` plus the exact three-file candidate, using pinned Rust 1.98.1, locked dependencies and two jobs: - All three exact synthetic classifier tests passed, each with one passed and zero failed/ignored. They cover mixed/fetched/dynamic sources and truncation, unknown operations, and dynamic table versus resource-heap origins. - Default and diagnostics GPU all-target checks passed. - Staged asset policy (three files) and diff checks passed. Source hashes were unchanged throughout validation; `Cargo.lock` is unchanged. - Both strict GPU Clippy checks failed at the same five unchanged upstream UI findings: `font.rs:213,260`, `menu.rs:667`, and `panel.rs:602,668`. Those files match [clean-base CI](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46553617760/job/142323033705); #4680 tracks their repair. No authored finding, suppression or UI change is included. The identical analyzer also ran separately in a broader local diagnostic integration. It reported 19 possible heap-origin reads and two heap descriptor-address loads; those aggregate counts do not establish their exact lineage. That run demonstrates analyzer utility. This public normal-renderer hook has source/cfg and compile validation, without a stock-game playthrough or FPS/visual claim. The full workspace suite was not run. ## Checked for overlap - [x] Read current contribution rules, checked existing own PRs, and searched the exact flag and related ResourceHeap/census/tracking changes. No equivalent generic runtime census was found. - `picked::stores_picked` supplies a background conservative write-reachability boolean. This diagnostic exposes static operation/source classes and unknown coverage. - Related #3066 and #4174 change write selection/tracking; #3712 tests malformed compiler inputs; #809 preserves computed address terms; #3686 and #3869 report different bounds/lifetime facts. Their functionality remains separate.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 04:42:29 +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/4743/head:github-bot/gh-4742'
git switch 'github-bot/gh-4742'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4742'
git switch 'github-bot/gh-4742'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4742'
git switch 'github-bot/gh-4742'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4742'
git switch 'main'
git merge --squash 'github-bot/gh-4742'
git switch 'main'
git merge --ff-only 'github-bot/gh-4742'
git switch 'main'
git merge 'github-bot/gh-4742'
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!4743
No description provided.