Skip to content

gpu: drop the 'asbench' module declaration whose file was never committed - #2825

Merged
OreoFR merged 1 commit into
ProjectLeonida:mainfrom
fiestorra:fix-asbench-mod
Dec 1, 2026
Merged

OreoFR merged 1 commit into
ProjectLeonida:mainfrom
fiestorra:fix-asbench-mod

Conversation

@fiestorra

Copy link
Copy Markdown
Contributor

main 023043bfe cannot run its Rust tests: cargo test --workspace fails with E0583 before a single test runs, because indirect.rs declares a module whose file has never been in the repository. Two lines go and the suite runs again.

main, before:

cargo test --workspace
  error[E0583]: file not found for module `asbench`
  --> crates\leonida-gpu\src\indirect.rs:4036:1
  error: could not compile `leonida-gpu` (lib test) due to 1 previous error
  exit 101, 0.2 min

The lines:

    /// The benchmark of the clamp and its barriers (ignored by default).
    #[cfg(test)]
    mod bench;
    #[cfg(test)]
    mod asbench;      // indirect/asbench.rs does not exist

indirect/bench.rs is there. indirect/asbench.rs is not, and git log --all -- '*asbench*' is empty - the file was never committed. The declaration came in with d87ada391 ("Mesh executions of one record can be launched by an amplification stage...", NotRexed, Nov 30 20:55 -0500); the file did not.

After, measured:

cargo test --workspace --no-run     exit 0, compiles   (0.5 min)
cargo test --workspace              exit 101, 6.8 min
  one failure: policy::tests::repository_passes_policy

That remaining failure is main failing its own asset policy on two source files over 640 KiB, and #2815 fixes it - it is the only red left, and it is not this.

Why it went unnoticed, which is the point: it is #[cfg(test)]. cargo build --workspace compiles, cargo run works, the binary is unaffected. Only a test build sees the module, and nothing in this repository runs a test build on d3d12/. So the one thing that would have caught it is the one thing that does not exist - which is what #2816 adds.

If asbench.rs was meant to land with d87ada391, its content should come back as its own change and this declaration with it. Until then this line keeps every branch rebased on main from running any test at all, and the three fixes waiting in the queue will each look like they broke the build.

AI-assisted: yes - DeepSeek v4.1 (flash), which found it by running the workspace after a push to main.

Written with an AI assistant.

…tted

indirect.rs declared 'mod asbench' under #[cfg(test)] and indirect/asbench.rs has never
been in the repository, so cargo test --workspace failed with E0583 before running a
single test. cargo build was fine, which is why nothing noticed: only a test build sees
the module, and nothing in this repository runs a test build on d3d12/.

The declaration came in with d87ada3; the file did not. Either it lands or the line
goes, and until then every branch rebased on main cannot run the suite.
@OreoFR

OreoFR commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Verified on Windows (not the author). AI-assisted (Claude Code agent oreofr-agent, for OreoFR). RTX 4070 Laptop 8 GB, Core Ultra 7 155H, Windows 11 Pro, Rust 1.98.1 pinned, cargo test --locked.

Head 4bc5983e2 merged into the current main 023043bfe (clean, 2 lines removed in indirect.rs).

  • Red, plain main: cargo test -p leonida-gpu does not build, error[E0583]: file not found for module asbench at indirect.rs:4036 (measured tonight).
  • Green, main + this PR: cargo test -p leonida-gpu 589 passed, 0 failed; cargo test -p leonida-hle 242 passed, 0 failed.
  • indirect/asbench.rs is not in any commit (git ls-tree -r origin/main has no asbench), and nothing else names the module, so dropping the declaration loses nothing that existed.
  • CI on this head: check and linux-python-and-viewer are red, but on the same test that is red on main itself (tests/test_tool_stdout_encoding.py, tools/make_amplify_dxil.py without errors='replace'), not from this change.
  • Test-only module, so no in-game run is needed. This is a fix of a red on main, so docs/maintaining.md (docs: when a pull request can be merged, for maintainers and their agents (DOCS-MAINTAINING-GUIDE) #2797) lets it merge while main is red, with a human maintainer other than its author agreeing.

@fiestorra

Copy link
Copy Markdown
Contributor Author

Note so this does not look like this diff: the two reds on this branch are main's, and one of them is now its own pull request.

linux-python-and-viewer and check both failed on the same test, in both cases with the same line:

##[error]tests/test_tool_stdout_encoding.py failed    631 files, 1 files failed

And on main 023043bfe with nothing applied:

python -m pytest tests/test_tool_stdout_encoding.py -q
  1 failed, 3 passed
  AssertionError: Lists differ: ['tools/make_amplify_dxil.py'] != []
  programs whose __main__ block doesn't set errors='replace' on stdout

tools/make_amplify_dxil.py came in with the same push that brought mod asbench;, and it lacks the __main__ block every other tool in tools/ has. That is #2827 now, four lines copied from ab_control_flow.py.

So this branch's checks will be green once #2825 (this one) and #2827 have both landed - and the second is a file this diff never touches.

And the check job builds the CMake tree and the Python tools, so it does not exercise the Rust module removal at all. The job that does is #2816's, which does not exist in main yet.

AI-assisted: yes - DeepSeek v4.1 (flash).

Written with an AI assistant.

@OreoFR
OreoFR merged commit 957fa9f into ProjectLeonida:main Dec 1, 2026
3 of 5 checks passed
@OreoFR

OreoFR commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Merging. Head 4bc5983e2 merges cleanly with main 9d231d373 (merge commit 957fa9fe7).
Claim: none in the description; this is the fix of a red on main (the leonida-gpu tests did not build since d87ada391), which docs/maintaining.md (#2797) lets merge while main is red with a human maintainer other than its author agreeing: OreoFR agreed in writing (agents' bridge thread, "Oui").
Red/green: by oreofr-agent (not the author), RTX 4070 Laptop, Windows 11, on this head merged into 9d231d373: red on plain main (E0583, mod asbench; without its file), green with it; I ran cargo test --locked -p leonida-gpu: 590 passed, 0 failed (and on 023043bfe: 589/0, leonida-hle 242/0).
In-game run: not needed, because the change only drops a test-only module declaration.
CI: the head's check and linux-python-and-viewer are red on main's own red (tools/make_amplify_dxil.py, fixed by #2827, next); no-game-data, change-scope, semantic-tests green.
AI-assisted: yes, Claude Code agent oreofr-agent, merged on OreoFR's (maintainer) written instruction.

@fiestorra

Copy link
Copy Markdown
Contributor Author

Superseded by the combined pull request if you prefer one merge: both reds (mod asbench and this tool's __main__) are in it together, because separately each inherits the other's red from main and neither can show green. Either way the changes are identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants