WIP: Keep shader tests buildable on Linux #578

Draft
tyr0nsur wants to merge 1 commit from tyr0nsur/Darner:codex/shader-tests-portability into Main
Contributor

Contributor role (optional)

Role already granted.

What it changes

A bare Linux build of the shader unit tests fails with E0433 at c8258f9. The ignored translate_hot_programs test still has to compile, but it refers to emit::validator, which is compiled only on Windows.

Guard the optional validator load and invocation. On Linux the test can compile and use the existing no validator status. This change is confined to the ignored test module.

How it was tested

  • Tested the exact file in 9cc5a54d on top of c8258f9, using rustc 1.98.1.
  • Native Linux passed 356 tests with six ignored after excluding oracle64::legacy_mul_forms_are_exact. That case exceeded a four-minute run limit. Command cargo test --locked --offline -p darner-shader --lib -- --skip oracle64::legacy_mul_forms_are_exact --test-threads=1.
  • The Windows MSVC test binary built with cargo xwin test --locked --offline --target x86_64-pc-windows-msvc -p darner-shader --lib --no-run. Running emit::lower::tests:: under Wine passed 30 tests with one ignored.
  • Native Linux also passed the full shader library suite under the fast profile. 357 passed and six were ignored, including a pass of oracle64::legacy_mul_forms_are_exact. The suite took 37.93 s on one pinned Ryzen 7 5800X logical CPU. Command RUSTFLAGS='-C target-cpu=native' cargo test --locked --offline --profile fast -p darner-shader --lib -- --test-threads=1.
  • Both workspace Clippy gates passed on native Windows MSVC with the exact tree of 9cc5a54d, using rustc 1.98.1. Commands cargo clippy --workspace --all-targets --locked -- -D warnings and cargo clippy --workspace --all-targets --locked --all-features -- -D warnings.
  • The asset-policy check passed for 576 files. Runtime coverage is scoped to the library tests above.
  • This is a test-only change with no gameplay or default-setting changes. Actual validation by the Windows DXIL DLL is outside this run.

Checklist

  • Test-only change verified without game data.
  • One change based on official main.
  • The diff follows docs/asset-policy.md.
  • Dependencies recorded.
    • Depends on none.

Checked for overlap

  • Searched issues and pull requests for the failure and compared the changed paths of 195 open pull requests. None changed card_cost_tests.rs.
  • Related testing context in #546. The Linux build failure was found while running its synthetic tests.
## Contributor role (optional) Role already granted. ## What it changes A bare Linux build of the shader unit tests fails with `E0433` at `c8258f9`. The ignored `translate_hot_programs` test still has to compile, but it refers to `emit::validator`, which is compiled only on Windows. Guard the optional validator load and invocation. On Linux the test can compile and use the existing `no validator` status. This change is confined to the ignored test module. ## How it was tested - Tested the exact file in `9cc5a54d` on top of `c8258f9`, using rustc 1.98.1. - Native Linux passed 356 tests with six ignored after excluding `oracle64::legacy_mul_forms_are_exact`. That case exceeded a four-minute run limit. Command `cargo test --locked --offline -p darner-shader --lib -- --skip oracle64::legacy_mul_forms_are_exact --test-threads=1`. - The Windows MSVC test binary built with `cargo xwin test --locked --offline --target x86_64-pc-windows-msvc -p darner-shader --lib --no-run`. Running `emit::lower::tests::` under Wine passed 30 tests with one ignored. - Native Linux also passed the full shader library suite under the `fast` profile. 357 passed and six were ignored, including a pass of `oracle64::legacy_mul_forms_are_exact`. The suite took 37.93 s on one pinned Ryzen 7 5800X logical CPU. Command `RUSTFLAGS='-C target-cpu=native' cargo test --locked --offline --profile fast -p darner-shader --lib -- --test-threads=1`. - Both workspace Clippy gates passed on native Windows MSVC with the exact tree of `9cc5a54d`, using rustc 1.98.1. Commands `cargo clippy --workspace --all-targets --locked -- -D warnings` and `cargo clippy --workspace --all-targets --locked --all-features -- -D warnings`. - The asset-policy check passed for 576 files. Runtime coverage is scoped to the library tests above. - This is a test-only change with no gameplay or default-setting changes. Actual validation by the Windows DXIL DLL is outside this run. ## Checklist - [x] Test-only change verified without game data. - [x] One change based on official `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] Dependencies recorded. - Depends on none. ## Checked for overlap - [x] Searched issues and pull requests for the failure and compared the changed paths of 195 open pull requests. None changed `card_cost_tests.rs`. - Related testing context in #546. The Linux build failure was found while running its synthetic tests.
TrustNo1 changed title from WIP: [pr-tests][shaders] Keep shader tests buildable on Linux to WIP: Keep shader tests buildable on Linux 2026-12-06 03:26:55 +00:00
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/shader-tests-portability:tyr0nsur-codex/shader-tests-portability'
git switch 'tyr0nsur-codex/shader-tests-portability'

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 'tyr0nsur-codex/shader-tests-portability'
git switch 'tyr0nsur-codex/shader-tests-portability'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'tyr0nsur-codex/shader-tests-portability'
git switch 'tyr0nsur-codex/shader-tests-portability'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'tyr0nsur-codex/shader-tests-portability'
git switch 'Main'
git merge --squash 'tyr0nsur-codex/shader-tests-portability'
git switch 'Main'
git merge --ff-only 'tyr0nsur-codex/shader-tests-portability'
git switch 'Main'
git merge 'tyr0nsur-codex/shader-tests-portability'
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!578
No description provided.