Skip to content

CI: consolidate Linux and native Apple Silicon offline validation - #438

Closed
pedrofort wants to merge 28 commits into
Marvisak:mainfrom
pedrofort:apple-silicon-ci
Closed

pedrofort wants to merge 28 commits into
Marvisak:mainfrom
pedrofort:apple-silicon-ci

Conversation

@pedrofort

@pedrofort pedrofort commented Nov 24, 2026 •

Copy link
Copy Markdown

Objective

Consolidate native cross-platform build and offline
shader validation for Windows, Linux and Apple Silicon.

Attribution and dependencies

The dependency commits retain their original authors.
This PR is an integration candidate, not a replacement
claim for their independent contributions.

Local validation on Apple M5

Check Result
Workspace tests 271 passed, 0 failed, 5 ignored
GPU tests, sequential PASS
GPU tests, five parallel runs PASS
Workspace check, all targets/features PASS
Clippy, default and all features PASS
Asset policy PASS
Native ARM64 release build PASS
Synthetic offline CLI PASS

Scope

Windows runtime behavior is not intentionally changed.
Linux and macOS support offline tools and tests.
Native title execution is not claimed.

Updated Linux and Windows hosted CI results are pending.
No game assets or proprietary binaries.

AI-assisted implementation with ChatGPT.

SkippySteve added 2 commits November 23, 2026 20:35
Gate the remaining Windows-only paths so the workspace checks, builds and
tests on x86_64-unknown-linux-gnu: view_format (D3D12 host copy), the
xgameui host dialog, the xmem allocator hookup in D3D12XCreateDevice,
XLaunchNewGame's relaunch, and translate's validator/pipeline checks
(stubbed as unavailable). Tests that parse their own test binary as PE or
rely on Windows path rules run on Windows only.

victory run still bails with 'running titles requires Windows'.
With the host paths gated, a Linux build warned about the imports,
helpers and console-side state only those paths use. Gate or allow them
off Windows so `cargo clippy --workspace --all-targets` on Linux reports
only real issues:

- victory-gpu: off Windows, allow dead_code/unused_variables/unused_mut
  crate-wide (the host halves of the objects are gated out); gate the
  OnceLock import and the host-only fence/root test modules.
- victory-hle: gate the `put` import in display, the `w` test helper,
  and XLaunchNewGame's park loop (unreachable after exit off Windows);
  allow the unused `mut` in modules::all and the unused host::function.
- victory: gate the anyhow::Context import used only by `run`.

Windows behaviour and Windows warnings are unchanged.
@SkippySteve

Copy link
Copy Markdown

I ran this on Linux x86_64 (Arch, Rust 1.98.1, Python 3.14) at 74cf6bc. The new script is not tied to macOS, so it also works as a Linux check.

Check Result
cargo xtask policy 153 files ok
cargo test --workspace --locked 162 passed, 0 failed, 3 ignored (same counts as your M5)
cargo clippy --workspace --all-targets --locked --exclude victory-shader -- -D warnings clean
cargo build --workspace --release --locked ELF x86-64
bash tests/offline-cli.sh target/release/victory PASS: 3 containers, 1 duplicate skipped, 2 of 2 compute programs emitted, both .dxil have valid structure (1248 and 2136 bytes), --validate and --pipelines both stop with needs Windows (D3D12 / dxil.dll)
same script on the debug binary PASS

Notes (none of them block):

  1. Stacking. The diff against main contains all of Build: gate Windows-only paths so the workspace builds and tests on Linux #235 (17 files, +108/−10) as well as your commit. If this merges first, Build: gate Windows-only paths so the workspace builds and tests on Linux #235 lands with it. Either rebase after Build: gate Windows-only paths so the workspace builds and tests on Linux #235 merges, or say in the description that merging this also merges Build: gate Windows-only paths so the workspace builds and tests on Linux #235.
  2. TMPDIR in the source tree. If TMPDIR points inside the checkout, victory-core's policy::tests::accepts_unrelated_directories fails by design: it refuses temp paths in the repo. Runners use a temp dir outside the checkout, so CI is not affected. This is only a warning for anyone who reproduces locally with a tmp dir in the worktree, which I first did.
  3. Triggers. The workflow runs on both push: and pull_request: with no branch filter. The concurrency group is github.ref, which differs between the two events (refs/heads/… vs refs/pull/N/merge). So a branch in this repo with an open PR runs the macOS job twice. Adding branches: [main] under push would avoid that. macOS minutes cost more than Linux minutes.
  4. tests/offline-cli.sh is mode 100644. That is fine because CI calls it with bash, but chmod +x would let people run tests/offline-cli.sh <bin> directly.
  5. Linux CI. Once Build: gate Windows-only paths so the workspace builds and tests on Linux #235 is in, the same cargo test --workspace plus bash tests/offline-cli.sh target/release/victory steps could go into the Linux job (Linux/Wine testing: interim Linux CI subset; skip load_probe cargo build under Wine #232 is the interim Linux subset). That would give the offline translator x86-64 Linux coverage too. This can be a follow-up.

I did not test on Windows, on macOS, or on a hosted runner. I used no game files: the script makes its own synthetic shaders.

@DaviTostes

Copy link
Copy Markdown

Verified 4e107dd on Arch Linux x86_64 (rustc 1.98.1) — this is the first PR I have seen that makes the workspace usable off Windows:

  • cargo build --workspace: ok (debug, 30 s).
  • cargo test --workspace --no-fail-fast: 162 passed, 0 failed, 3 ignored across the workspace. (Before this line of work, victory-gpu was the blocker on Linux.)
  • bash tests/offline-cli.sh target/debug/victory: OFFLINE CLI SMOKE TEST: PASS. The two Error: needs Windows (D3D12 / dxil.dll) lines are the expected off-Windows paths, not failures.
  • No textual conflict with HLE: SDL3 gamepad backend for the gameinput shim #312 (git merge-tree --write-tree pr438 pr312 clean).

Not covered: the macOS/aarch64 target and the workflow itself (this machine is x86-64 Linux, no Apple runner), and title data (none here). Still, the cfg(not(windows)) path the Apple job depends on is exercised end to end.

@pedrofort

Copy link
Copy Markdown
Author

@SkippySteve @DaviTostes Thanks for the independent validation and detailed feedback!

I've addressed the workflow and script suggestions in commit 4e107dd, including duplicate CI triggers, temporary directory handling and executable permissions.

All three smoke test scenarios passed on my Apple M5. It's great to see the updated commit also passing on Arch Linux with 162 tests and no failures.

I'll rebase once #235 lands to keep the diff focused and preserve proper attribution for SkippySteve's portability work.

I also agree on reusing the offline smoke test for Linux CI as a follow-up.

Really appreciate your contributions and testing!

@upipibi upipibi mentioned this pull request Nov 24, 2026

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the full Apple Silicon workflow locally on real Apple Silicon (macOS 26, arm64), rustc 1.98.1 (aarch64-apple-darwin), at head 4e107dd:

  • cargo xtask policy: 153 files ok
  • cargo check --workspace --all-targets --locked: clean (stricter than the workflow's --workspace)
  • cargo test --workspace --locked: all suites pass — 162 passed, 0 failed, 3 ignored (the PE-binary tests gated off non-Windows)
  • cargo build --workspace --release --locked: ok; file target/release/victory → Mach-O 64-bit executable arm64
  • bash tests/offline-cli.sh target/release/victory: OFFLINE CLI SMOKE TEST: PASS (DXIL container validation included; the two needs Windows errors are the expected skips)

The workflow does what it says and passes end-to-end on the exact head commit.

SkippySteve and others added 20 commits November 24, 2026 04:01
…fails it

The emit tests' Attr and Shader imports are used only by the host-validated
(cfg(windows)) tests; gate them with those tests so clippy -D warnings is
clean on Linux, and run the Linux job as clippy rather than a plain check.
… Windows

The own-binary tests are Windows-only; a hand-built PE32+ title (import,
TLS callback with its DIR64 relocation, bound imports, FORCE_INTEGRITY,
checksum) exercises prepare() on Linux, and the synthetic image covers the
RVA mapping, 4 GiB overflow and machine/PE32 rejections.
The kernel tests for GetModuleFileName and title/pseudo-module lookup use
Windows paths and are gated; these repeat them with Unix paths, adding the
exact-fit/zero-size buffer and forgotten-image edges, every as-data load
flag, a mismatched extension, and pseudo-module GetProcAddress by name and
ordinal.
The pass-through and own-binary import-size tests are gated to Windows.
These check, on any host, that our overrides answer before the policy at
any API-set version and case, that allowed DLLs go Missing with no host,
the policy's exact/prefix/case rules, and that a recorded import size of
zero, one descriptor short or padded all patch to the same terminator.
Formatting the crates touched unrelated sources; restore them.
The synthetic PE gains a delay-import descriptor (its own IAT, checked
against SizeOfImage like the ordinary one), forwarders by name and by
ordinal, the relocation/exception/load-config directory flags with
RELOCS_STRIPPED, every subsystem name, and the CodeView symbol key.
The storage test mounts a drive and is gated to Windows. This one checks,
on any host, that the path calls fail untouched without a drive, that used
space counts files at any depth but not links (a loop ends, an outside
target is not charged), the exact-rest prompt grant, and a quota shrunk
under saved data, set to zero, or a storage path naming a file.
The display test takes a host power request and is gated to Windows. This
one checks, on any host, that each display pair resolves to its object and
crossed pairs do not, that HDR stays SDR for any preference without
writing the info, that URIs and screenshots fail as unsupported, that the
shell table ends at the launch slot off Windows, and that the diagnostic
capture slots are unimplemented rather than crashes.
Off Windows, `run` refuses a title for every console and unimplemented
mode before reading it, and `translate` refuses validation and pipelines
before walking while translation alone still walks unreadable roots. The
host stand-ins (validator, device, stub vertex shader, every pipeline kind)
each report themselves unavailable.
Off Windows the host source reports every pad slot empty and no key down,
and rumble is a no-op, so a hub over it connects only the keyboard and its
idle stand-in pad: the four pad slots answer disconnected, the stand-in
reads at rest and the keyboard reads no keys.
The device-type key was gated to Windows whole, though only its fallthrough
to the host's advapi32 needs Windows. Off Windows there is no host registry
behind our key: other keys are missing and handles we never gave out are
refused. The key's tests now run on any host, with new edges for size-only,
type-only and data-without-size probes, a null value name and a null subkey.
Co-authored-by: Cursor <cursoragent@cursor.com>
The host-only paths stay gated; these cover argument refusals for device
creation, tiled page-pool registration, committed and address-backed
resources, and null pipeline descriptions on any host.

Co-authored-by: Cursor <cursoragent@cursor.com>
elgreams and others added 4 commits November 24, 2026 13:43
device::tests::newer_device_levels_are_the_same_device sets the global
NEWER flag, so queues created after it use the newer layout and the fixed
offsets in host_free_tests land on other methods: three tests failed and
timestamp_frequency_refuses_null_and_reports_the_rate hung.

at(q, offset) reads the queue's own table, as tests::signal_slot does,
and moves the offset with newer_slot.
@pedrofort pedrofort changed the title CI: native Apple Silicon builds and synthetic offline shader tests CI: consolidate Linux and native Apple Silicon offline validation Nov 24, 2026
@pedrofort

Copy link
Copy Markdown
Author

Additional offline regression coverage validated on Apple M5
at 98e01ff90e15d80899d9d6117822b1d9df63cd41.

  • 12 deterministic translation runs: jobs=1,2,4,64,
    three runs per worker count.
  • Multiple synthetic containers in one file exercise
    actual per-file parallel translation.
  • Identical SHA-256 multisets across all runs.
  • DXBC part overlap, DXIL program bounds and LLVM
    bitcode header checks.
  • GitHub Actions job summaries and synthetic diagnostic
    logs retained on failure.

The previous consolidated candidate passed 271 workspace
tests, with 0 failures and 5 ignored. This follow-up changes
only tests and CI, not production Rust code.

Thanks to the portability contributors and previous
independent reviewers. Further Linux/macOS retesting
is welcome.

AI-assisted with ChatGPT. No game assets.

@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because it is outside the project's scope (VIctory targets Windows hosts; ports, launchers and tooling for other platforms are not being taken).

Re-packages #235 and adds macOS/Apple Silicon and Linux CI workflows with a 330-line shell test: a bundle, and CI for hosts the project does not target.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

@Marvisak Marvisak closed this Nov 25, 2026
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
Unreachable CFG predecessors left empty outs during rename, so phi.args
got NONE (Value(u32::MAX)) and remove_trivial_phis panicked in release.
Prune blocks unreachable from entry (and re-prune in rename if needed)
so SSA never sees those edges. Refs Marvisak#438 Marvisak#440 (VIC-BT-002).

Co-authored-by: JMAN730 <JMAN730@users.noreply.github.com>
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
When LaneExit::Branch has taken == not_taken, calling edge() twice
overwrote the first critical-edge block under the same (from, to) key
and left fill_phis missing a CondBr predecessor. Treat that case as an
unconditional jump (VIC-BT-007 / Marvisak#438/Marvisak#440).

Co-authored-by: JMAN730 <JMAN730@users.noreply.github.com>
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.

6 participants