wine: fold umem-unix and umem-pe into vkback-unix and victory_gpu::unixgate #224

Open
github-bot wants to merge 2 commits from github-bot/gh-224 into main AGit
Owner

@⁠waldirjunior on GitHub · 2026-12-02 15:07 UTC · original
waldirjunior:refactor/one-unix-library → main · +955 −1163 · 19 files · 2 commits · open

Coordination note (Rule 31):

  • PR #202 overlaps with this PR in apps/victory/src/run.rs, crates/victory-hle/src/modules/umem.rs, and greenfield/tools/policy/toggles.txt (both add an eager validate_switches() call at startup and touch VICTORY_UMEM_SO). Whichever PR merges first, we will align the other so both validate_switches() calls coexist cleanly and VICTORY_UMEM_SO is read and validated in a single place (crates/victory-gpu/src/unixgate.rs).
  • PRs #169 and #180 also touch greenfield/wine/codes.rs / greenfield/wine/vkback-unix/src/lib.rs, with distinct, non-competing scopes.

What

Completes the docs/TASKS.md (Architecture cleanups) item One unix library (docs/TASKS.md is not edited, per rule 29).

Consolidates the legacy umem-unix / umem-pe pair into a single Wine unix library (vkback-unix), a single PE loader (victory_gpu::unixgate), and a single call-code table (greenfield/wine/codes.rs):

  • Single unix library and call-code table (greenfield/wine/):
    • Removed the legacy greenfield/wine/umem-unix and greenfield/wine/umem-pe crates and pruned them from greenfield/wine/Cargo.toml and greenfield/wine/Cargo.lock.
    • Consolidated greenfield/wine/codes.rs into one contiguous 21-opcode table (0..OP_COUNT), dropping 11 unused prototype/umem-test-only opcodes (OP_HELLO, OP_CREATE_BO, OP_MAP_FD, OP_CLOSE_FD, OP_COMMIT, OP_VIEW, OP_PROTECT, OP_POOL_DESTROY, OP_LOCATE, OP_GPU_COPY, OP_GPU_FILL).
    • Built vkback-unix's __wine_unix_call_funcs table at compile time from codes.rs indices (build_table), and extended greenfield/vkback/tests/policy.rs to verify exact 0..OP_COUNT contiguity (no gaps, duplicates, or count drift) and enforce a single Wine unix library and loader (one_wine_unix_library_and_loader).
  • Single PE loader and eager switch validation (crates/victory-gpu/src/unixgate.rs, apps/victory/src/run.rs):
    • Replaced the duplicated Wine NtQueryVirtualMemory(1002) loaders and VICTORY_UMEM_SO reads in crates/victory-gpu/src/vklive.rs and crates/victory-hle/src/modules/umem.rs with one shared victory_gpu::unixgate loader (single default /tmp/libvkback_unix.so, private Dispatcher / dispatch, and bounds-checked UnixLib::call).
    • Added eager startup validation victory_gpu::unixgate::validate_switches() at the top of apps/victory/src/run.rs (before CPU checks, title loading, threads, or unixlib loading). Rejects non-UTF-8, empty/whitespace-only, relative paths, embedded NUL bytes, and UNICODE_STRING UTF-16 length overflow; load_once() also fails loudly on parse error rather than silently falling back.
  • Two latent bugs fixed during consolidation (greenfield/wine/vkback-unix/src/lib.rs):
    • Restored the OP_UNVIEW a2 & 1 failed-remap timeline hook (UMEM_TIMELINE) that had suffered copy-drift between umem-unix and vkback-unix, reading a[2] before borrowing &mut Call so a failed PE remap records the timeline event without invoking a sparse Vulkan unview.
    • Guarded vkback-unix FFI buffer handlers (last_error, live_events, live_remap, live_remaps, live_guards, live_done) against null pointers, zero capacities, and 2 * n overflow before constructing slices or draining internal state (plus catch_unwind in live_remaps and // SAFETY: comments on every touched unsafe block).
  • Policy and documentation cleanup:
    • Removed dead umem-test switches (UMEM_SPARSE, UMEM_UNIX_SO) and updated VICTORY_UMEM_SO in greenfield/tools/policy/toggles.txt.
    • Updated stale references in greenfield/README.md and docs/learnings/wine-unixlib.md (marking the superseded entry per rule 28).

The reference

No vkd3d-proton / D3D12 counterpart — this is internal Wine unixlib boundary and PE-to-Unix loader infrastructure (__wine_unix_call_funcs and Wine's NtQueryVirtualMemory(1002) loader).

Evidence

Vulkan / Rule 30 scope and local hardware limitation

  • Vulkan scope (Rule 30): No rendering path, active Vulkan binding, or SPIR-V translation changed. The only two Vulkan-adjacent changes are:
    1. Removal of dead create_command_pool (vkCreateCommandPool) and get_device_queue (vkGetDeviceQueue) calls in vkback-unix's init() (they existed solely for the removed OP_GPU_COPY / OP_GPU_FILL prototype opcodes and were never used by the live renderer).
    2. Restoration of the OP_UNVIEW a2 & 1 failed-remap timeline branch in vkback-unix, which keeps the non-Vulkan timeline path and avoids an unintended Vulkan sparse unview call when a PE remap fails.
  • Local hardware limitation: Verified on Linux x86_64 with an integrated AMD Radeon 780M (VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU). Because umem::Memory::new requires a discrete GPU and returns Error::Setup("no discrete GPU") on this host, umem_backs_gpu_allocations, a title run, and a Vulkan validation run (VK_LAYER_KHRONOS_validation) were not executed locally. Noted here so a maintainer can run a smoke/validation pass on discrete RDNA2+ reference hardware if desired.

Checks run locally (all passing)

  • All 4 builds from tools/build.sh:
    • victory (x86_64-pc-windows-msvc, --profile diag --features diagnostics)
    • vkback-unix (greenfield/wine, --release)
    • vk-store (greenfield/vkback, --release)
    • greenfield/vkback/translate (--release --bins)
  • All 6 clippy --locked -- -D warnings runs (0 warnings):
    • cargo xwin clippy --workspace --all-targets --all-features --target x86_64-pc-windows-msvc --locked -- -D warnings
    • cargo xwin clippy -p victory -p victory-gpu -p victory-hle --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings (default features)
    • Host workspace (victory-shader, victory-formats, victory-core, xtask)
    • greenfield workspace
    • greenfield/wine workspace
    • greenfield/vkback/translate workspace
  • Native unit and policy tests:
    • victory-core, victory-formats, victory-shader, xtask — passed
    • greenfield: frame, umem, vkback --lib — passed
    • greenfield/wine: vkback-unix (6/6, including unview_failed_remap_flag_does_not_require_umem_init, uninitialised_entries_and_last_error, and null_and_zero_cap_ffi_buffers_are_safe; also stress-tested 10x under --test-threads=8 with zero flakes)
    • victory-gpu --lib unixgate (5/5, including call_rejects_out_of_range_opcode and parse_so_path validation cases)
    • greenfield: vkback --test policy --locked — 7/7 passed (including contiguous 0..OP_COUNT and one_wine_unix_library_and_loader)
    • cargo xtask policy — passed (526 files ok)
  • Windows PE tests and E2E check under Proton Experimental:
    • victory-hle suite: 170 passed + 3 passed (across test binaries)
    • victory-gpu suite: 128/128 passed
    • LD_DEBUG=files under Proton Experimental confirmed dlopen of libvkback_unix.so and dispatch of OP_INIT (reaching umem::Memory::new cleanly before failing with no discrete GPU on the integrated 780M)
    • End-to-end startup rejection: VICTORY_UMEM_SO=relative.so victory.exe ... exited cleanly with status code 1 before loading a title

Checklist (docs/AGENTS.md)

  • One topic (rule 31); docs/TASKS.md not edited, the fixed item named above (rule 29)
  • "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen (it drops the maintainers' commits)
  • No fallback or second path for a case that can't happen, in title data or in our own setup (rule 33); unexpected input fails loudly (rule 9)
  • Constants come from the console, the hardware or the title's data, not tuned by eye or ear (rule 9b)
  • Every switch is listed, read in one place, and a bad value stops the start (rule 2)
  • Queues and other externally synchronized Vulkan objects are used under their lock (rule 35) — dead queue/pool removed; no new unsynchronized Vulkan queue usage introduced
  • Every unsafe block has a // SAFETY: comment; no raw pointer around the borrow checker (rule 36)
  • Clippy clean; tests call the production code; TRANSLATOR_VERSION bumped if the translator's output changes (rule 27) — translator untouched
  • Comments say what is true now and name functions, not line numbers (rule 3)
  • Nothing from the title, and no pointers to where non-free data can be found (hard constraints)
**@⁠waldirjunior** on GitHub · 2026-12-02 15:07 UTC · [original](https://github.com/vktory6/VKtory/pull/224) `waldirjunior:refactor/one-unix-library` → `main` · +955 −1163 · 19 files · 2 commits · open > **Coordination note (Rule 31):** > - **PR #202** overlaps with this PR in `apps/victory/src/run.rs`, `crates/victory-hle/src/modules/umem.rs`, and `greenfield/tools/policy/toggles.txt` (both add an eager `validate_switches()` call at startup and touch `VICTORY_UMEM_SO`). Whichever PR merges first, we will align the other so both `validate_switches()` calls coexist cleanly and `VICTORY_UMEM_SO` is read and validated in a single place (`crates/victory-gpu/src/unixgate.rs`). > - **PRs #169 and #180** also touch `greenfield/wine/codes.rs` / `greenfield/wine/vkback-unix/src/lib.rs`, with distinct, non-competing scopes. ## What Completes the `docs/TASKS.md` (*Architecture cleanups*) item **`One unix library`** (`docs/TASKS.md` is not edited, per rule 29). Consolidates the legacy `umem-unix` / `umem-pe` pair into a single Wine unix library (`vkback-unix`), a single PE loader (`victory_gpu::unixgate`), and a single call-code table (`greenfield/wine/codes.rs`): - **Single unix library and call-code table (`greenfield/wine/`):** - Removed the legacy `greenfield/wine/umem-unix` and `greenfield/wine/umem-pe` crates and pruned them from `greenfield/wine/Cargo.toml` and `greenfield/wine/Cargo.lock`. - Consolidated `greenfield/wine/codes.rs` into one contiguous 21-opcode table (`0..OP_COUNT`), dropping 11 unused prototype/`umem-test`-only opcodes (`OP_HELLO`, `OP_CREATE_BO`, `OP_MAP_FD`, `OP_CLOSE_FD`, `OP_COMMIT`, `OP_VIEW`, `OP_PROTECT`, `OP_POOL_DESTROY`, `OP_LOCATE`, `OP_GPU_COPY`, `OP_GPU_FILL`). - Built `vkback-unix`'s `__wine_unix_call_funcs` table at compile time from `codes.rs` indices (`build_table`), and extended `greenfield/vkback/tests/policy.rs` to verify exact `0..OP_COUNT` contiguity (no gaps, duplicates, or count drift) and enforce a single Wine unix library and loader (`one_wine_unix_library_and_loader`). - **Single PE loader and eager switch validation (`crates/victory-gpu/src/unixgate.rs`, `apps/victory/src/run.rs`):** - Replaced the duplicated Wine `NtQueryVirtualMemory(1002)` loaders and `VICTORY_UMEM_SO` reads in `crates/victory-gpu/src/vklive.rs` and `crates/victory-hle/src/modules/umem.rs` with one shared `victory_gpu::unixgate` loader (single default `/tmp/libvkback_unix.so`, private `Dispatcher` / `dispatch`, and bounds-checked `UnixLib::call`). - Added eager startup validation `victory_gpu::unixgate::validate_switches()` at the top of `apps/victory/src/run.rs` (before CPU checks, title loading, threads, or unixlib loading). Rejects non-UTF-8, empty/whitespace-only, relative paths, embedded NUL bytes, and `UNICODE_STRING` UTF-16 length overflow; `load_once()` also fails loudly on parse error rather than silently falling back. - **Two latent bugs fixed during consolidation (`greenfield/wine/vkback-unix/src/lib.rs`):** - Restored the `OP_UNVIEW` `a2 & 1` failed-remap timeline hook (`UMEM_TIMELINE`) that had suffered copy-drift between `umem-unix` and `vkback-unix`, reading `a[2]` before borrowing `&mut Call` so a failed PE remap records the timeline event without invoking a sparse Vulkan unview. - Guarded `vkback-unix` FFI buffer handlers (`last_error`, `live_events`, `live_remap`, `live_remaps`, `live_guards`, `live_done`) against null pointers, zero capacities, and `2 * n` overflow before constructing slices or draining internal state (plus `catch_unwind` in `live_remaps` and `// SAFETY:` comments on every touched `unsafe` block). - **Policy and documentation cleanup:** - Removed dead `umem-test` switches (`UMEM_SPARSE`, `UMEM_UNIX_SO`) and updated `VICTORY_UMEM_SO` in `greenfield/tools/policy/toggles.txt`. - Updated stale references in `greenfield/README.md` and `docs/learnings/wine-unixlib.md` (marking the superseded entry per rule 28). ## The reference No vkd3d-proton / D3D12 counterpart — this is internal Wine unixlib boundary and PE-to-Unix loader infrastructure (`__wine_unix_call_funcs` and Wine's `NtQueryVirtualMemory(1002)` loader). ## Evidence ### Vulkan / Rule 30 scope and local hardware limitation - **Vulkan scope (Rule 30):** No rendering path, active Vulkan binding, or SPIR-V translation changed. The only two Vulkan-adjacent changes are: 1. Removal of dead `create_command_pool` (`vkCreateCommandPool`) and `get_device_queue` (`vkGetDeviceQueue`) calls in `vkback-unix`'s `init()` (they existed solely for the removed `OP_GPU_COPY` / `OP_GPU_FILL` prototype opcodes and were never used by the live renderer). 2. Restoration of the `OP_UNVIEW` `a2 & 1` failed-remap timeline branch in `vkback-unix`, which keeps the non-Vulkan timeline path and avoids an unintended Vulkan sparse unview call when a PE remap fails. - **Local hardware limitation:** Verified on Linux x86_64 with an integrated **AMD Radeon 780M** (`VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU`). Because `umem::Memory::new` requires a discrete GPU and returns `Error::Setup("no discrete GPU")` on this host, `umem_backs_gpu_allocations`, a title run, and a Vulkan validation run (`VK_LAYER_KHRONOS_validation`) **were not executed locally**. Noted here so a maintainer can run a smoke/validation pass on discrete RDNA2+ reference hardware if desired. ### Checks run locally (all passing) - **All 4 builds from `tools/build.sh`:** - `victory` (`x86_64-pc-windows-msvc`, `--profile diag --features diagnostics`) - `vkback-unix` (`greenfield/wine`, `--release`) - `vk-store` (`greenfield/vkback`, `--release`) - `greenfield/vkback/translate` (`--release --bins`) - **All 6 `clippy --locked -- -D warnings` runs (0 warnings):** - `cargo xwin clippy --workspace --all-targets --all-features --target x86_64-pc-windows-msvc --locked -- -D warnings` - `cargo xwin clippy -p victory -p victory-gpu -p victory-hle --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings` (default features) - Host workspace (`victory-shader`, `victory-formats`, `victory-core`, `xtask`) - `greenfield` workspace - `greenfield/wine` workspace - `greenfield/vkback/translate` workspace - **Native unit and policy tests:** - `victory-core`, `victory-formats`, `victory-shader`, `xtask` — passed - `greenfield`: `frame`, `umem`, `vkback --lib` — passed - `greenfield/wine`: `vkback-unix` (6/6, including `unview_failed_remap_flag_does_not_require_umem_init`, `uninitialised_entries_and_last_error`, and `null_and_zero_cap_ffi_buffers_are_safe`; also stress-tested 10x under `--test-threads=8` with zero flakes) - `victory-gpu --lib unixgate` (5/5, including `call_rejects_out_of_range_opcode` and `parse_so_path` validation cases) - `greenfield`: `vkback --test policy --locked` — **7/7 passed** (including contiguous `0..OP_COUNT` and `one_wine_unix_library_and_loader`) - `cargo xtask policy` — **passed** (`526 files ok`) - **Windows PE tests and E2E check under Proton Experimental:** - `victory-hle` suite: **170 passed + 3 passed** (across test binaries) - `victory-gpu` suite: **128/128 passed** - `LD_DEBUG=files` under Proton Experimental confirmed `dlopen` of `libvkback_unix.so` and dispatch of `OP_INIT` (reaching `umem::Memory::new` cleanly before failing with `no discrete GPU` on the integrated 780M) - End-to-end startup rejection: `VICTORY_UMEM_SO=relative.so victory.exe ...` exited cleanly with status code `1` before loading a title ## Checklist (docs/AGENTS.md) - [x] One topic (rule 31); `docs/TASKS.md` not edited, the fixed item named above (rule 29) - [x] "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen (it drops the maintainers' commits) - [x] No fallback or second path for a case that can't happen, in title data or in our own setup (rule 33); unexpected input fails loudly (rule 9) - [x] Constants come from the console, the hardware or the title's data, not tuned by eye or ear (rule 9b) - [x] Every switch is listed, read in one place, and a bad value stops the start (rule 2) - [x] Queues and other externally synchronized Vulkan objects are used under their lock (rule 35) — dead queue/pool removed; no new unsynchronized Vulkan queue usage introduced - [x] Every `unsafe` block has a `// SAFETY:` comment; no raw pointer around the borrow checker (rule 36) - [x] Clippy clean; tests call the production code; `TRANSLATOR_VERSION` bumped if the translator's output changes (rule 27) — translator untouched - [x] Comments say what is true now and name functions, not line numbers (rule 3) - [x] Nothing from the title, and no pointers to where non-free data can be found (hard constraints)
Consolidates the Wine unixlib layer into one unix library (vkback-unix),
one PE loader (victory_gpu::unixgate), and one call-code table
(greenfield/wine/codes.rs), completing docs/TASKS.md 'One unix library':

- Remove the legacy greenfield/wine/umem-unix and greenfield/wine/umem-pe
  crates and prune them from greenfield/wine/Cargo.toml and Cargo.lock.
- Fold umem-unix's missing OP_UNVIEW a2 bit 0 failed-remap timeline branch
  into vkback-unix (without raw re-borrowing args), guard the FFI boundary
  against null pointers, zero capacities, and 2*n overflow across
  last_error, live_events, live_remap, live_remaps (with catch_unwind),
  live_guards, and live_done with SAFETY comments on touched unsafe blocks,
  drop the 11 unused prototype/umem-test-only opcodes (and the unused
  CommandPool allocated for OP_GPU_COPY/OP_GPU_FILL), and build
  __wine_unix_call_funcs at compile time via codes.rs indices.
- Unify the duplicated Wine NtQueryVirtualMemory(1002) loaders and
  VICTORY_UMEM_SO reads from victory-gpu/src/vklive.rs and
  victory-hle/src/modules/umem.rs into victory_gpu::unixgate (one loader,
  one default '/tmp/libvkback_unix.so', one codes module, private
  Dispatcher/dispatch, bounds-checked UnixLib::call).
- Strictly validate VICTORY_UMEM_SO (UTF-8, non-empty, absolute Unix path,
  no embedded NUL, UNICODE_STRING UTF-16 length limit) via
  victory_gpu::unixgate::validate_switches() called eagerly at the top of
  apps/victory/src/run.rs before loading the title, failing loudly in
  load_once() too rather than degrading silently.
- Drop dead umem-test switches (UMEM_SPARSE, UMEM_UNIX_SO) from
  greenfield/tools/policy/toggles.txt, clean up orphan references in
  greenfield/README.md and docs/learnings/wine-unixlib.md, add unit tests
  in vkback-unix and unixgate, and extend policy.rs to enforce exact
  0..OP_COUNT contiguity and one_wine_unix_library_and_loader.

Rule 30: Vulkan rendering/umem command generation and SPIR-V are unchanged
(only unreachable OP_GPU_COPY/OP_GPU_FILL entries and their never-allocated
CommandPool were removed, and OP_UNVIEW a2 bit 0 restores the non-Vulkan
timeline path).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 15:12:45 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 16:14 UTC · original

Thanks, "One unix library" is a cleanup we want, and the coordination note helps. Order on our side:

  1. #202 first. Its checks are running; it is the smaller of the two and you offered to align with it.
  2. Then please merge main into this branch: one validated read of VICTORY_UMEM_SO, both validate_switches() calls.
  3. Then we review it properly. It changes how the PE side loads and dispatches the unix side, so besides the tests it needs a validation run and a world run on our side, plus checks that the unix gate still closes first on every exit path (#60, #64) and that #238's renderer-stop exit still works.

#169/#180 touch codes.rs too; whichever lands later rebases.

**@⁠vktory6** on GitHub · 2026-12-02 16:14 UTC · [original](https://github.com/vktory6/VKtory/pull/224#issuecomment-7351654096) Thanks, "One unix library" is a cleanup we want, and the coordination note helps. Order on our side: 1. #202 first. Its checks are running; it is the smaller of the two and you offered to align with it. 2. Then please merge main into this branch: one validated read of `VICTORY_UMEM_SO`, both `validate_switches()` calls. 3. Then we review it properly. It changes how the PE side loads and dispatches the unix side, so besides the tests it needs a validation run and a world run on our side, plus checks that the unix gate still closes first on every exit path (#60, #64) and that #238's renderer-stop exit still works. #169/#180 touch `codes.rs` too; whichever lands later rebases.
Brings in origin/main through 16cbd34 (including PR #202 victory-hle
switch validation, PR #223 workspace-wide file-size policy, PR #235
shared wire constants, PR #238 renderer-stop exit, and PR #246
incomplete live event batch rejection):

- Keep one validated, cached read of VICTORY_UMEM_SO in
  victory_gpu::unixgate (removing the duplicate SO_PATH reader,
  validation entry, obsolete test, and unused Switch::read_env from
  victory-hle).
- Call both victory_hle::env::validate_switches() and
  victory_gpu::unixgate::validate_switches() eagerly at the top of
  apps/victory/src/run.rs before loading the title or starting threads.
- Preserve #238's DONE_RENDERER_STOPPED exit path (vkback-unix fill_done
  with null-pointer guard + vklive watcher unixgate::close() before
  process::exit(6)) and #235's shared record::WRITTEN constant while
  keeping codes.rs contiguous 0..OP_COUNT (21 entries).
- Keep one accurate VICTORY_UMEM_SO entry in toggles.txt and merge
  vkback-unix's unit tests into one #[cfg(test)] mod tests block.
Author
Owner

@⁠waldirjunior on GitHub · 2026-12-02 19:47 UTC · original

Merged main (16cbd34, including #202, #223, #235, #238, and #246) into this branch in 8f34c7e:

  • Single validated read of VICTORY_UMEM_SO: crates/victory-gpu/src/unixgate.rs is the sole reader, validator, and OnceLock-cached holder of VICTORY_UMEM_SO; the duplicate SO_PATH, validation check, and obsolete test were removed from victory-hle (umem.rs / env.rs), and toggles.txt has a single entry.
  • Both validate_switches() calls at startup: apps/victory/src/run.rs calls both victory_hle::env::validate_switches() and victory_gpu::unixgate::validate_switches() eagerly before loading the title or starting threads/unixgate.
  • Exit paths (#60, #64) and #238 preserved: codes.rs stays contiguous 0..OP_COUNT (21 entries) with DONE_RENDERER_STOPPED, vkback-unix preserves #238's fill_done stopped-renderer behavior alongside the null-pointer guard and tests, and every exit path (including vklive::start_watcher's DONE_RENDERER_STOPPED exit) still closes unixgate first.

Post-merge local verification is green across all 4 tools/build.sh builds, all 6 clippy --locked -D warnings checks, native/policy/xtask/X11 tests, the Windows victory-hle and victory-gpu suites under Proton, and both victory.exe E2E startup checks (VICTORY_UMEM_SO=relative.so and VICTORY_DSP_GAIN=0 both exit 1 cleanly before loading a title). Ready for CI and review.

**@⁠waldirjunior** on GitHub · 2026-12-02 19:47 UTC · [original](https://github.com/vktory6/VKtory/pull/224#issuecomment-7356716590) Merged `main` (`16cbd34`, including `#202`, `#223`, `#235`, `#238`, and `#246`) into this branch in `8f34c7e`: - **Single validated read of `VICTORY_UMEM_SO`:** `crates/victory-gpu/src/unixgate.rs` is the sole reader, validator, and `OnceLock`-cached holder of `VICTORY_UMEM_SO`; the duplicate `SO_PATH`, validation check, and obsolete test were removed from `victory-hle` (`umem.rs` / `env.rs`), and `toggles.txt` has a single entry. - **Both `validate_switches()` calls at startup:** `apps/victory/src/run.rs` calls both `victory_hle::env::validate_switches()` and `victory_gpu::unixgate::validate_switches()` eagerly before loading the title or starting threads/unixgate. - **Exit paths (`#60`, `#64`) and `#238` preserved:** `codes.rs` stays contiguous `0..OP_COUNT` (21 entries) with `DONE_RENDERER_STOPPED`, `vkback-unix` preserves `#238`'s `fill_done` stopped-renderer behavior alongside the null-pointer guard and tests, and every exit path (including `vklive::start_watcher`'s `DONE_RENDERER_STOPPED` exit) still closes `unixgate` first. Post-merge local verification is green across all 4 `tools/build.sh` builds, all 6 `clippy --locked -D warnings` checks, native/`policy`/`xtask`/X11 tests, the Windows `victory-hle` and `victory-gpu` suites under Proton, and both `victory.exe` E2E startup checks (`VICTORY_UMEM_SO=relative.so` and `VICTORY_DSP_GAIN=0` both exit 1 cleanly before loading a title). Ready for CI and review.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 20:09 UTC · original

Thanks for merging main. Since then main has moved again: #169 (the translator takes the host's subgroups and float controls) and #180 landed today, and both touch the unixlib boundary. A merge of current main into your branch now conflicts in crates/victory-hle/src/modules/umem.rs, greenfield/wine/codes.rs and greenfield/wine/vkback-unix/src/lib.rs. As far as I can see, #169 adds what the PE side passes to vkback-unix about the host device.

Could you merge main once more and keep #169's additions in the consolidated codes.rs table and vkback-unix? Main is quiet in that area now. Once it's in, we start the review right away and run the validation run and a world run on the reference card, since your 780M cannot run umem. The dead vkCreateCommandPool/vkGetDeviceQueue removal is in rule 30's scope, so the validation run covers it.

The direction of the Wine/unixlib side as a whole (our own runtime vs Wine, the PE loader, the unixlib split) is being discussed in https://github.com/vktory6/VKtory/discussions/264. This PR is a good concrete data point for it.

**@⁠vktory6** on GitHub · 2026-12-02 20:09 UTC · [original](https://github.com/vktory6/VKtory/pull/224#issuecomment-7357309669) Thanks for merging main. Since then main has moved again: #169 (the translator takes the host's subgroups and float controls) and #180 landed today, and both touch the unixlib boundary. A merge of current main into your branch now conflicts in `crates/victory-hle/src/modules/umem.rs`, `greenfield/wine/codes.rs` and `greenfield/wine/vkback-unix/src/lib.rs`. As far as I can see, #169 adds what the PE side passes to vkback-unix about the host device. Could you merge main once more and keep #169's additions in the consolidated `codes.rs` table and `vkback-unix`? Main is quiet in that area now. Once it's in, we start the review right away and run the validation run and a world run on the reference card, since your 780M cannot run umem. The dead `vkCreateCommandPool`/`vkGetDeviceQueue` removal is in rule 30's scope, so the validation run covers it. The direction of the Wine/unixlib side as a whole (our own runtime vs Wine, the PE loader, the unixlib split) is being discussed in https://github.com/vktory6/VKtory/discussions/264. This PR is a good concrete data point for it.
This pull request has changes conflicting with the target branch.
  • crates/victory-hle/src/modules/umem.rs
  • greenfield/wine/codes.rs
  • greenfield/wine/vkback-unix/src/lib.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/224/head:github-bot/gh-224'
git switch 'github-bot/gh-224'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-224'
git switch 'github-bot/gh-224'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-224'
git switch 'github-bot/gh-224'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-224'
git switch 'main'
git merge --squash 'github-bot/gh-224'
git switch 'main'
git merge --ff-only 'github-bot/gh-224'
git switch 'main'
git merge 'github-bot/gh-224'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.