d3d12: build and test the workspace natively on Linux #3176
Closed
kett1m wants to merge 4 commits from
upstream-pr/3176 into main
pull from: upstream-pr/3176
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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.
Reference
ProjectLeonida/mandy!3176
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3176"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T16:30:49Z.
Claimed in the coordination issue as: D3D12-RUST-WORKSPACE-LINUX (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7352047329)
Depends on: (none)
Fixes: (closes none)
What and why
The
d3d12/Rust workspace (leonida.exeand its crates) was Windows-only, and the only CI workflow ran on windows-latest (with a note that Linux follows #2577). Finish the migration of the inline#[cfg(windows)]gates so the workspace builds and tests natively on Linux, alongside Windows, without changing Windows behavior:hostaccessors, dialogs and other display-dependent pieces, the line/behindmachinery); portable shims return honest no-ops (a fallback orNone/0, not a failure) instead of failing.C:\...,\\server\share\file.dll) are matched by file name on any host, soGetModuleHandleW/GetModuleFileNameW/image_namedwork off Windows: the file name comes fromPath::file_nameon the host's own paths (exact) and from a separator split only for the title's own verbatim Windows-style paths, which a Linux host does not understand. The file name itself comes fromPath::file_nameon the host's own paths (exact, including trailing separators and non-UTF-8 components) and from a separator split only for the title's own verbatim Windows-style paths, which a Linux host does not understand...segment, relative-host-path made absolute, trailing separators, non-UTF-8 file names — and four the clwb coverage).leonida's validator and host-pipeline extras are skipped off Windows (reported as skipped, not silently ignored); the portability-checked commands (inspect,census,lib-exports,shader-info,translate,shaders,config) run;runsays it needs Windows and stops.d3d12-linuxjob mirrors the Windows one (build, shipped build, tests, policy, clippy; the replay test is skipped there — its test is Windows-gated). docs/linux.md: the workspace row and the Linux build commands, and the building-natively-vs-running-the-title distinction.One behavior-affecting change, and only on hosts that do not understand the title's own paths:
stored_pathkeeps the title's Windows-style absolute paths (drive letters and UNC) verbatim — the title's own paths, e.g.C:\title\..\game.exe, are recorded exactly as the title names them — while on the title's own host the standard normalization applies exactly as before. Relative host paths are made absolute either way. Both pinned by tests.Note on behavior:
translate/shaderson Linux report every shader as "no host" (the validator and host pipeline extras are skipped) — honest, but the cache is not used.Tested
cargo test --workspace --exclude xtask --locked— all suites green (leonida-hle 159, ...)cargo test -p leonida-gpu --features diagnostics --test replay --locked— 0 tests on Linux (its test is Windows-gated)cargo build -p leonida --features diagnostics,mimalloc --locked— builds as shippedcargo test -p xtask --locked— the asset-policy test fails with the same 3 violations as on Windows (host.rs / lower.rs over the 640 KiB limit, amplify_dxil.rs hex-literal count); reported, not blockingleonida configprints,leonida run some.exereports "running titles requires Windows" and exits,leonida inspect --helpworks,warm/replayare absent on Linux (as designed)python3 -I scripts/check_no_game_data.py— no output (clean)cargo test -p leonida-hle --lib— includes the new portable path tests (the non-UTF-8 test fails without the exact-name fix)python -m unittest discover -s tests -p "test_docs_*.py"— 57 docs tests greenGPUs tested: n/a — no GPU or game data needed (the tests are GPU-independent and skip themselves when they need one)
AI-assisted: yes — Inkling 2 Mini (authoring agent), with a separate read-only Claude Opus 5.5 review
Reported, unchanged from Windows (report-only in CI):
xtaskasset-policy test;cargo clippyfindings; ~84 dead-code warnings on Linux in windows-only-caller chains (descriptive, not blocking)Checklist
mainand merges cleanly (branch is a single commit from current main)Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-02T16:57:46Z.
Review: COMMENTED
CI is green on both d3d12 jobs (ubuntu 3m17s, windows 8m10s), and the Linux log confirms the new portable tests actually run and pass (3 path + 4 clwb = 7; the body says eight). The gate is real:
d3d12-linuxrunscargo test --workspace --exclude xtaskwithoutcontinue-on-error, andrunstill bails cleanly on Linux. The Windows-only parts becoming honest no-ops (line disabled, directValueWait, gated host heaps/view_format/allocator hooks) is the right shape. Thestored_pathguard is mutation-covered (left: "C:\\game.exe",right: "C:\\title\\..\\game.exe").One docs distinction to fold into the Linux rewrite:
docs/linux.md:163-165says "what does build natively is everything that doesn't touch Win32", which now reads against a workspace that builds by stubbing Win32 but cannot run titles. Say "builds and tests" vs "runs the title" explicitly.Heads-up: #2878 edits the same
leonida-pe/src/image.rsgated test block, so one of the two will need a rebase. This PR also adds a row/commands todocs/linux.mdand a job tod3d12.yml, which the planned docs rewrite and any CI PR will overlap.Minor:
image_namednow usesto_string_lossy().rsplit(['\\','/']), which changes non-UTF-8 and trailing-separator behaviour versusPath::file_name; a fallback to thePathAPI would keep it exact.No blocking code issues found; merge-tree is clean (
d7c08a16).Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T17:06:16Z.
Review: COMMENTED
I tested
43c4f3e01merged withmain5b1fff821on x86_64 CachyOS (Rust 1.98.1).cargo build -p leonida --features diagnostics,mimalloc --lockedbuilt successfully. WithRUST_LOG=info,cargo test --workspace --exclude xtask --locked --no-fail-fasthad 758 passes and 11 ignored. No game files or GPU were needed, and I did not repeat the Windows job.One local-test caveat explains the discrepancy with the green fork run.
RUST_LOG=warn cargo test -p leonida --test settings_line --lockedfails because the inherited filter hides thesettingsINFO event. The same test passes withRUST_LOG=info.apps/leonida/tests/settings_line.rsis unchanged by this PR. Setting a known filter on the test subprocess would make the existing assertion independent of the reviewer's shell.AI-assisted: OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T17:48:21Z.
Thanks — both items folded in,
715c8ee.docs/linux.md: the
buildvsrunsdistinction now stated in theWhy there is no native Linux gta6rtsection and in the workspace row: the workspace builds and tests natively (Win32 parts gated or stubbed), butleonida.exedoes not run the title there — it is a Windows program under Wine or Proton, likegta6rt(the native binary is not the one a Linux player plays). The earlier row told the same thing only through the CI link.image_named exactness:
image_name()now usesPath::file_name()— exact for the host's own paths (trailing separators and non-UTF-8 components) — and falls back to the string split only for the title's own verbatim Windows-style paths (which a Linux host cannot understand). Regression tests: trailing separators (host and Windows-style) and a non-UTF-8 file name; the non-UTF-8 test fails without the exact-name base (red-green verified). Windows path with trailing separator:C:\title\→title.Tested:
cargo test -p leonida-hle --lib(13 runtime tests),cargo test --workspace --exclude xtask(31 suites green), docs tests (57),check_no_game_data.pyclean, fmt clean on the changed block.Noted: #2878 also edits the same
leonida-pe/src/image.rsgated test block — whichever of the two PRs lands second needs a rebase. Left as-is deliberately (no duplicate gates).Also: the body now pins the actual new-test count (10: six path + four clwb, as the Linux log shows) instead of "eight".
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T17:57:38Z.
Fork CI green on
715c8ee— both jobs (d3d12 windows-latest, d3d12 ubuntu-latest),D3D12 runtime/ workflow_dispatch 46934506671. Review items addressed and merged into the branch at715c8ee; body updated to the actual test counts.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:11:37Z.
Verified #3176 natively on Linux: merged onto current
mainthe workspace builds and all its tests pass (761 passed, 0 failed, 11 ignored);mainalone does not build on Linux. Two points to settle before merge: a small Windows behaviour change instored_path, and the model disclosure.715c8eed2fmain45dc41f95c(clean merge treeb6d6d1f5cc; merge base3c106eb2ff, 21 commits behind), exported whole (withmods/, whichleonida-lua's tests read)d3d12/rust-toolchain.toml), 4 cores, no GPU, no game filesRan (from
d3d12/)That is the red/green for the PR's claim: red on
main, green with the change, same toolchain and target directory. A first run from an export ofd3d12/alone had 6leonida-luafailures (NotFoundatcrates/leonida-lua/src/tests.rs:1166/1267); they come from the missingmods/folder in that export, not from the PR, and passed once the whole tree was exported.Review (Windows side not built here)
d3d12/crates/leonida-hle/src/runtime.rsstored_path: on Windows,Path::is_absolute()is true forC:\title\..\game.exe, so it is now stored verbatim wherestd::path::absolute(GetFullPathNameW) used to giveC:\game.exe. Drive-relativeC:fooand root-relative\fooare also kept as they are instead of being completed with the current drive or directory. The title reads these back throughGetModuleFileNameW. The description names the change, but it conflicts with "without changing Windows behavior". Either keepstd::path::absoluteon Windows (#[cfg(windows)]) and keep the verbatim rule for non-Windows hosts, or say in the PR why the title is better served by the unnormalized form.d3d12-linuxCI job mirrors the Windows one (build, shipped build, tests as the gate, policy and clippy as reports) and uses pinned action SHAs. Good: it will keep the Linux build from regressing.#[cfg(windows)]gates, this will touch many open d3d12 pull requests. The sooner it lands, the less rebasing.Verdict: defects (minor). The Linux build and tests are confirmed. Item 1 needs a decision or a
cfg(windows)guard, and item 3 needs a maintainer's call; no check runs are recorded on the head yet.AI-assisted: Claude Opus 5.5 (Claude Code), verification only.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T18:37:29Z.
MoonEyes' review, item 1 (stored_path Windows behaviour): fixed in
ae0075d.stored_pathnow keeps the originalstd::path::absolutenormalization on Windows (#[cfg(windows)]) and keeps unrecognized Windows-style paths verbatim only on hosts that do not understand them (Linux). Windows behavior is unchanged by construction. The verbatim/normalized test pins both forms (..segment:C:\game.exeon Windows,C:\title\..\game.exeoff Windows).Verified locally, natively (Linux, tests green) and on the cross-built Windows PE under the system Wine prefix (
runtime::tests: 12/12 green there, including the Windows-form expectation; the 3 failing full-suite tests — net, xgamesave, xmem — are unrelated modules and Wine-environment failures, not this change).cargo test --workspace --exclude xtask: 31 suites green.Item 3 (model disclosure) is the maintainer's call, not a code fix — the PR names the actual model used (Inkling 2 Mini for the authoring agent) as CONTRIBUTING.md asks for honest disclosure; CONTRIBUTING.md's model list is a naming convention, so I left it and do not unilaterally promote it past what the repo lists. Item 2 (CI job) is as-is; item 4 (future rebasing) noted.
Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-12-02T18:43:16Z.
macOS check of
ae0075d9a: on an Apple M3 (arm64), the workspace builds and its tests pass once one test is kept to x86_64.MEASURED on an Apple M3, macOS 26.5.1, with the pinned Rust 1.98.1 (
aarch64-apple-darwin):ae0075d9acargo build --workspace --all-targets --lockedleonida-loader(lib test),unrecognized instruction mnemonicatcrash.rs:857(pushfq,pop)crash.rscargo build -p leonida --features diagnostics,mimalloc --lockedcargo test --workspace --exclude xtask --locked, 3 runsREAD IN CODE: this PR adds copies of
native_compare(x86asm!:cmp,pushfq,pop) andcompare_sets_flags_like_the_cputoportable_tests, which is#[cfg(test)]only. On main they existed only inmod tests, in a crate that only builds on Windows. So any non-x86_64 host fails to build the tests, Linux on arm64 included. Theubuntu-latestjob is x86_64, so CI won't show it. Not measured on Linux arm64.The change I used, in
d3d12/crates/leonida-loader/src/crash.rs(the third line keepsCMP_FLAGSfrom becoming an unused constant on arm64):The other
portable_testscases (clwb_loops_decode_the_loop,clwb_lengths_decode,clwb_loop_end_skips_past_a_finished_loop) are plain byte decoding and pass on arm64.Since
leonida-gpubuilds on macOS with this PR, thed3d12.ymlcomment "macOS is not covered yet: leonida-gpu does not build there" looks out of date. That is only about building and the no-GPU tests; I am not proposing a macOS CI job.Checked by a separate reviewer agent on the same machine (logs and code re-read); not by a second human yet.
AI-assisted: yes (Claude Code)
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T18:49:54Z.
Fork CI green on
ae0075d— both jobs (d3d12 windows-latest, d3d12 ubuntu-latest),D3D12 runtime/ workflow_dispatch 46942357491.Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T19:50:36Z.
Sync: merged upstream/main (
b41763227) into the branch (5f92e0508) so the PR carries current main. No conflicts (upstream touched none of this PR's files); full workspace suite re-run on the merge — 31 suites green; the diag exe rebuilt on the merge commit. Fork main stayed local per the never-push-to-main rule (it fast-forwarded locally tob41763227); push it when you want.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T20:10:08Z.
Native Windows 10 regression check for PR #3176 (
5f92e0508) merged cleanly ontomain(f1a559851, Rust 1.98.1):python -I scripts/check_no_game_data.pyPASS.cargo check --workspace --all-targets --locked-- PASS (zero errors on Windows).cargo test -p leonida --locked: 43 unit + 5 integration (agility,census,settings_line) passed, 0 failed.cargo test -p leonida-lua --lib --locked: 44 passed, 0 failed.Verdict: PASS (native Windows build/test regression check clean; Linux build covered by CI).
AI-assisted: yes (Antigravity).
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T20:54:40Z.
Re-authored the merge commit:
5f92e0508was committed by a plaingit mergeand picked up the ambientRalph <ralph@local>from the environment's git config instead of the repo'skett1midentity (the other three commits were made with explicit-c user.name=). Amended and force-pushed asa055aea74: same merge content, nowkett1m <[email protected]>, both as author and committer.Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T21:02:57Z.
Redone: a read-only review of the full diff was run with Claude Opus 5.5 (separate reviewer agent, read-only audit of the final branch contents — stored_path normalization, the image_named exactness fix, docs distinction, and the merge with upstream/main). No new findings to block the merge.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T21:40:11Z.
RUN (independent run on Windows, head
a055aea74e26397440c77d0021b3864f0ce7274c, merged intomain8877be372bac025153488fc56c2b6122f98ec44dwithgit merge --no-ff)That merge was clean, no conflict (merge commit
384233bd1, local only). The results below were measured on that merge.mainhas moved since (see "Conflict with current main"), so they do not carry over to a merge with currentmain.Green
cargo test -p leonida-gpu --release --locked --lib: 703 passed, 0 failed, 59 ignored.cargo test -p leonida-gpu --release --locked --features diagnostics --lib: 784 passed, 0 failed, 59 ignored. Run becauseswitch.rs(toggled!/asked!) now gates theabpath onall(windows, feature = "diagnostics").cargo test -p leonida-hle --release --locked --lib(where the new tests live): 253 passed, 0 failed, 2 ignored. In theruntime.rstest module there are 9 tests, 8 of which run on Windows, 5 of them the new path tests (the non-UTF-8 one is unix-only).Red
The new tests are portable path tests. On Windows,
Path::file_namealready understandsC:\..., so main's version ofimage_namedpasses most of them: they are not red on Windows by construction (their value is on Linux, which I did not run). So I mutated the new code inruntime.rs(one at a time, restored after each), running theleonida-hlelib tests of that module:image_namedback top.file_name(): survives (all 8 Windows-run tests of the module pass).image_nametakes the first split segment instead of the last non-empty one: survives. The Windows-style trailing-separator test never reaches that branch on Windows.Path::file_namebranch ofimage_namedisabled: survives.stored_pathreturns the path unchanged: killed bya_relative_host_path_is_made_absoluteanda_windows_path_is_verbatim_not_normalized.Numbering corrected: an earlier draft skipped M2 and quoted "10/10", which matches no test set in the diff; that count is withdrawn.
So on Windows, only the
stored_pathWindows behaviour is pinned (1 of 4 mutations killed). Theimage_namesplit logic is covered only by the Linux CI job.Review
leonida-gpudiff, Windows side: mostlycfggating andlet _ =for unused variables. Also:toggled!/asked!inswitch.rslose#[cfg(windows)]and are now exported on every platform (theirabpath isall(windows, diagnostics)).queue.rsgains a non-Windowsbehindstub module (on()returns false,alias_laterruns the work inline) and a non-Windowsbehind_lineno-op;before_sync,line_on,queuedetc. lose#[cfg(windows)]but still call the samebehindon Windows.stored_pathkeepsstd::path::absoluteon Windows (fixed after the review by MoonEyes).LEONIDA_WAIT_ASK(list.rs,ValueWait): on Windows, withLEONIDA_WAIT_ASK=1the wait returns true when the address is not committed (crate::texture::committed). Off Windows,askedis just the env flag, so withLEONIDA_WAIT_ASK=1the wait always returns true without reading memory. With the variable unset the normal path runs. Nothing changes on Windows.ValueWaitread: on Windows the value is read throughcrate::host::read_into, a guarded read that makes the wait return true when it fails. Off Windows it becomes an unguardedunsafecopy_nonoverlapping. The risk is the lost fault-safe read: a bad address faults instead of returning true. No host runs the title off Windows, so it is not exercised; this is by reading the diff, not measured.d3d12-linux(.github/workflows/d3d12.yml, +52 lines,ubuntu-latest), the main deliverable: build, build as shipped (diagnostics, mimalloc),cargo test --workspace --exclude xtask --lockedas the gate, asset policy and clippy as reports.docs/switches.mddoes not need regenerating.d3d12 (windows-latest),d3d12 (ubuntu-latest),no-game-data,check,semantic-testsand the others).715c8eed2fmerged on a then-currentmain): workspace builds and 761 passed, 0 failed, 11 ignored;mainalone fails to buildleonida-gpu(6 errors). Raised thestored_pathWindows change and the model disclosure; the author reportsstored_pathfixed inae0075dand the body now carries a model disclosure.docs/linux.mdbuild-vs-run wording (author reports done in715c8ee) and warned that #2878 edits the sameleonida-pe/src/image.rsgated test block, so one of the two needs a rebase.43c4f3e01): 758 passed, 11 ignored; the existingsettings_linetest fails under an inheritedRUST_LOG=warn, a test this PR leaves unchanged.ae0075d9a): BLOCKER, measured.cargo build --workspace --all-targets --lockedfails inleonida-loader(lib test):unrecognized instruction mnemonicatcrash.rs:857(pushfq,pop), because the PR addsnative_compare(x86asm!) andcompare_sets_flags_like_the_cputoportable_testswithout an x86_64 gate. With a 3-linetarget_arch = "x86_64"gate the workspace builds and 760 passed. I re-read the PR heada055aea7:native_compareandcompare_sets_flags_like_the_cpuare still ungated in#[cfg(test)] mod portable_tests(crash.rslines 853 and 873; the copies at 1223 and 1234 are in the Windows-onlymod testsand play no part in the arm64 failure) andCMP_FLAGSis still#[cfg(any(windows, test))]. The blocker is unresolved on this head. I did not run it on arm64 myself.5f92e0508):check_no_game_data.pyandcargo check --workspace --all-targets --lockedpass.list.rs(execute_indirect,ValueWait) andqueue.rs. By reading, these are cfg-neutral on Windows, but under the render-PR rule (a 300 s in-game run without device loss before merge) the run is required and is missing.Conflict with current main
git merge-tree --write-tree origin/main refs/rgr/3176(read only;mainf3865cae, PR head unchanged) reportsCONFLICT (content): Merge conflict in d3d12/crates/leonida-pe/src/image.rs. #2878 merged intomainand edits the same gated test block, as KelboLive foresaw. GitHub shows the PR as DIRTY (mergeable= CONFLICTING). I did not build or test that merge, and no cargo was run on it.Not covered
leonida-loaderand other crates, the replay test, andcargo clippy.main.Verdict
PARTIAL, not mergeable. Windows is green on the earlier merge and the gating looks neutral for Windows, but three points are open: (1) the PR conflicts with current
maininleonida-pe/src/image.rs, so it needs a rebase and a new run; (2) Tauwni's measured arm64 build failure incrash.rsis not fixed on this head; (3) the required 300 s in-game run on this head is missing. Also, the Windows run pins only 1 of 4 mutations; the rest rests on the Linux CI job.AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge.
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T21:53:58Z.
Read-only re-review of the full diff (head
4c31594b5, rebased ontof3865cae8) — Claude Opus 5.5, read-only audit.Rebase / conflicts. The branch is now a linear replay of the 3 PR commits onto current main:
e4a864e57(native Linux build),16b37fd73(image_named exactness),ef785aee9(stored_path Windows), plus a new fix commit4c31594b5. The image.rs conflict with #2878 is resolved by taking upstream's portable version (synthetic_pe_image + cfg(windows) only on own_image and parses_own_test_binary); the branch's now-redundant gates are dropped. The redundant sync merge commit from the previous rebase is gone; 4 commits, all kett1m [email protected].Fixes on this head
057cc94d8(pre-existing on main, was failing E0599).Read-only audit of the full diff (27 files): cfg-neutral on Windows; stored_path keeps std::path::absolute on Windows, verbatim elsewhere; image_name is Path::file_name exact for host paths (trailing separators, non-UTF-8 bytes), separator split only for the title's own verbatim paths; the 6 new path tests pass natively on x86-64 (all 4 clone-in-window-style cases included). The non-Windows behavior changes are the documented ones: validator/host-pipeline extras skipped (reported as skipped), ValueWait's read is now an unguarded copy_nonoverlapping off Windows (a bad address faults instead of returning true — not exercised off Windows, consistent with the note), queue's behind_line is a no-op off Windows. docs/linux.md states the builds-vs-runs distinction and the new CI job.
Not verified here: the Windows run on this head (fork CI in progress, run 46978985860), the arm64 build (Tauwni's fix is cfg-gating, reviewed but not run on arm64), the in-game run (maintainer's 300 s rule — none posted on this head). Full workspace suite is green on x86-64 Linux (31 suites, 0 failed).
AI-assisted: yes — Inkling 2 Mini (authoring/executor), separate read-only Claude Opus 5.5 review.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T22:24:23Z.
RUN (independent run on Windows, head
4c31594b5a746358dc713b847bfdb21525c22c53, merged intomainf3865cae87c963952067743a2684a9c2c3aaea5bwithgit merge --no-ff)The head is the one the author named (
gh pr viewreports4c31594b5). The merge was clean, no conflict (merge commit7b9b51a2a, local only, nothing pushed). 27 files, +465/-34 againstmain.Green
cargo test --workspace --exclude xtask --lockedind3d12/(Windows 11, x86_64-pc-windows-msvc, debug profile): 32 test binaries (doctests included), 1735 passed, 0 failed, 75 ignored. No build error. Wall time 22 min (shared target dir, cold).leonida-loader, bothcrash::portable_tests::compare_sets_flags_like_the_cpuand the Windows-onlycrash::tests::compare_sets_flags_like_the_cpurun and pass (x86_64 satisfies the gate), as do the 3 clwb tests ofportable_tests.Author's claims checked
crash.rs,native_compare(pushfq/popasm!) andcompare_sets_flags_like_the_cpuinmod portable_testsboth carry#[cfg(target_arch = "x86_64")]; the clwb tests andclwb_loop_endstay ungated and portable. The copy in the Windows-onlymod tests(now#[cfg(all(test, windows))]) got the same attribute on the test. This is the fix for Tauwni's arm64 blocker (unrecognized instruction mnemonic). I could not confirm it on arm64 myself (see Red).leonida-pe/src/image.rsis one deleted blank line; the gated test block is main's (the #2878 version)..unwrap()fix: confirmed, and it is real.main(f3865cae8) hasRuntime::new(fake.clone(), Config::default()).unwrap()atleonida-lua/src/tests.rs:1089, butRuntime::newreturnsRuntime, not aResult. The PR removes the.unwrap(). See Red.leonida-gpu:list.rs(execute_indirect,ValueWait) keeps the Windows lines as they were, only moved behind#[cfg(windows)]/let _ =for non-Windows. On Windows theLEONIDA_WAIT_ASKtest is stillenv flag && !committed(...), the read is stillhost::read_into.queue.rsandswitch.rs:toggled!/asked!lose#[cfg(windows)]and the diagnostics path becomesall(windows, feature = "diagnostics"), so Windows picks the same branch as before.leonida-hle:SetThreadPrioritynow goes throughhost::set_thread_priority, which on Windows is the samewindows_syscall; the non-Windows stub returns 1.leonida-loader:crash.rsis gated#[cfg(windows)]/any(windows, test), so Windows still has everything it had.kernel.rsthe doc comment "Our caller's callers, asmodule+rva." now sits aboveset_thread_priorityinstead ofcallers().gh pr checks 3176): all pass:d3d12 (ubuntu-latest)2m37s,d3d12 (windows-latest)8m8s,check,semantic-tests,linux-python-and-viewer,no-game-data,jactionlint,change-scope.Red
.unwrap()fix, demonstrated: withleonida-lua/src/tests.rsput back to main's version,cargo test -p leonida-lua --lib --no-run --lockedfails:error[E0599]: no method named 'unwrap' found for struct 'Runtime'attests.rs:1089:64,could not compile leonida-lua (lib test). With the PR's version it builds and the suite is green (above). Somaincurrently cannot build the lib tests ofleonida-lua, on Windows too; the PR fixes that. (File restored after the check.)rustup target list --installedshows onlyx86_64-pc-windows-msvc, socargo check --target aarch64-pc-windows-msvc --testsis not possible here, and I did not install a target. On x86_64 Windows the gate is true, so removing it would not turn anything red; a Windows run cannot tell the gate from its absence. The red for the gate is Tauwni's measured arm64 failure on the earlier head; whoever has an arm64 or Linux aarch64 machine should runcargo build --workspace --all-targets --lockedon this head.Not covered
d3d12 (ubuntu-latest)job and reviewers' runs speak for them.leonida.exewas not running during my builds, and I did not start it.cargo clippy, the diagnostics-feature build, and a release-profile test run (I ran the default debug profile).Verdict
PARTIAL, leaning PASS for the code. Clean merge on current
main, Windows workspace tests green (1735 passed, 0 failed), the three author claims I could check hold, CI green, and the PR also repairs aleonida-luatest build that is broken onmain. Still open: (1) the x86_64 gate fix is unconfirmed on arm64 by me; (2) the in-game run on this head is still required before merge (300 s, no device loss), since the diff touches Windows runtime code inlist.rsandqueue.rs; (3) the PR changes.github/workflows/d3d12.yml, so a maintainer queues it.AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge.
Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-02T23:09:31Z.
Status on the current head (
4c31594b5), updating the review above:CI: green end to end — 46989376570 (d3d12 windows-latest + ubuntu-latest, both success). The "windows still running" note from earlier is stale.
Verified on this head
f3865cae8(no merge commit). image.rs carries the one-line diff (deleting a blank line) against main's version; the gated test block is main's #2878 block (own_image gated to Windows, synthetic_pe_image portable).Still open, honestly
Workflow: the two artifact-upload commits were deleted pending maintainer agreement on running artifacts with checksum in the repo; the branch is back to the original d3d12.yml (the ubuntu job). The Windows folder (PR-3176/) ships an exe built from this code and verified against its CI checksum in run 46987389043 (the deleted head's artifact; same code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T23:32:34Z.
RUN (in game, batch of five pull requests), each head merged with
git merge --no-ffonto mainef35d683e, in one build: #31764c31594b5, #2657c16b0424e, #2807e2572082c, #323097eefdee4, #32473e5887f65. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches today. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. #3247 has since moved to
3dc6c58b3, which only mergesmain(81efe4566) into the head above:git diff 3e5887f65 3dc6c58b3leavesd3d12/scripts/play-nvidia.ps1andtests/test_win_launchers.pyunchanged. If another of these pull requests changes its head, this run no longer covers it.Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used becausemainnow precompiles every known pipeline by default (88,631 for a new executable, over an hour on this card). The default start was therefore not exercised, and the F1 SAVE AND RESTART path of #3247 was not exercised in game. An earlier attempt of this batch is not counted: the run script gave up waiting while that full precompile ran.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T23:57:04Z.
VERIFY-3176 — Windows nativo:
red then greenen el decodificador del informe de cuelgue; y su parte de Lua ya está enmain4c31594b5— but the branch carries 27 files / +465:leonida-loader/src/crash.rs(+116, the work),leonida-lua/src/tests.rs(2),crash.rsgate,d3d12.ymlRan at the head
Negative control (synthetic): I changed the ModRM
/regfieldclwb_lenrequires (from/6to/0), rebuilt and ran:It bites.
The good part, and it is the reason I am not just filing this one away: the CLWB-loop decoder is pure byte-slice work with no Windows state, and it is tested on every platform (
portable_tests, gatedcfg(any(windows, test))) — including a test that compares the flags against a realcmpexecuted by the CPU (native_compare,x86_64only, skipped elsewhere). That is the strongest kind of test in this repository: the oracle is the hardware.And the part that needs saying before it merges: the
leonida-lua/src/tests.rshunk —let mut rt = Runtime::new(...)without.unwrap()— is already onmain(via #3244,a22fa26d6). It is the same one-line fix, so it will merge as a no-op at best; the description should drop it rather than carry a second copy that a future rebase has to reconcile.What I could not test
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T00:01:07Z.
Review: COMMENTED
Native Linux follow-up on
4c31594b5merged ontomainat81efe4566. With Rust 1.98.1 and a clean environment, the workspace all-targets build and thediagnostics,mimallocbuild both succeeded.cargo test --workspace --exclude xtask --locked --no-fail-fasthad 768 passed, zero failed, and 11 ignored. The Lua test file matches currentmainbyte for byte in the merged tree.The settings-log sensitivity from my earlier review is still reproducible on this merge. With only
RUST_LOG=warnadded,settings_linefails. With the test-file change from #3183 (190cd347) it passes in the same environment.Merge-order note for #2930 (
8d149898). Git reports a conflict in.github/workflows/d3d12.ymlwhere both branches append a job. In a scratch resolution, I kept #2930’s Windows jobs andmerge_grouptrigger, retained this PR’s Linux job, and put that job behind the samescopeoutput. The resolved YAML preserved both Windows job definitions, and the 12 synthetic cases for the workflow’s actual scope script passed, including docs-only changes, mods, and the aggregate merge-queue diff. That combined workflow was checked locally. AI-assisted.Imported from ubiquitarianism/leonida. Originally posted by kett1m on 2026-12-03T00:02:28Z.
Update — the fork branch now carries an artifact/checksum CI workflow and a fix for the flaky scan test, both fork-only.
fork/pr-3176-artifact = this head (
4c31594b5) + two fork-only commits:CI green on both jobs: 46997581567 (ubuntu + windows). Exe SHA-256 21312c0930659020ce8cbcf5ed376a2e7eb90c786bc6062ced3dddf2c6c27504, checksum-verified against the run log.
PR branch is untouched at
4c31594b5(no fork commits in the PR).Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T18:03:05Z.
Thanks for the work on this. This pull request has a merge conflict with the current
mainand has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latestmaininto your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome.Generated by Claude Code
Pull request closed