Compare commits

..
85 changed files with 418 additions and 620 deletions

No files matched your search

+1 -2
View File
@@ -1,7 +1,6 @@
## Related issue
Closes #<number>, or state the direct maintainer assignment if no issue applies.
For stacked work, name the base PR and any dependencies absent from its base.
Closes #
## Summary
+3 -7
View File
@@ -1,6 +1,6 @@
# BetterXen engineering rules
These rules apply to every contributor and coding agent. They reflect the accepted CrossOver-based hybrid direction; earlier native-first instructions are historical. `CLAUDE.md` is a symlink to this file. The decision is recorded in `docs/adr/0005-crossover-hybrid-direction.md`; the plan is `docs/roadmap.md`.
These rules apply to every contributor and coding agent. They were rewritten on the `planning/hybrid-first-transition` branch when BetterXen moved from native-first to CrossOver-based hybrid development. `CLAUDE.md` is a symlink to this file. The decision is recorded in `docs/adr/0005-crossover-hybrid-direction.md`; the plan is `docs/roadmap.md`.
### Direction
@@ -63,11 +63,11 @@ These rules apply to every contributor and coding agent. They reflect the accept
No AI slop (section 29).
Read docs/roadmap.md, docs/architecture.md, docs/interfaces.md and docs/progress.md before implementation. Read crates/README.md and docs/testing/README.md for component scope and validation. Native contracts, generated coverage tables and historical gate checklists do not authorize native expansion or establish hybrid acceptance.
Read docs/roadmap.md, docs/interfaces.md and docs/progress.md before implementation.
## Claiming work before you start
Several people and coding agents work on this repository at the same time. For issue-based work, claim the issue before editing and never take work someone else has claimed. A direct maintainer task with no issue (including a documentation-only stacked PR) does not require creating an issue; record that assignment and scope in the PR and check overlapping open work.
Several people and coding agents work on this repository at the same time. Claim an issue before you edit anything, and never take work someone else has claimed.
1. **Check.** Read every comment on the issue and look for open pull requests that link it. A claim is any comment in which someone says they are taking the issue, in any words (for example "I'll take this" or `/claim`). If a claim exists and is not stale (step 4), pick another issue.
2. **Claim.** Reply on the issue in plain words, for example: "I'm taking this. Plan: …". No command, label or bot step is needed. The earliest claim wins. Claim one issue per comment.
@@ -100,10 +100,6 @@ A coding agent claims in the name of the person it works for and follows the sam
## Checkout commands
These maintain workspace regressions, including the paused native implementation.
They do not certify CrossOver execution. Hybrid checks and prerequisites are in
`docs/testing/README.md`; documentation-only changes use its documentation checks.
- Format: `cargo fmt --all -- --check`
- Lint: `cargo clippy --workspace --all-targets -- -D warnings`
- Test: `cargo test --workspace`
+4 -4
View File
@@ -10,10 +10,11 @@ Guest execution uses original, purpose-built test programs. Commercial Xbox game
remains unsupported.
### Added
- Review follow-up on the proposed `victory-shader` import (#394): `translate_native` now reports immediate samplers as static samplers (a sampled texel read 0 on the GPU before), BetterXen's GPU tests use a host that `VICTORY_WARP` cannot redirect, the double-precision probes take run-time operands and were rerun (same result), and a per-file provenance review records that the crate was developed against one commercial title's shaders. **The import is not approved; a maintainer decision is required** (`docs/research/victory-shader-provenance.md`). Earlier statements that the crate had nothing game-specific are withdrawn.
- Fixed the two wave-operation failures the vendored victory-shader tests showed under D3DMetal (`docs/research/shader-wave-semantics.md`). Device capabilities were measured with a new original D3D12 host (`workloads/d3d12-wave-probe`): shader model 6.6, wave operations, waves exactly 32 lanes, no double-precision shader operations. One failure was a wrong test precondition (a 64-lane lowering run on the 32-lane device); the test now checks the device width and asserts the recompiler's refusal. The other was unsupported double-precision operations: shaders compiled from original HLSL by Microsoft's DXC that use a `double` ran without writing anything, while float wave operations worked. The recompiler's one native-double site (`active_f64_sum`) now builds the console's balanced sum tree with its existing integer fp64 add and no longer declares doubles. Local results on one Apple M4 under CrossOver 26.3, not independently reproduced: the whole suite passes (229 passed, 3 ignored; the vendored original had 2 failures); 24 new GPU cases compare full 64-bit sums with a CPU model of the tree; both regression tests fail against the original lowering. Cost not measured; tree-order fidelity relies on the recompiler's own recognizer.
- Added `scripts/hybrid/run-shader-gpu-tests.sh`, which cross-builds the vendored `victory-shader` test executable for Windows and runs it under CrossOver through `betterxen-hybrid run` (supervision, memory guard, stall detection, JSON record), either BetterXen's four fixture tests or the whole upstream suite. It takes the test executable's path from cargo's own build message instead of guessing the target layout (the first version looked in `debug/build/.../out/`; the usual location is `debug/deps/`, which is the fallback). It needs the runner from #384 and #388. Verified on the Apple M4 with CrossOver 26.3: fixtures pass; the whole suite shows the known failures; the `debug/deps` fallback is untested on this machine, whose cargo layout puts the executable elsewhere. Not independently reviewed.
- Added `scripts/hybrid/run-shader-gpu-tests.sh`, which cross-builds the vendored `victory-shader` test executable for Windows and runs it under CrossOver through `betterxen-hybrid run` (supervision, memory guard, stall detection, JSON record), either BetterXen's ten tests or the whole upstream suite. It takes both the runner and the test executable from the messages of the cargo invocations that built them, and stops if a build fails (review fix: an earlier version piped cargo into the parser, so a failed build exited 0 and ran a stale executable, and it assumed the runner was under `target/`). `scripts/hybrid/test-run-shader-gpu-tests.sh` is a stubbed regression test for both. It needs the runner from #384 and #388. Verified on the Apple M4 with CrossOver 26.3: fixtures pass; the whole suite shows the known failures; there is no fallback to a guessed path. Not independently reviewed.
- Integrated skakwy's `victory-shader` (GFX10/RDNA 2 machine code to DXIL SM 6.6 recompiler, about 43,500 lines of Rust) as `crates/victory-shader`, with provenance in its `UPSTREAM.md`, the Mesa notice preserved and 19 lines of lint-only edits to upstream files. Added `translate_native` and tests that translate BetterXen's own gfx1030 fixtures to DXIL and, on Windows targets, run them on the GPU through D3D12. Local results on one Apple M4 with CrossOver 26.3 (D3DMetal), not independently reproduced: 177 upstream CPU-side tests pass on macOS; all 6 fixtures with expected words matched the manifest on the GPU, with a negative control; the GPU tests fail without D3D12 instead of skipping; the full upstream suite under CrossOver has 224 passed, 2 failed, 3 ignored. DXIL validation by `dxil.dll` was not run. The native RDNA-to-Metal compiler is unchanged. See `docs/research/victory-shader-integration.md`.
- Added the upstream research registry and component reuse matrix (`docs/research/`), a public-documentation review (evidence class D, nothing executed) of CrossOver, Wine, DXMT, DXVK, VKD3D-Proton, MoltenVK, FEX, VIctory, VIctory-macOS and PortWatch. At that initial review, VIctory-family projects were excluded from reuse on provenance grounds; the subsequent shader-only snapshot has a separate component record above. The GitHub project board is not yet configured because the token lacks the `project` scope (#346).
- Added the upstream research registry and component reuse matrix (`docs/research/`), a public-documentation review (evidence class D, nothing executed) of CrossOver, Wine, DXMT, DXVK, VKD3D-Proton, MoltenVK, FEX, VIctory, VIctory-macOS and PortWatch. VIctory-family projects are excluded from reuse on provenance grounds. The GitHub project board is not yet configured because the token lacks the `project` scope (#346).
- Added hybrid research records: `docs/research/hybrid-backlog-research-2026-11-25.md` (findings and registry candidates, from search summaries) and `docs/research/primary-source-verification-2026-11-25.md` (re-check against CodeWeavers, Apple, DXMT and Wine primary pages). It confirms CrossOver's backend list, finds no public documentation of `CX_GRAPHICS_BACKEND`, and records that two Apple notices on Rosetta's end disagree; D3DMetal's license text and CrossOver's Rosetta and ARM64 plans remain unverified. Eleven issues created from the research were reviewed the same day: #364 and #365 stay in Phase 1, the others are parked and recorded under "Parked ideas" in the roadmap. Rust 1.100.0 (already installed) is the required toolchain; the default `stable` was 1.94.1. Planning only; nothing was installed or run.
- Added File > Open Executable… with Command-O to the app (#252). It opens the focused window's read-only file importer, the same one as that window's button, and is disabled when no window can present it; each window keeps its own importer, so with several windows only the focused one shows the picker. The chosen file goes through the same inspection path as the button, drag and drop and Finder Open With; nothing is executed. A file-importer failure is now shown in red with the system's description instead of being ignored, a cancelled picker shows nothing, and the message clears on the next selection. `BetterXen --smoke-import-result`, run by `scripts/build-app.sh`, checks cancellation, a shown failure and its clearing; it fails on the previous importer handling. Checked locally on Apple Silicon in the running app (Command-O and the menu item open the picker, cancel shows no error, a second Command-O opens it again, with two windows only the focused one presents it, and with every window closed the menu item is disabled); not yet independently reviewed.
- Added `docs/research/texture-formats.md`, an inventory of the texture formats and layouts BetterXen handles (#260). For BC1–BC7, RGBA8 and Depth32Float it separates container recognition, CPU decoding, layout conversion, native Metal upload and readback, translated sampling, the host-side D3D12-shaped API (called from Rust, not wired to guest imports) and guest reachability through imported services, and links each cell's implementing files and tests and each format's exact public specification sections, including the packed BC footprints from #241. It cross-references #208 and #209 instead of opening duplicate tasks, lists console layouts, console descriptors and asset or audio containers as unknowns, and ranks three proposed follow-ups with fixture recipes and owners. Research only; no implementation changed.
@@ -26,8 +27,7 @@ remains unsupported.
- Removed the "PR template" check (`.github/workflows/pr-template.yml`, `scripts/pr_template_check.py` and its tests) and its CI test step. Also removed `.github/PULL_REQUEST_TEMPLATE.md`. Pull request descriptions are no longer validated or pre-filled; CONTRIBUTING.md still asks for the same information and the claim-first rule still applies.
### Changed
- Aligned contributor and agent guidance, architecture boundaries, crate documentation and testing instructions with active CrossOver hybrid integration. Marked native plans, contracts and campaigns as preserved or historical, documented split-stack runner dependencies and retained the original evidence limits. Documentation only; no new runtime validation or phase acceptance.
- Replaced the native-first development plan with a CrossOver-based hybrid roadmap (`docs/roadmap.md`: five provisional phases, only Phase 1 active; the earlier H0 to H7 breakdown is archived) and an accepted-direction ADR 0005. At that transition checkpoint no hybrid component existed; later shader integration is recorded above. No Xbox title is shown to run, and no phase is verified complete.
- Replaced the native-first development plan with a CrossOver-based hybrid roadmap (`docs/roadmap.md`: five provisional phases, only Phase 1 active; the earlier H0 to H7 breakdown is archived) and an accepted-direction ADR 0005. No hybrid component exists yet and no Xbox title is shown to run; this is planning and research scheduling only, and no phase is verified complete.
- Rewrote the engineering rules in `AGENTS.md` (`CLAUDE.md` is a symlink to it) to permit CrossOver, Wine-based infrastructure, Rosetta 2 and D3DMetal subject to licensing, while keeping the honesty, independent-verification, provenance and clean-room rules and adding dependency and reuse rules. Resolves #345.
- Native work is preserved and paused: tag `native-first-final` marks the last `main` commit before this change, `docs/research/native-roadmap.md`, and archived native-first plan and milestones under `docs/archive/`. GitHub backlog: all native issues except four with assigned contributors and open pull requests were closed as not planned and indexed in `docs/research/native-issue-archive.md`; future-phase issues were parked in the roadmap; only the Phase 1 milestone is open.
- Replaced the issue templates with hybrid task, bug, research, performance, validation and documentation forms and added a pull request template. Fixed invalid YAML in the agent-task template. README, CONTRIBUTING and the docs index now describe the hybrid direction.
+13 -16
View File
@@ -8,16 +8,15 @@ The only active development track is the CrossOver-based hybrid architecture in
## Getting started
- Read `README.md`, `AGENTS.md`, `CHANGELOG.md`, `docs/roadmap.md`, `docs/architecture.md`, `docs/interfaces.md`, `docs/progress.md` and the relevant architecture decisions. Generated native status tables describe fixtures, not active priorities.
- Discuss substantial changes in an issue before implementing them, unless directly assigned by a maintainer. Small fixes do not require prior approval; direct assignments without an issue do not require a new issue.
- For issue-based work, claim the issue before working on it by replying on it in plain words, after checking its comments for an existing claim. Never claim over someone else. A claim with no pull request after about one week may be taken over with a reply saying so. Coding agents follow the same rules; see "Claiming work before you start" in `AGENTS.md`.
- Read `README.md` and, when present, `AGENTS.md`, `docs/interfaces.md`, `docs/status.toml` and the relevant architecture decisions.
- Discuss substantial changes in an issue before implementing them; small fixes do not require prior approval.
- Claim an issue before working on it by replying on it in plain words, after checking its comments for an existing claim. Never claim over someone else. A claim with no pull request after about one week may be taken over with a reply saying so. Coding agents follow the same rules; see "Claiming work before you start" in `AGENTS.md`.
- Use a native ARM64 macOS environment with Rust and the appropriate Xcode/Metal tools. LLVM AMDGPU tools are needed for ISA fixture generation; extra tooling depends on the subsystem.
- Keep changes focused and preserve existing public interfaces unless a change is justified and documented.
## Development and verification
Use the [testing guide](docs/testing/README.md) to select hybrid, documentation or
preserved-native checks. The workspace regression commands are:
When the Cargo workspace exists, run from its root:
```sh
cargo fmt --all -- --check
@@ -27,7 +26,7 @@ cargo test --workspace
Follow repository documentation for actual GPU tests, fuzzing, mutation testing and benchmarks. Report commands, versions, pass/fail/skip counts and hardware used. A successful shader compile is not successful GPU execution. Do not report unavailable tools or skipped tests as passes.
For an explicitly authorized native instruction or compiler change, cite the applicable ISA section, state the exact architecture, document operand and execution-mask semantics, and add tests for encodings, edge cases, unsupported cases and independent expected results. Where applicable, verify the resulting MSL through actual Metal execution. Do not convert unsupported instructions into silent no-ops.
For an instruction or compiler change, cite the applicable ISA section, state the exact architecture, document operand and execution-mask semantics, and add tests for encodings, edge cases, unsupported cases and independent expected results. Where applicable, verify the resulting MSL through actual Metal execution. Do not convert unsupported instructions into silent no-ops.
For a performance change, provide reproducible before-and-after results using equivalent inputs, hardware and settings. For a new dependency, explain why it is needed, verify its license and native ARM64 compatibility, and record its provenance.
@@ -37,21 +36,19 @@ Use publicly accessible specifications and authorized materials only. Do not sub
Distinguish desktop RDNA behavior from Xbox-specific behavior. Cite primary sources with exact applicable architectures and record uncertainties using the project's evidence classification when available. Tests on Apple GPUs do not establish verification on Xbox hardware.
The preserved native runtime, decoder, typed intermediate representation, shader
compiler and Metal backend use original implementations and independent tests.
Active hybrid work reuses established upstream infrastructure after per-file
license and provenance review. The vendored `victory-shader` snapshot has a
separate [provenance record](crates/victory-shader/UPSTREAM.md); its inclusion
does not authorize adopting other VIctory-family components or game material.
Do not copy from projects built around leaked or unauthorized inputs without the
recorded review required by `AGENTS.md`. Game-specific and decryption code stay excluded.
BetterXen implements its own Rust guest runtime, decoder, typed IR, shader
compiler and native Metal backend from public technical specifications
and independently derived tests. Contributions must not copy, port or
adapt code, decoder tables, internal metadata or implementation
architecture from other emulators. External results can inform test
selection. Author the resulting code and fixtures independently.
Before incorporating third-party code, verify per-file license compatibility with GPL-3.0-or-later, record the exact upstream revision and original paths, preserve copyright notices and document changes. Update applicable attribution records. Public visibility alone is not proof of authorization or license compatibility.
## Pull requests
- Branch from current `main`, or the explicitly requested top of a PR stack. For stacked work, name the base PR and dependencies. Keep commits focused and link relevant issues; a direct maintainer assignment without an issue needs no new issue.
- Describe what changes and why, link the issue you claimed with `Closes #<number>` when applicable, state which checks you actually ran, and disclose material AI assistance. Separate unverified work from supported behavior.
- Branch from the current main branch, keep commits focused, and link relevant issues.
- Describe what changes and why, link the issue you claimed with `Closes #<number>`, state which checks you actually ran, and disclose material AI assistance. Separate unverified work from supported behavior.
- Include a clear explanation, tests and any documentation/status updates. Separate unverified work from supported behavior.
- Disclose material AI assistance and personally review generated changes. AI output is not an authoritative source, test oracle or substitute for independent review.
- Never include secrets, personal paths, credentials or private data in patches or logs.
+7 -40
View File
@@ -11,10 +11,10 @@
![Status: experimental](https://img.shields.io/badge/status-experimental-d29922)
![License: GPL-3.0-or-later](https://img.shields.io/badge/license-GPL--3.0--or--later-2ea043)
**Active work integrates an externally installed CrossOver. The independent native runtime and Metal compiler are preserved and paused.**
**The paused native implementation described below uses no Wine, CrossOver, Rosetta or Vulkan runtime. The active hybrid direction intends to use CrossOver and Rosetta 2, subject to research and licensing review.**
> [!IMPORTANT]
> **Current direction.** BetterXen's only active development track is a CrossOver-based hybrid architecture: CrossOver (installed externally) as the compatibility foundation, with BetterXen providing whatever integration, configuration, diagnostics, benchmarking and optimization research shows is missing. This is the *intended* architecture, **not a verified Xbox compatibility stack**: no Xbox title has been shown to run through it, and CrossOver is not assumed to provide Xbox runtime compatibility. Phase 1 remains active; integration work and local fixture results do not establish phase completion. Planning is progressive: only the current phase has open issues. The independent native implementation described below is **preserved but paused indefinitely**. See the [roadmap](docs/roadmap.md), [ADR 0005](docs/adr/0005-crossover-hybrid-direction.md), the [upstream research registry](docs/research/upstream-registry.md) and the [deferred native roadmap](docs/research/native-roadmap.md). The rewritten engineering rules are in [AGENTS.md](AGENTS.md).
> **Current direction.** BetterXen's only active development track is a CrossOver-based hybrid architecture: CrossOver (installed externally) as the compatibility foundation, with BetterXen providing whatever integration, configuration, diagnostics, benchmarking and optimization research shows is missing. This is the *intended* architecture, **not a verified Xbox compatibility stack**: no Xbox title has been shown to run through it, and CrossOver is not assumed to provide Xbox runtime compatibility. Work is at the research stage (Phase 1). Planning is progressive: only the current phase has open issues. The independent native implementation described below is **preserved but paused indefinitely**. See the [roadmap](docs/roadmap.md), [ADR 0005](docs/adr/0005-crossover-hybrid-direction.md), the [upstream research registry](docs/research/upstream-registry.md) and the [deferred native roadmap](docs/research/native-roadmap.md). The rewritten engineering rules are in [AGENTS.md](AGENTS.md).
</div>
@@ -28,35 +28,6 @@ BetterXen is a community-maintained, open-source project written primarily in Ru
---
## Active hybrid architecture
BetterXen develops integration, environment configuration, diagnostics, reproducible
workloads, run records and measured optimization around CrossOver. Wine-based
runtime services and the installed CPU/graphics translation components belong to
the external compatibility stack; BetterXen does not replace them by default.
Backend capabilities and integration interfaces must be verified per version.
| Component | Scope at this stack revision |
| --- | --- |
| CrossOver, Rosetta 2, D3DMetal and other selected backends | External dependencies, subject to their own licenses and host support. No proprietary binaries are bundled. |
| `victory-shader` | Vendored GFX10-to-DXIL recompiler and bridge for original compute fixtures. Local GPU observations and failures are recorded in the [integration report](docs/research/victory-shader-integration.md); no console shader corpus was validated. |
| `scripts/hybrid/run-shader-gpu-tests.sh` | Cross-builds a Windows test executable and invokes `betterxen-hybrid run`. It requires the runner from [PR #384](https://github.com/MacosPorters/betterxen/pull/384) and [PR #388](https://github.com/MacosPorters/betterxen/pull/388), absent from this split stack's base. |
| Native `xenora-*` crates and Swift app | Preserved synthetic research and regression tests, paused as an independent development track. Not the CrossOver runtime. |
See the [architecture and integration boundaries](docs/architecture.md),
[crate guide](crates/README.md), [testing guide](docs/testing/README.md) and
[roadmap](docs/roadmap.md). The six original compute fixtures have recorded
single-host results, with independent reproduction outstanding. No Xbox title
execution, general console runtime compatibility or performance improvement is claimed.
## Preserved native implementation
The detailed diagrams, capability counts, results and build instructions below
refer to the **paused native research path**, unless explicitly labelled hybrid.
They remain useful for regression testing, not as instructions to expand native
CPU, runtime or Metal coverage. Native work needs a demonstrated hybrid dependency
or an explicit maintainer decision. Earlier phase and X-number milestones are historical.
## How it fits together
One guest program travels through three native subsystems. Every stage is checked against an independently derived expectation.
@@ -269,7 +240,7 @@ The texture upload and readback paths use authored Metal kernels. They should no
Xbox-specific texture layouts and additional compression formats require further research and validation.
## Preserved native architecture
## Architecture
BetterXen is organized around three connected subsystems: guest execution, shader translation and native GPU execution.
@@ -331,7 +302,7 @@ BetterXen's host execution environment is native ARM64. The guest architecture b
The native graphics pipeline runs translated vertex and pixel stages, the indexed-draw and blend passes and the depth pass into offscreen Metal targets, with GPU readback compared against independent CPU references.
The native ARM64 dynamic recompiler covers a bounded subset of x86-64 instructions; the rest run through the shared interpreter semantics (see the [CPU coverage map](docs/testing/cpu-coverage.md)). The project does not provide a complete Xbox operating-system implementation.
The native ARM64 dynamic recompiler covers a bounded subset of x86-64 instructions; the rest run through the shared interpreter semantics (see the [CPU coverage map](docs/testing/cpu-coverage.md) once it lands). The project does not provide a complete Xbox operating-system implementation.
See [Interface Contracts](docs/interfaces.md) for the documented execution and resource boundaries.
@@ -339,10 +310,6 @@ See [Interface Contracts](docs/interfaces.md) for the documented execution and r
## Current limitations
Hybrid limitations include version-specific external interfaces, incomplete independent
reproduction and the absence of demonstrated Xbox execution. The table below
describes the preserved native implementation; it is not an active backlog.
BetterXen is an engineering research project, not a working commercial-game emulator.
The following remain unsupported or incomplete:
@@ -452,12 +419,12 @@ Compiling a shader is not equivalent to proving its GPU output is correct.
### Contributing
Contributions are welcome, and several people and coding agents work in this repository at once. For issue-based work, follow these steps. Direct maintainer assignments without an issue need no new issue; record their scope and stack base in the PR.
Contributions are welcome, and several people and coding agents work in this repository at once. To avoid duplicated work:
1. Read every comment on an issue and check for open pull requests that link it.
2. Claim the issue with a plain reply (for example "I'm taking this. Plan: ...") before you edit anything. The earliest live claim wins, and a claim is stale only after about seven days without a pull request.
3. Stay inside the files the issue lists, and put `Closes #<n>` in the pull request description.
4. Sign off every commit (DCO); use public documentation, original code and reviewed, compatibly licensed upstream code. Anyone who has seen leaked or confidential Xbox material must not contribute.
4. Sign off every commit (DCO) and use only public documentation and original code. Anyone who has seen leaked or confidential Xbox material must not contribute.
5. Update `CHANGELOG.md` for meaningful changes. Changes to `main` need maintainer review through [CODEOWNERS](.github/CODEOWNERS).
See [CONTRIBUTING.md](CONTRIBUTING.md), [docs/legal.md](docs/legal.md) and the [documentation index](docs/README.md) for the full rules.
@@ -468,7 +435,7 @@ See the [roadmap](docs/roadmap.md) for the current phase and the [changelog](CHA
---
**Active work builds reproducible CrossOver integration on Apple Silicon, with evidence before compatibility or performance claims.**
**The goal is to build a trustworthy native Apple Silicon compatibility framework, one verifiable subsystem at a time.**
---
-30
View File
@@ -1,30 +0,0 @@
# Crate guide
The active direction is [CrossOver-based hybrid integration](../docs/architecture.md).
A crate's presence in the workspace or its API documentation does not make it an
active development priority. Legacy `xenora-*` package names and guest ABI symbols
remain for compatibility; they do not name a second active architecture.
| Directory | Role | Development scope |
| --- | --- | --- |
| `victory-shader` | Vendored GFX10-to-DXIL compiler with an original compute-fixture bridge | Active hybrid integration; see [its guide](victory-shader/README.md) and [provenance](victory-shader/UPSTREAM.md). |
| `cli` | `betterxen` CLI for the bounded native experiments and inspection | Preserved native tooling; distinct from the separate `betterxen-hybrid` runner. |
| `loader` | PE32+ parsing, checked guest memory, x86-64 interpreter, ARM64 translator and synthetic services | Preserved, paused; not Wine or the CrossOver loader. |
| `import-gen` | Deterministic import classification and binding generation | Preserved native tooling; not proof of Xbox service compatibility. |
| `isa` | Typed gfx1030 instruction forms and generated ISA data | Preserved native shader path. |
| `decoder` | Bounded gfx1030 decoder | Preserved native shader path; separate from the vendored compiler's decoder. |
| `shader` | Synthetic gfx1030 compute/graphics to Metal Shading Language | Preserved, paused; not the DXIL bridge. |
| `ref` | Independent CPU expectations for native synthetic shader and rendering tests | Preserve independence from production implementations. |
| `metal` | Bounded trusted MSL execution, rendering and readback | Preserved native backend; not D3DMetal. |
| `texture` | Original synthetic texture layout and block-format helpers | Preserved native fixture support; not a verified Xbox layout. |
| `ffi` | Versioned C interface used by the Swift app | Preserved native application boundary; not CrossOver integration. |
`tests/validation` and `benchmarks` are additional workspace members for
independent native validation and correctness-gated measurements. The Swift app
is under `app/`. Keep their regressions passing; extending them requires an
explicit hybrid need or a maintainer decision.
`betterxen-hybrid` is not in this split stack's base. Its separate integration
PRs and the GPU script prerequisites are documented in the
[testing guide](../docs/testing/README.md). Use `cargo +1.100.0 doc --locked --workspace --no-deps` for crate API documentation; compiling documentation does not validate
GPU behavior or upstream provenance.
-22
View File
@@ -1,22 +0,0 @@
# victory-shader in BetterXen
This is the active hybrid shader integration, distinct from the paused native
`xenora-shader` MSL compiler. The pinned upstream snapshot translates GFX10
machine code to PC DXIL. BetterXen's `emit::translate_native` entry point and
fixture tests exercise original compute shaders with explicit root layouts.
Read [UPSTREAM.md](UPSTREAM.md) for attribution, exact source, modifications and
scope, and the [integration report](../../docs/research/victory-shader-integration.md)
for initial failures and the local results after the included wave fixes. Upstream container-parsing APIs are
present, but no authorized console shader container was validated. Their API
documentation describes formats, not BetterXen compatibility guarantees.
```sh
CARGO_BUILD_JOBS=2 cargo +1.100.0 test --locked -p victory-shader
```
On macOS this runs CPU-side tests; Windows-only GPU modules are not compiled.
The [hybrid testing guide](../../docs/testing/README.md) explains cross-building,
external CrossOver requirements and the separate runner dependencies needed for
GPU readback. Preserve skipped-test distinctions and do not generalize original
fixture results to arbitrary console shaders or games.
+5 -2
View File
@@ -1,5 +1,7 @@
# Upstream provenance: victory-shader
**Not approved for merge.** This crate was developed against one commercial title's shaders; the per-file review and the open maintainer decision are in `docs/research/victory-shader-provenance.md`.
| | |
| --- | --- |
| Source | <https://github.com/skakwy/victory-mac>, directory `crates/victory-shader/` (Cargo.toml and `src/`) |
@@ -25,9 +27,10 @@ Changes to upstream files (19 lines, nothing functional) and files BetterXen add
- `src/emit/lower.rs` (`active_f64_sum`, about 90 lines): the whole-wave f64 sum no longer emits a native `double` wave operation (`makeDouble`, `waveActiveOp.f64`, `splitDouble`); it builds the console's balanced tree over the lanes with the crate's own integer `add_f64`, reading partner runs through `waveReadLaneAt` and a ballot for lanes that are not present, and no longer sets the doubles feature flag. Why: D3DMetal reports no double-precision shader operations and a shader that uses a `double` ran without writing anything (docs/research/shader-wave-semantics.md).
- `src/emit/bitcode.rs`: two `#[allow(dead_code)]` for the double type, now never constructed.
- `src/emit/host.rs`: `Host::wave_lane_count_max()` (test host only).
- `src/emit/host.rs`: `Host::wave_lane_count_max()` and `Host::hardware()` (test host only; `hardware()` ignores `VICTORY_WARP`).
- `src/emit/mod.rs`: the static-sampler construction is factored into `static_samplers()` so `translate_native` reports immediate samplers.
- `src/emit/wave64_tests.rs`: `a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit` checks the device's wave width and, on a device narrower than 64 lanes, asserts the recompiler's refusal instead of running a 64-lane lowering.
## Not carried
The upstream repository's other crates (`victory-gpu`, `victory-loader`, `victory-hle`, ...), which are tied to one console title and its runtime, and `mac/`, `tools/`. The shader inputs the upstream project was built for are not included; BetterXen validates this crate only with its own synthetic fixtures (see `docs/research/` for the validation record).
The upstream repository's other crates (`victory-gpu`, `victory-loader`, `victory-hle`, ...), which are tied to one console title and its runtime, and `mac/`, `tools/`. No shader binaries or dumps of the title the upstream project targets are included, but comments and behaviour in this crate refer to that title's shaders; BetterXen validates this crate only with its own synthetic fixtures (see `docs/research/` for the validation record).
+1 -1
View File
@@ -38,8 +38,8 @@ pub fn translate_native(native: &NativeProgram) -> Result<HostShader, ShaderErro
stage: native.stage,
dxil: lowered.dxil,
user_data: lowered.user_data,
static_samplers: super::static_samplers(&lowered.samplers, lowered.cmp_samplers),
samplers: lowered.samplers,
static_samplers: Vec::new(),
root_cbvs: lowered.root_cbvs,
root_srvs: lowered.root_srvs,
root_uavs: lowered.root_uavs,
@@ -191,7 +191,7 @@ mod on_the_gpu {
let _one = crate::emit::valu_tests::ONE_AT_A_TIME
.lock()
.unwrap_or_else(|e| e.into_inner());
let host = Host::new(false).expect("no SM 6.6 D3D12 hardware device: not verified");
let host = Host::hardware().expect("no SM 6.6 D3D12 hardware device: not verified");
let mut ran = 0;
for f in fixtures() {
let got = run_on_gpu(&host, &f);
@@ -210,7 +210,7 @@ mod on_the_gpu {
let _one = crate::emit::valu_tests::ONE_AT_A_TIME
.lock()
.unwrap_or_else(|e| e.into_inner());
let host = Host::new(false).expect("no SM 6.6 D3D12 hardware device: not verified");
let host = Host::hardware().expect("no SM 6.6 D3D12 hardware device: not verified");
for f in fixtures() {
let got = run_on_gpu(&host, &f);
let mut wrong = f.expected.clone();
@@ -357,7 +357,7 @@ mod f64_on_the_gpu {
#[test]
fn f64_wave_sums_match_the_cpu_tree_bit_for_bit() {
let _one = crate::emit::valu_tests::ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner());
let host = Host::new(false).expect("no SM 6.6 D3D12 hardware device: not verified");
let host = Host::hardware().expect("no SM 6.6 D3D12 hardware device: not verified");
let mut ran = 0;
for threads in [1u32, 4, 20, 32] {
let shader = translate_native(&f64_wave_sum_program(threads)).expect("translate");
@@ -394,3 +394,98 @@ mod f64_on_the_gpu {
eprintln!("betterxen: {ran} f64 wave sums ran on the GPU and matched the CPU tree bit for bit");
}
}
// ---- immediate samplers through translate_native ---------------------------------------------
//
// A compute program that builds its sampler from constants in the code (an immediate sampler)
// needs a static sampler in the host's root signature. `translate_native` must report it, as the
// container path does; the buffer-only fixtures above cannot notice.
/// Samples texel (0.5, 0.5) of the 2D texture in table slot 0 with an immediate sampler and stores
/// the red channel to the raw UAV in table slot 1.
fn immediate_sampler_program() -> NativeProgram {
let s_mov_lit = |dst: u8, lit: u32| [0xBE80_03FF | (dst as u32) << 16, lit];
let smem = |op: u32, dst: u32, base: u32, off: u32| [0x3D << 26 | op << 18 | dst << 6 | base >> 1, 125 << 25 | off];
let mut w: Vec<u32> = Vec::new();
w.push(0xBE80_0300 | 2 << 16); // s_mov_b32 s2, s0 (table address)
w.push(0xBE80_0380 | 3 << 16); // s_mov_b32 s3, 0
w.extend(smem(0x03, 8, 2, 0)); // s_load_dwordx8 s[8:15]: the texture SRV
w.extend(smem(0x02, 20, 2, 32)); // s_load_dwordx4 s[20:23]: the UAV
w.push(0x7E00_02F0 | 2 << 17); // v_mov_b32 v2, 0.5
w.push(0x7E00_02F0 | 3 << 17); // v_mov_b32 v3, 0.5
for (i, word) in [0x0000_0092u32, 0x00C0_0000, 0x1850_0000, 0].into_iter().enumerate() {
w.extend(s_mov_lit(16 + i as u8, word)); // s[16:19]: the sampler, as constants
}
// image_sample_lz v4, v[2:3], s[8:15], s[16:19] dmask:0x1 dim:2D
w.extend([0x3C << 26 | 0x21 << 18 | 1 << 8 | 1 << 3, (16u32 >> 2) << 21 | (8u32 >> 2) << 16 | 4 << 8 | 2]);
w.extend([0x38 << 26 | 0x1C << 18, 0x80 << 24 | (20u32 >> 2) << 16 | 4 << 8]); // buffer_store_dword v4
w.push(0xBF81_0000); // s_endpgm
let used = |kind, table_offset_dwords, dwords| UsedResource {
kind,
root: RootType::Table,
table_offset_dwords,
lower_bound: 0,
stride: 0,
dwords,
user_data: 0,
slot: 0,
};
NativeProgram {
stage: HwStage::Cs,
wave64: false,
vgprs: 8,
layout: vec![RootParam {
root: RootType::Table,
table_offset_dwords: 0,
sgprs: 1,
base_register: 0,
user_data: 0,
slot: 0,
}],
used: vec![used(ResourceType::Srv, 0, 8), used(ResourceType::Uav, 8, 4)],
io: StageIo::Cs(ComputeIo { rsrc2: 1 << 1, threads: [1, 1, 1] }),
code: w.iter().flat_map(|x| x.to_le_bytes()).collect(),
}
}
#[test]
fn translate_native_reports_immediate_samplers_as_static_samplers() {
let shader = translate_native(&immediate_sampler_program()).expect("translate");
assert_eq!(shader.samplers.len(), 1, "the program has one immediate sampler");
assert_eq!(shader.static_samplers.len(), 1, "the host builds s0 from this list");
}
#[cfg(windows)]
#[test]
fn immediate_sampler_samples_the_texture_on_the_gpu() {
use crate::emit::host::{Dispatch, Host, Root, View};
let _one = crate::emit::valu_tests::ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner());
let host = Host::hardware().expect("no SM 6.6 D3D12 hardware device: not verified");
let shader = translate_native(&immediate_sampler_program()).expect("translate");
let (root, pso) = host.compute_pipeline(&shader).expect("compute pipeline");
let ud = vec![0u32; shader.user_data_dwords().max(1) as usize];
let texels = [[0.25f32, 0.5, 0.75, 1.0]];
let out = host
.dispatch(
&root,
&pso,
&Dispatch {
roots: vec![(0, Root::Constants(ud))],
views: &[View::Texture(1, 1, &texels), View::RawUav(1)],
samplers: &[],
groups: [1, 1, 1],
},
)
.expect("dispatch");
assert_eq!(out[0][0], 0.25f32.to_bits(), "red of the only texel");
eprintln!("betterxen: the immediate-sampler program sampled the texture on the GPU");
}
#[test]
fn static_samplers_keep_the_comparison_filter_flag() {
let words = [0x0000_0092u32, 0x00C0_0000, 0x1850_0000, 0];
let list = super::static_samplers(&[words, words], 0b10);
assert_eq!(list.len(), 2);
assert_eq!(list[0].filter & 0x80, 0, "sampler 0 is not a comparison sampler");
assert_ne!(list[1].filter & 0x80, 0, "sampler 1 is");
}
+11
View File
@@ -103,6 +103,17 @@ impl Host {
/// The default adapter, or WARP with `warp` (or `VICTORY_WARP=1`).
pub fn new(warp: bool) -> Result<Self, String> {
let warp = warp || std::env::var("VICTORY_WARP").is_ok_and(|v| v == "1");
Self::create(warp)
}
/// The default hardware adapter, whatever `VICTORY_WARP` says; an error when the default
/// device is the software adapter. BetterXen addition: a test that reports GPU verification
/// must not be redirectable to WARP by the environment.
pub fn hardware() -> Result<Self, String> {
Self::create(false)
}
fn create(warp: bool) -> Result<Self, String> {
// SAFETY: plain D3D12/DXGI calls with valid out pointers.
unsafe {
// `VICTORY_D3D12_DEBUG`: the debug layer, whose messages a
+18 -12
View File
@@ -646,18 +646,7 @@ fn emit_program(
stage: native.stage,
dxil: l.dxil,
user_data: l.user_data,
static_samplers: l
.samplers
.iter()
.enumerate()
.map(|(n, &w)| {
let mut s = StaticSampler::from_words(w);
if l.cmp_samplers >> n & 1 != 0 {
s.filter |= 0x80;
}
s
})
.collect(),
static_samplers: static_samplers(&l.samplers, l.cmp_samplers),
samplers: l.samplers,
root_cbvs: l.root_cbvs,
root_srvs: l.root_srvs,
@@ -667,6 +656,23 @@ fn emit_program(
Ok((shader, wave_size))
}
/// The static sampler descriptions for the immediate samplers a shader uses (`s<n>` at position
/// n); bit n of `cmp` marks a sampler used for comparisons. BetterXen change: factored out so
/// `translate_native` builds the same list as the container path.
fn static_samplers(samplers: &[[u32; 4]], cmp: u64) -> Vec<StaticSampler> {
samplers
.iter()
.enumerate()
.map(|(n, &w)| {
let mut s = StaticSampler::from_words(w);
if cmp >> n & 1 != 0 {
s.filter |= 0x80;
}
s
})
.collect()
}
/// The rows of an `ISG1`/`OSG1` part.
fn signature(part: &[u8]) -> Result<Vec<container::SigElement>, ShaderError> {
use crate::dxbc::u32_at;
@@ -242,7 +242,7 @@ fn a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit() {
// this program ("a wave sum of 16-bit floats where not every lane runs"): the test then
// asserts that refusal, which is the correct behaviour, rather than reporting a failure
// or silently skipping.
if let Some(w) = Host::new(false).ok().and_then(|h| h.wave_lane_count_max()).filter(|&w| w < 64) {
if let Some(w) = Host::hardware().ok().and_then(|h| h.wave_lane_count_max()).filter(|&w| w < 64) {
let refused = lowered_on(&native, &p, &HashSet::new(), w);
assert!(
matches!(&refused, Err(ShaderError::Unsupported { what, .. }) if what.contains("16-bit floats where not every lane runs")),
+10 -20
View File
@@ -3,11 +3,10 @@
## Getting started
Start with the [project README](../README.md) for scope and build commands,
then read the [hybrid architecture](architecture.md), [crate guide](../crates/README.md)
and [testing guide](testing/README.md). The [interface contracts](interfaces.md),
[original guest experiments](../experiments/x1/README.md) and
[independent native validation](../tests/validation/README.md) describe preserved
research, not the active runtime. The [changelog](../CHANGELOG.md) records notable changes.
then read the [interface contracts](interfaces.md). Reproduce an
[original guest test program](../experiments/x1/README.md) or run the
[independent validation suite](../tests/validation/README.md) before changing
either path. The [changelog](../CHANGELOG.md) records notable changes.
Use the [roadmap](roadmap.md) for the active CrossOver-based hybrid plan, phases,
critical path and completion criteria; see [ADR 0005](adr/0005-crossover-hybrid-direction.md)
@@ -20,27 +19,18 @@ paused: [deferred native roadmap](research/native-roadmap.md) and the archived
[component reuse matrix](research/component-reuse-matrix.md). Historical phase
checkpoints retain their original evidence scope.
## Active hybrid architecture
- [Architecture and integration boundaries](architecture.md) — Responsibilities, split-stack dependencies, implemented fixture bridge and unverified capabilities.
- [Crate guide](../crates/README.md) — Active vendored compiler versus preserved native components.
- [Shader integration report](research/victory-shader-integration.md) — Recorded local CrossOver results, known failures and reproduction limits.
## Preserved native architecture and technical design
The native sections below document regression contracts and historical evidence.
Their extension recipes and next tasks are not an active roadmap.
## Architecture and technical design
- [Interface contracts](interfaces.md) — Translated shader stages, guest services, native command submission, and synthetic textures.
- [Fixture memory model](adr/0003-demo-memory-model.md) and [CPU boundary](adr/0004-cpu-boundary.md) — Buffer bindings, guest address translation, and dependency direction.
## Preserved native Metal graphics
## Native Metal graphics
- [Translated offscreen stages](interfaces.md#translated-offscreen-stages) — Translated vertex and pixel stages for the bounded gfx1030 subset.
- [Blend and depth passes](interfaces.md) — Native blend and depth graphics passes with per-draw state.
- [Apple GPU evidence](research/apple-gpu.md) and [host lab record](research/host-lab.md) — Observed behavior and historical floating-point results.
## Preserved native RDNA 2 decoding and shader translation
## RDNA 2 decoding and shader translation
- [Instruction coverage](shaders/instruction-coverage.md) — Desktop gfx1030 instruction forms, operand limits, and CPU and GPU results.
- [Semantic coverage](shaders/semantic-coverage.md) — Generated per-family counts of identified, declared, decoded, lowered and verified gfx1030 forms.
@@ -51,7 +41,7 @@ Their extension recipes and next tasks are not an active roadmap.
- [VOPC integer compares](shaders/vector-compare.md) — Wave32 compare forms, the VCC/EXEC contract, runtime `s_cbranch_vccz` and the Metal mapping.
- [Metal Shading Language generation](shaders/msl.md) and [independent CPU reference](shaders/reference-interpreter.md) — Translation rules and separate CPU execution models.
## Preserved native guest CPU and runtime experiments
## Guest CPU and runtime experiments
- [Guest experiment guide](../experiments/x1/README.md) — Bounded x86-64 execution, executable loading, experimental services, native compute, and offscreen rendering.
- [x86-64 instruction registry](cpu/instruction-registry.md) — Shared decoder, generated tables, semantics, native lowering and how to add a verified instruction form.
@@ -78,6 +68,7 @@ Their extension recipes and next tasks are not an active roadmap.
- [Public sources](research/sources.md), [RDNA 2 notes](research/rdna2.md), and [Xbox GPU evidence](research/xbox-gpu.md) — Specifications, evidence scope, and unknown console behavior.
- [Shader inputs](research/shader-containers.md) and [risk register](risk-register.md) — Input provenance and unresolved engineering risks.
- [victory-shader provenance review](research/victory-shader-provenance.md) — Per-file licence and origin record for the proposed import; not approved, maintainer decision pending.
- [victory-shader integration](research/victory-shader-integration.md) — The vendored GFX10-to-DXIL recompiler, how BetterXen's fixtures run through it on the GPU under CrossOver, and what is not verified.
- [Shader wave-semantics investigation](research/shader-wave-semantics.md) — Why two upstream wave tests failed under D3DMetal: device capabilities, independent probes, the fix and its limits.
- [Texture format inventory](research/texture-formats.md) — Formats and layouts by stage (decode, layout, native upload, sampling, guest), their public specifications, unknowns and ranked follow-ups.
@@ -92,10 +83,9 @@ Their extension recipes and next tasks are not an active roadmap.
- [Legal scope](legal.md), [dependency licensing](licenses.md), and [third-party notices](../THIRD_PARTY_NOTICES.md) — Input policy, attribution, and redistribution findings.
- [Contribution guidelines](../CONTRIBUTING.md) — Original authorship, Developer Certificate of Origin sign-off, and evidence requirements.
- [Agent task queue](coordination/agent-tasks.md) — Areas, claiming, leases, upstream sync, verification and the security model for parallel contributors and coding agents.
- [CPU/runtime expansion campaign ledger](coordination/cpu-campaign-ledger.md) — Historical native campaign checkpoints, batches and evidence; its next target is paused.
- [CPU/runtime expansion campaign ledger](coordination/cpu-campaign-ledger.md) — Progress ledger for the BetterXen native CPU and runtime compatibility campaign: starting/current commits, completed batches, new forms, verification evidence and the next implementation target.
- [Infrastructure QA ownership](coordination/infrastructure-qa-ownership.md) — Non-overlapping paths for infrastructure and QA tooling.
- [Agent queue smoke evidence](coordination/agent-queue-smoke.md) — Live Actions results from the disposable smoke repository.
- [Infrastructure QA tooling](testing/infrastructure/README.md) — Advisory orchestration, PR validation, benchmark analysis and release checks.
- [Documentation alignment audit](testing/documentation-alignment.md) — Audit coverage, retained history and documentation checks for the hybrid transition.
- [Migration to BetterXen](migration.md): source attribution, imported history and compatibility names.
-2
View File
@@ -1,7 +1,5 @@
# 0003. Use disjoint lane-indexed buffers for the first fixture
Status: **Retained for the paused native implementation.** [ADR 0005](0005-crossover-hybrid-direction.md) supersedes native-first project direction. This contract still governs its existing synthetic fixtures and dependency boundaries; it does not define CrossOver integration or authorize new native work.
For the synthetic compute fixture, the resource beginning at SGPR 0 denotes the read-only input words and the one beginning at SGPR 4 denotes the output words. VGPR 0 starts at the lane index and must remain unchanged when used as a resource index. Each allocation has the same word count, and each dispatched invocation accesses only its own lane's word. The fixture ABI provides no raw resource descriptor bits or guest virtual addresses.
The compiler must reject descriptor forms, offsets, index changes and control flow outside this contract. Both engines must honor the load dependency and completion order. The host reads output after command completion. Supporting shared writable buffers will require a new ordering and aliasing contract.
-2
View File
@@ -1,7 +1,5 @@
# 0004. Keep CPU recompilation outside the graphics dependency graph
Status: **Retained for the paused native implementation.** [ADR 0005](0005-crossover-hybrid-direction.md) supersedes native-first project direction. This contract still governs its existing synthetic fixtures and dependency boundaries; it does not define CrossOver integration or authorize new native work.
Phase 01 accepts synthetic shader code and explicit buffer bindings. A later guest CPU runtime will submit graphics commands using opaque resource handles, addresses, lengths and access modes. The graphics side will resolve addresses through checked mappings, retain resources through command completion and return fence completions or interrupt events via the command interface. CPU code may consume that interface. Graphics crates may depend on shared boundary types and graphics crates only, with no dependency on guest CPU or host x86-specific code.
Keep guest address arithmetic separate from host virtual addresses. Validate ranges before constructing a Metal view and retain the backing allocation for all queued users. Define aliasing and synchronization before supporting shared writable mappings. The first fixture uses independent input and output buffers and has no guest virtual address space.
+2 -10
View File
@@ -19,22 +19,14 @@ BetterXen provides integration, configuration, environment management, diagnosti
## Unverified integration assumptions
- General workload coverage and a reproducible baseline (#355). Later local compute-fixture observations are bounded evidence, not general compatibility.
- That CrossOver, Rosetta 2, D3DMetal or DXMT run any authorized workload BetterXen needs. Assumed not until measured (#355).
- That CrossOver offers supported interfaces for bottle management, configuration, launching and diagnostics (#350).
- Rosetta 2's support lifetime and D3DMetal's license terms (#349, #354).
- That any of this provides Xbox runtime compatibility. It is assumed not to.
## Verified implementation capabilities
At the decision date, no hybrid capability had been verified. Subsequent split
integration work adds a vendored GFX10-to-DXIL compiler and an original compute
fixture bridge; single-host CrossOver results and known failures are recorded in
the [integration report](../research/victory-shader-integration.md). The test
script also requires the separate hybrid runner PRs. See the
[current architecture](../architecture.md) for checkout boundaries. These
observations do not accept the full proposed architecture, complete Phase 1 or
establish Xbox compatibility. Preserved native evidence remains in
[progress](../progress.md).
None for the hybrid architecture. Verified native-research capabilities (synthetic evidence only) are unchanged and listed in `docs/progress.md`.
## Planning consequence
-88
View File
@@ -1,88 +0,0 @@
# CrossOver hybrid architecture and integration boundaries
[ADR 0005](adr/0005-crossover-hybrid-direction.md) establishes CrossOver as the
primary compatibility foundation and hybrid as the only active development
track. The [roadmap](roadmap.md) defines phase acceptance. This guide describes
component boundaries without treating the proposed complete stack as verified.
## Responsibilities
BetterXen owns integration, configuration, environment inspection, diagnostics,
reproducible workloads, run records, benchmarking and measured optimization.
CrossOver is installed externally. Its Wine-based runtime and selected CPU and
graphics translation components are upstream responsibilities. Record installed
versions and supported interfaces; an observed environment variable or bottle
setting is not automatically a supported vendor API.
BetterXen's own host tools must run natively as ARM64. Windows x86-64 test
executables are guest workloads, not BetterXen host binaries. Rosetta 2 may be
used by the selected external stack where supported. Metal is the host graphics
API; a backend using Vulkan through MoltenVK must be assessed as that backend's
path rather than an independent BetterXen graphics architecture.
CrossOver, D3DMetal, Rosetta 2 and Apple tools are not bundled. Their exact terms,
versions and support status must be checked. See the [upstream registry](research/upstream-registry.md),
[reuse matrix](research/component-reuse-matrix.md) and [license review](licenses.md).
## What is present in the split integration stack
This documentation branch is stacked on [PR #395](https://github.com/MacosPorters/betterxen/pull/395),
which is based on the shader-crate [PR #394](https://github.com/MacosPorters/betterxen/pull/394).
That base contains:
- `victory-shader`: a pinned upstream GFX10-to-DXIL compiler, with a BetterXen
entry point for original compute machine code and root-layout inputs.
- Original compute-fixture tests that compare output with the fixture manifest.
- `scripts/hybrid/run-shader-gpu-tests.sh`: a Windows cross-build and test-launch
script. It delegates execution and run records to `betterxen-hybrid`.
The `betterxen-hybrid` crate is supplied separately by
[PR #384](https://github.com/MacosPorters/betterxen/pull/384), with stall supervision
in [PR #388](https://github.com/MacosPorters/betterxen/pull/388). Neither is in
#395's base. The script cannot run from this stack alone: its first build of
`betterxen-hybrid` fails if that package is absent. Use a checkout containing
those dependencies before following the [hybrid test procedure](testing/README.md).
No merge, rebase or combined implementation is performed by this documentation PR.
With those dependencies available, the tested fixture path is:
```text
Original gfx1030 compute fixtures + explicit root layout
-> victory-shader -> PC DXIL -> Windows D3D12 test executable
-> external CrossOver / selected D3D12 backend -> GPU readback
-> comparison with independently derived manifest words
```
The [integration report](research/victory-shader-integration.md) records local
Apple M4/CrossOver observations, six compute fixtures with matching output and
the [wave-operation investigation and fixes](research/shader-wave-semantics.md)
now included in this stack. The original two suite failures and the later
229-passed/3-ignored run remain separate records. Independent reproduction is outstanding. Windows
GPU tests are not compiled by the macOS test run, and upstream tests can report
success after skipping GPU work. These results do not demonstrate console
shader-container compatibility, Xbox startup, game execution or a performance gain.
The wave investigation began in [PR #392](https://github.com/MacosPorters/betterxen/pull/392)
and is now included through #394/#395. Its 64-lane-only test checks rejection on
the recorded 32-lane device; that passing test is not a GPU sum verification.
The corrected fp64 sum has recorded local GPU comparisons, with console tree
recognition and performance limits still documented in the investigation.
## Preserved native research
The independent decoder, x86-64 interpreter and ARM64 translator, synthetic
runtime services, gfx1030-to-MSL compiler, Metal backend and Swift app remain in
the workspace. Their contracts and tests remain valid for their documented
synthetic scope. They are not the CrossOver runtime and their coverage counts
are not hybrid compatibility metrics.
[ADRs 0003](adr/0003-demo-memory-model.md) and
[0004](adr/0004-cpu-boundary.md) retain native fixture and dependency contracts.
[Interfaces](interfaces.md), [native progress](progress.md) and historical
acceptance records retain their original evidence scope. Earlier native phases,
G-number gates, X-number experiments and CPU campaigns do not define active
hybrid milestones. See the [deferred native roadmap](research/native-roadmap.md).
Keep native regression tests passing. Expand native components only for a
specific demonstrated hybrid need or an explicit maintainer decision to resume.
Do not open a parallel native roadmap or adopt other upstream components merely
because a shader snapshot was included.
+5 -7
View File
@@ -1,9 +1,7 @@
# Agent task queue
Only current hybrid work is active; legacy queue areas do not authorize native expansion. Follow [AGENTS.md](../../AGENTS.md) for claim precedence, direct maintainer assignments and current scope. The optional bot lease is not permission to override a plain-reply claim or a claim with an open PR.
Work items are GitHub issues. Contributors and coding agents claim them with a comment, work in
their own branch, and open a pull request linked to the issue. Claims must be read manually; the former Agent PR checks workflow has been removed. The claim rules for
their own branch, and open a pull request that is checked against the claim. The claim rules for
everyone are in `AGENTS.md` ("Claiming work before you start"): a plain reply is a valid claim, and
a claim goes stale after about one week without a pull request. The commands below are an optional
layer for contributors listed in `.github/agent-queue.json`; the bot only sees `/claim` comments, so
@@ -11,10 +9,10 @@ read the issue's comments before using it and never `/claim` over a plain-reply
deterministic: the rules live in `scripts/agent_queue/` (standard-library Python, no network, no
model or external service), and GitHub Actions and the shell helpers only call it.
The original queue implementation was unit-tested locally; the subsequent
[smoke record](agent-queue-smoke.md) preserves the disposable-repository results.
Those records do not establish current production configuration. The former
Agent PR checks workflow is removed; manual claiming and review rules still apply.
Status: implemented and unit-tested locally. **Not yet run on GitHub**: the workflows are untested
against the real API until the first live run. Until a live smoke test has passed and existing issues
have been migrated into the queue, the pull request check is **advisory**: it reports problems but
never blocks a merge, and it must not be made a required check.
## Areas
-2
View File
@@ -1,7 +1,5 @@
# Xenora CPU/Runtime Expansion Campaign — Progress Ledger
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
Evidence below is local to the named host unless stated. Nothing here is independently reviewed yet.
## Continuation checkpoint
@@ -1,7 +1,5 @@
# Infrastructure QA campaign ledger
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
Running record for the infrastructure and engineering-quality campaign.
Update after each meaningful commit batch. Do not invent passing tests.
@@ -1,7 +1,5 @@
# Infrastructure and QA ownership manifest
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
Non-overlapping file ownership for the infrastructure and engineering-quality
campaign. Active CPU/runtime, RDNA2 and native-application Gates 4–9 work stays
outside this manifest.
-2
View File
@@ -1,7 +1,5 @@
# Proposed AVX and AVX2 guest contract
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
[Issue #299](https://github.com/MacosPorters/betterxen/issues/299) defines a
reviewable first step for Advanced Vector Extensions (AVX) in the x86-64 guest.
The current [instruction registry](instruction-registry.md) rejects VEX prefixes.
-2
View File
@@ -1,7 +1,5 @@
# x86-64 instruction registry
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
The static PE probe, the interpreter and the native ARM64 dynamic binary translator (DBT) decode guest code through one function, `x86_decode::decode`. Its tables are generated from `crates/loader/x86/instructions.toml`.
| Part | File | Role |
-4
View File
@@ -1,9 +1,5 @@
# Interfaces
## Scope and active integration boundary
Active CrossOver integration is described in [architecture.md](architecture.md). The contracts below govern the preserved native fixture runtime and Metal path. They are not Wine APIs, a CrossOver plugin interface or an Xbox runtime ABI. Native expansion is paused; retain these contracts for regression testing and any explicitly justified hybrid reuse.
## gfx1030 compute fixtures
The first input is little-endian gfx1030 machine code for a compute fixture with optional statically resolved forward scalar branches. The synthetic ABI starts with full Wave32 EXEC and reserves vector general-purpose register (VGPR) 0 for the grid index used by buffer accesses. Resource operands select documented synthetic bindings. The parser must require explicit target identification and validate all lengths before allocating. Console containers and AMDHSA initialization require separate contracts.
-5
View File
@@ -4,11 +4,6 @@ BetterXen does not circumvent console security or DRM, does not load encrypted o
## User-provided game files
This is the input policy, not a claim of implemented game loading or execution.
The preserved native inspection path and active hybrid workloads have different
limits; see the [architecture guide](architecture.md). No Xbox title execution
is demonstrated.
Users obtain and supply their own files. BetterXen evaluates file structure,
supported features, compatibility and safe execution. Game import does
not check ownership, request receipts or account verification, investigate
-8
View File
@@ -19,14 +19,6 @@ The workspace is GPL-3.0-or-later. The following is the lead's preliminary compa
## Runtime redistribution review
**Historical native artifact review.** The six-package graph and G11 findings below
apply to the named native candidate, not the current whole-workspace graph or
external CrossOver stack. The vendored shader compiler adds the dependencies
listed above; its independent license/provenance audit is not established by
this older review. CrossOver, Rosetta 2 and D3DMetal remain externally supplied
and unbundled; use the [reuse records](research/component-reuse-matrix.md) for
selected component scope. No redistribution permission is inferred here.
Reviewed 2026-11-22 against the locked Apple Silicon graph. Run `cargo tree --locked --target aarch64-apple-darwin --edges normal,build` and `cargo metadata --locked --format-version 1` to reproduce the graph and declared licenses. The external runtime graph comprises the six Cargo packages listed above. The reviewed registry packages identify their source revisions in `.cargo_vcs_info.json`. The five objc2 registry packages declare the listed licenses but contain no standalone license text. Each of the three pinned upstream `LICENSE.md` files matches the preserved copy byte for byte.
The declared MIT terms are compatible with GPL-3.0-or-later for code the upstream authors have rights to license. MIT remains the selected option for objc2-core-foundation, objc2-metal and bitflags. Distribution of copies or substantial portions subject to MIT requires retaining the applicable copyright and permission notice. Preserve the project GPL text, AMD's MIT notice, the bitflags MIT notice, and the objc2 notices. For a linked Xenora binary, also satisfy the GPLv3 section 6 Corresponding Source requirements for the shipped build, including applicable linked dependency source and build scripts, subject to the license's System Libraries exception. See the [project GPL text](../LICENSE).
+3 -12
View File
@@ -1,7 +1,5 @@
# Engineering progress
**Scope:** generated counts and historical host results below describe preserved native research. For active hybrid components, dependencies and bounded local results, see the [architecture guide](architecture.md) and [shader integration report](research/victory-shader-integration.md). No hybrid phase is certified complete by these tables.
BetterXen is an experimental research project. Verified work is restricted to
independently authored synthetic programs and shaders; commercial game
execution and authentic Xbox startup are unsupported. Progress is measured by
@@ -22,7 +20,7 @@ reproducible tests, not by estimated game compatibility percentages.
| xbox-execution | Xbox Series X\|S | unsupported | untested | unverified | U | Game execution, proprietary guest containers and full guest execution-mask divergence are unsupported. The console launch ABI is unknown. |
<!-- status:features:end -->
## Reproduce preserved native checks
## Reproduce
Run on native Apple Silicon with Rust 1.100.0, Xcode 27.2, Python 3.11 or later and LLVM 23.1.6. The verified host was Apple M5 with macOS 27.3. Metal's safe and precise compile options must be available. Use up to four Cargo jobs total across at most two builds, one GPU workload and one fuzz or mutation campaign at a time. The final checkpoint used two Cargo jobs.
@@ -43,13 +41,6 @@ scripts/audit/dependencies.sh
The independent CPU validation tests are part of the workspace. The native suite and optional LLVM oracle run separately so CPU-only CI can report them accurately. Final local logs are under ignored `artifacts/`. Keep the historical lab and candidate logs separate.
## Active priorities and retained findings
## Remaining work
Follow the [hybrid roadmap](roadmap.md): establish supported integration
interfaces, exact dependency versions, reproducible authorized workloads,
independent baseline reproduction and the responsibility boundary with CrossOver.
Native wave execution, mesh stages, texture sampling and resource expansion are
paused research findings, not the active work queue. Historical G-number gates
remain attached to their original candidates; they neither certify hybrid
acceptance nor authorize redistribution. Keep existing regression tests passing.
See the [current limitations](../README.md#current-limitations) for the outstanding items. The active research steps are: finish the remaining RDNA2 wave execution and mesh stages, translated texture sampling, broader resource binding and synchronization. Close independent claims, status, history and review findings against the current candidates, and verify the [runtime redistribution blockers](licenses.md#runtime-redistribution-review) before closing the redistribution gate (G11).
+2 -11
View File
@@ -1,15 +1,5 @@
# Component reuse matrix
## Split integration update
The original discovery assessment below is retained as a dated research snapshot. The split shader integration subsequently included only `crates/victory-shader` from `skakwy/victory-mac` at `22b3f8e45a59f7d11fef7718988c58d0b3f1d0f9`, plus BetterXen fixture additions. Its [provenance record](../../crates/victory-shader/UPSTREAM.md), [license record](../licenses.md) and [local integration results](victory-shader-integration.md) are the component-specific records, not an approval of the wider VIctory family. This documentation audit does not independently certify that review. Other upstream runtime, loader, game-specific and decryption components remain excluded.
| Component | Selected scope | Recorded license and limits |
| --- | --- | --- |
| `victory-shader` | Vendored GFX10-to-DXIL snapshot and original compute-fixture bridge | Upstream GPL record and retained MIT opcode-table notice; exact files, modifications and attribution in `UPSTREAM.md`. Independent provenance/acceptance review is not claimed here. |
## Original discovery assessment (2026-11-25)
Companion to the [upstream registry](upstream-registry.md); same evidence limits (class D, nothing run, not legal advice). "External" means installed or supplied by the user and invoked, never bundled or copied. GPL-3.0-or-later is BetterXen's license.
| Need | Candidate | Decision | Reason and condition |
@@ -23,7 +13,8 @@ Companion to the [upstream registry](upstream-registry.md); same evidence limits
| Direct3D to Vulkan | DXVK | **Evaluate** only together with MoltenVK | zlib/libpng is permissive and GPL-compatible. Value on macOS unknown. |
| Direct3D 12 to Vulkan | VKD3D-Proton | **Evaluate**; blocked on a Vulkan 1.3 provider | Depends on MoltenVK feature coverage, unknown. |
| Vulkan on Metal | MoltenVK | **Evaluate** | Apache-2.0 (compatible with GPLv3). Subset of Vulkan; coverage vs consumers unknown. |
| Shader compiler / runtime | VIctory, VIctory-macOS | **Initial rejection; later shader-only record above** | Built for a specific commercial game's Xbox Series build whose provenance is not established as authorized. Ideas only. |
| Shader compiler / runtime | VIctory, VIctory-macOS | **Rejected for reuse** | Built for a specific commercial game's Xbox Series build whose provenance is not established as authorized. Ideas only. |
| GFX10 to DXIL recompiler | victory-mac `crates/victory-shader` (VIctory family) | **Not approved: maintainer decision pending** (the rejection above stands until then) | PR #394 proposes vendoring it. The [per-file review](victory-shader-provenance.md) finds GPL-3.0 licensing but development against one commercial title's shaders; read plainly, the engineering rules exclude it. |
| Project discovery | PortWatch VI | Reference only | Editorial tracker; not engineering evidence; nothing imported. |
| x86-64 decode and ARM64 translation, runtime, gfx1030 compiler, Metal backend | BetterXen native implementation | **Preserved, paused** | Reuse only where hybrid needs it and it shows a demonstrated advantage; not forced into the architecture. |
| Test and diagnostics methodology | BetterXen existing audits, benchmark harness, claims registry | **Reuse** | Existing evidence classes, claims audit and benchmark gating apply to hybrid work (Phase 1 onward). |
+1 -3
View File
@@ -1,10 +1,8 @@
# CPU boundary research
**Historical native feasibility notes.** These unknowns and proposed evaluations predate the bounded ARM64 translator now preserved in `crates/loader`. They do not describe CrossOver CPU translation or an active native work queue. See the [active architecture](../architecture.md).
Microsoft's March 2020 Xbox Series X hardware disclosure identifies the shipped CPU family as custom AMD Zen 2. The vendor hardware disclosure carries class D (CLAIM-XBOX-SERIES-X-CPU). Using x86-64 as the future guest ISA is based on that family identification. Platform-specific calling conventions and guest virtual-memory rules remain unknown. [Xbox Series X hardware disclosure](https://news.xbox.com/en-us/2020/03/16/xbox-series-x-tech/)
Apple documents the JIT mapping and write-protection APIs for Apple Silicon, including instructions for making newly written machine code visible to instruction fetch. Class B applies to the documented host APIs. At the time of this study, Xenora had not chosen ahead-of-time translation or JIT compilation. The preserved implementation now includes a bounded ARM64 dynamic binary translator; see the [instruction registry](../cpu/instruction-registry.md). [Apple JIT porting guide](https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon)
Apple documents the JIT mapping and write-protection APIs for Apple Silicon, including instructions for making newly written machine code visible to instruction fetch. Class B applies to the documented host APIs. Xenora has yet to choose ahead-of-time translation or JIT compilation. [Apple JIT porting guide](https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon)
No guest page-size contract has been established. Host mapping operations use host page granularity. Any finer guest protection granularity will require an explicit software policy. Class B applies to documented host mapping semantics. [Apple mmap manual](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/mmap.2.html)
@@ -1,6 +1,6 @@
# Hybrid backlog research record (2026-11-25)
Evidence class D: public documentation and repository metadata, plus search summaries; see [primary-source-verification-2026-11-25.md](primary-source-verification-2026-11-25.md) for the re-check. Nothing was installed, built or run. Not legal advice. The candidate rows are retained as the original research record; consult the [upstream registry](upstream-registry.md) for their recorded disposition rather than treating this page as a pending merge instruction.
Evidence class D: public documentation and repository metadata, plus search summaries; see [primary-source-verification-2026-11-25.md](primary-source-verification-2026-11-25.md) for the re-check. Nothing was installed, built or run. Not legal advice. Candidate registry rows are listed here; merge them into [upstream-registry.md](upstream-registry.md) once that file's pending commit has landed.
## Findings that created issues
-2
View File
@@ -1,7 +1,5 @@
# Native issue archive
Issue/PR states and “active work” labels below are a snapshot of the transition, not a live assignment list. An open historical native PR does not reopen the native roadmap; check its current discussion and the hybrid priorities before taking work.
**Preserved history, not a backlog.** BetterXen's active direction is the CrossOver-based hybrid architecture ([roadmap](../roadmap.md)). The independent native implementation is paused indefinitely; this page replaces its GitHub issue backlog so the work can be found without occupying the active Issues tab. Native source code, tests, benchmarks, Git history and attribution are untouched. Resuming native work needs an explicit maintainer decision ([native roadmap](native-roadmap.md)).
Every issue below keeps its full text, comments and attribution on GitHub and can be reopened; closing used the reason "not planned". Issues imported from the earlier Xenora repository say so in their first lines, and their original author is recorded below. Excerpts are the first sentence of the issue's objective, not a summary of acceptance criteria.
+1 -1
View File
@@ -4,7 +4,7 @@
## Existing implementation (preserved in the workspace)
The native `xenora-*` crates and `betterxen` CLI, Swift code under `app/`, native tests, fixtures, fuzz targets and benchmarks. The separately vendored `victory-shader` is active hybrid integration; not every crate under `crates/` belongs to this paused track. See the [crate guide](../../crates/README.md). The last `main` commit before the hybrid transition is tagged `native-first-final`. Contributor history is untouched.
Rust crates under `crates/` and `app/`, tests under `tests/`, fixtures, fuzz targets and benchmarks. The last `main` commit before the hybrid transition is tagged `native-first-final`. Contributor history is untouched.
## Verified achievements (synthetic evidence only)
-2
View File
@@ -1,7 +1,5 @@
# Phase 02 collaboration research
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
The implementation policy is [independent authorship](../../CONTRIBUTING.md).
Historical reuse discussion records the earlier survey. Xenora uses
public specifications and original fixtures, with other emulator
-2
View File
@@ -1,7 +1,5 @@
# Phase 02 Track B CPU feasibility
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
This historical feasibility study predates the [implemented guest experiments](../../experiments/x1/README.md). This review used the local dual-track brief and public sources. Local inspection reported `Darwin arm64` and macOS 27.3 (26C5047e). No CPU engine, loader, JIT or GPU workload was built or run for this report. [Existing CPU research](cpu-boundary.md) · [CPU boundary decision](../adr/0004-cpu-boundary.md)
## Engine comparison
-2
View File
@@ -1,7 +1,5 @@
# Phase 02 Xbox ecosystem research
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
The implementation policy is [independent authorship](../../CONTRIBUTING.md).
Historical reuse discussion records the earlier survey. Xenora uses
public specifications and original fixtures, with other emulator
+2 -4
View File
@@ -1,7 +1,5 @@
> **Superseded in part (2026-11-25).** This review recommended against Rosetta, Wine and CrossOver under the native-first plan. BetterXen's direction is now the CrossOver-based hybrid architecture ([roadmap](../roadmap.md), [ADR 0005](../adr/0005-crossover-hybrid-direction.md)); the screening facts below remain useful, the native-first recommendations do not. See the [upstream registry](upstream-registry.md) for the current provenance decision on VIctory-family projects.
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
# PortWatch review and a native macOS execution plan
Reviewed November 24, 2026 (America/Chicago). This is a public-documentation and
@@ -203,8 +201,8 @@ texture inventory respectively. Runtime PRs #263/#290 overlap substantially;
their author/maintainer must resolve them before new runtime edits. These
references are destination-repository numbers, not imported source numbers.
At this historical review, the [native development phases](../archive/development-phases-native-first.md) defined the
then-active work order, from compiled guest boot through modular workers, a
The replacement [development phases](../archive/development-phases-native-first.md) define the sole
active work order, from compiled guest boot through modular workers, a
guest-controlled Metal scene, an interactive application, a compatibility
corpus, sustained native execution and conditional Xbox experiments.
Hosted C is implemented on inspected main, awaiting independent acceptance;
@@ -1,9 +1,5 @@
# Primary-source verification (2026-11-25)
This is a dated desk-research and toolchain checkpoint. Later local shader
fixture observations are in the [integration report](victory-shader-integration.md);
its results do not resolve every unknown listed here.
Re-checks claims first taken from search summaries in [hybrid-backlog-research-2026-11-25.md](hybrid-backlog-research-2026-11-25.md). Evidence class D (public documentation read; nothing installed or run). Not legal advice. #363 still has to re-derive these independently.
| Claim | Result | Primary source read |
-2
View File
@@ -1,7 +1,5 @@
# Shader inputs and provenance
**Scope:** the original native fixture input contract below remains preserved. The active hybrid bridge supplies original compute machine code and explicit root layouts to `victory-shader`; no console-container corpus was validated. See the [integration report](victory-shader-integration.md). Parser presence is not compatibility evidence.
Use original assembly assembled by `llvm-mc` for `gfx1030`. Preserve its exact tool version and target options, byte range and endianness, object and extracted code digests, and independently derived outputs. Pass the validated code range and explicit stage and architecture through the Xenora fixture interface. Use a symbol or a declared code range when extracting from an object so alignment bytes and padding do not enter execution. An AMDHSA object also has a separate documented code object ABI (CLAIM-LLVM-GFX1030). [LLVM AMDGPU usage and code object layout](https://llvm.org/docs/AMDGPUUsage.html)
The documented DirectX container can carry either DXBC or DXIL shader parts. Its outer `DXBC` magic identifies the container structure. A DXIL program part contains versioned LLVM bitcode (CLAIM-DXCONTAINER-PAYLOAD). A self-authored HLSL shader compiled with public DXC remains a possible separate input path for later work. Apple's shader converter documents DXIL input to a Metal library (CLAIM-MSC-DXIL). [LLVM DXContainer](https://llvm.org/docs/DirectX/DXContainer.html), [Microsoft DXIL format](https://github.com/microsoft/DirectXShaderCompiler/blob/915bf4f93a254d920b4bcab75b6b1c622eacd816/docs/DXIL.rst#dxil-container-format), [Apple shader converter](https://developer.apple.com/metal/shader-converter/#your-first-conversion)
+6 -3
View File
@@ -37,15 +37,18 @@ Observed: a Wave32 program with 4 launched threads, each contributing 1.25, shou
| --- | --- | --- |
| `lanes4`: wave size and lane index, 4 threads | `0x2000`..`0x2003` (wave of 32) | exactly that |
| `sum_f32_4`: `WaveActiveSum(1.25f)`, 4 threads | `0x40a00000` in every lane | exactly that |
| `add_f64_4`: a plain `double` add (no wave operation) | low `0x00000000`, high `0x40000000` | **every dword still `0xDEADBEEF`: the shader wrote nothing** |
| `sum_f64_4`: `WaveActiveSum` over a `double` | low `0x00000000`, high `0x40140000` | **every dword still `0xDEADBEEF`: the shader wrote nothing** |
| `add_f32_4`: control, run-time load, float add, store | `0x40000000`, `0` per thread | exactly that |
| `add_f64_4`: a `double` add of run-time operands (DXIL contains `fadd fast double`) | low `0x00000000`, high `0x40000000` | **every dword still `0xDEADBEEF`: the shader wrote nothing** |
| `sum_f64_4`: `WaveActiveSum` over a run-time `double` (DXIL `waveActiveOp.f64`) | low `0x00000000`, high `0x40140000` | **every dword still `0xDEADBEEF`: the shader wrote nothing** |
An earlier version of `add_f64_4` used constant operands: the compiler folded the addition to `splitDouble(2.0)` with no `fadd` (reviewer finding by atesahmet0, confirmed with `dxc -dumpbin`), so it did not show a double *addition* failing. The probes above take their operands from the buffer at run time and were rerun; the result is the same.
So wave operations, wave width and partial waves are fine on this device. Any shader that uses a `double` runs without effect: pipeline creation succeeds, the dispatch completes, and nothing is stored. That matches the capability record (`DoublePrecisionFloatShaderOps = 0`; Metal has no fp64). Upstream's test harness zero-fills its output buffer, which is why it saw `0` instead of the sentinel. **Conclusion:** the failure comes from unsupported double-precision operations in the backend, combined with the recompiler emitting a native `double` in one place (`active_f64_sum`) while using integer emulation everywhere else. It is not a mistranslation of the wave operation and not a wave-semantics problem.
**Fix (recompiler, `active_f64_sum`):** the existing integer fp64 add (`add_f64`, checked upstream against the CPU's doubles) is reused to build the console's sum, which is the balanced tree over the lanes in their order. Each lane adds its partner run's partial sum, read through `waveReadLaneAt` from the first lane of that run that is present (found with a ballot, as `half_sum_present` already does for 16-bit sums), `+0.0` where none is, which is what a lane outside EXEC adds on the console. No `double` type is emitted and the doubles feature flag is no longer set. The same code covers the console wave64 on two host waves of 32 (an integer add for the last step).
**Validation** (M4, CrossOver 26.3, default backend; one machine, not independently reproduced):
- Whole suite under CrossOver: **229 passed, 0 failed, 3 ignored** (was 224 passed, 2 failed). macOS: 179 + new tests pass (`cargo test -p victory-shader`).
- Whole suite under CrossOver: **232 passed, 0 failed, 3 ignored** (229 before the review's sampler tests) (was 224 passed, 2 failed). macOS: 179 + new tests pass (`cargo test -p victory-shader`).
- New test `f64_wave_sums_match_the_cpu_tree_bit_for_bit`: 24 cases (1, 4, 20 and 32 launched threads; six values including ones that round: 0.1, 123456.789, a value one ulp above 1.0, -3.75e10, 1e-300), comparing all 64 bits with a CPU model of the balanced tree using the CPU's own f64 additions and `+0.0` for lanes that are not launched. All 24 match. The model is independent of the recompiler.
- Negative controls: against the **original** lowering this GPU test fails (`got 0x0000000000000000, want 0x3ff4000000000000`) and the new `the_f64_wave_sum_is_lowered_without_native_doubles` test (the container's feature word must declare wave operations but not doubles) fails too; both pass with the fix.
+1 -1
View File
@@ -1,6 +1,6 @@
# Public graphics sources
Reviewed 2026-11-22. Evidence classes apply to the specific claims in [claims.toml](../claims.toml). The sources below were consulted for original research notes. No upstream files or binary artifacts were imported by that source review. Later component reuse, including the vendored shader compiler, is recorded separately in the [upstream registry](upstream-registry.md).
Reviewed 2026-11-22. Evidence classes apply to the specific claims in [claims.toml](../claims.toml). The sources below were consulted for original research notes. No upstream files or binary artifacts were imported.
| Publisher and version | Consulted sections | License and access |
|---|---|---|
-2
View File
@@ -1,7 +1,5 @@
# Synthetic guest integration and upstream evidence
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
## Source snapshots
The repository audit supplied for this session inspected these public
-2
View File
@@ -1,7 +1,5 @@
# Texture format and layout inventory
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
This page records which texture formats and memory layouts BetterXen handles today, and at which stage. It also records which gaps are worth closing and which are deferred. It is an inventory of the repository at the time of writing, built from the code and tests it links. It is not a support claim: a format listed here works only for the original synthetic fixtures named, on desktop specifications, and nothing here says anything about Xbox hardware or commercial titles.
## Stages
+5 -11
View File
@@ -1,15 +1,5 @@
# Upstream research registry
## Split integration update
The original discovery assessment below is retained as a dated research snapshot. The split shader integration subsequently included only `crates/victory-shader` from `skakwy/victory-mac` at `22b3f8e45a59f7d11fef7718988c58d0b3f1d0f9`, plus BetterXen fixture additions. Its [provenance record](../../crates/victory-shader/UPSTREAM.md), [license record](../licenses.md) and [local integration results](victory-shader-integration.md) are the component-specific records, not an approval of the wider VIctory family. This documentation audit does not independently certify that review. Other upstream runtime, loader, game-specific and decryption components remain excluded.
| Component | Selected scope | Recorded license and limits |
| --- | --- | --- |
| `victory-shader` | Vendored GFX10-to-DXIL snapshot and original compute-fixture bridge | Upstream GPL record and retained MIT opcode-table notice; exact files, modifications and attribution in `UPSTREAM.md`. Independent provenance/acceptance review is not claimed here. |
## Original discovery assessment (2026-11-25)
Reviewed 2026-11-25. Every entry is **evidence class D** (non-normative official or project material) in the sense used by the issue templates and [claims.toml](../claims.toml): a review of public documentation and repository metadata. Nothing here was installed, built or run, so none of it is a statement that a project works for BetterXen's goals. Licenses are what the repository's own license file or GitHub's license detection reported; they still need the per-file check in the [reuse matrix](component-reuse-matrix.md) and are not legal advice. Pins are the default-branch head observed with `git ls-remote` on the review date. Independent re-derivation of this table is tracked in issue #363.
| Project | Source | Pin (head) | License as reported | Role for BetterXen | Findings |
@@ -25,6 +15,10 @@ Reviewed 2026-11-25. Every entry is **evidence class D** (non-normative official
| VIctory-macOS | [pragyaangaur/VIctory-macOS](https://github.com/pragyaangaur/VIctory-macOS) | `485b230ef596` | GPL-3.0 (GitHub) | Discovery reference only | A macOS port of VIctory using Rosetta, CrossOver Wine and D3DMetal per its README (also noted in [portwatch-native-macos.md](portwatch-native-macos.md)). Same input concern. Its test and "works" claims are self-reported and not verified here. The repository has no parent fork, so the "canonical upstream" is VIctory. |
| PortWatch VI | [portwatch-vi.xyz](https://portwatch-vi.xyz/), [4lwayz/portwatch-vi](https://github.com/4lwayz/portwatch-vi) | `ed00263cc0c9` | NOASSERTION | Project discovery reference | A tracker of community efforts; progress figures are editorial, with self-reported claims labelled. Not engineering evidence; flagged and ignored queues are not endorsed. |
## victory-shader import under review
`skakwy/victory-mac` `crates/victory-shader` at `22b3f8e45a59` is proposed for vendoring in PR #394. **Not approved.** See the [per-file provenance and licence review](victory-shader-provenance.md); the provenance decision below stands until a maintainer changes it.
## Additional candidates found by search (not reviewed)
Found by GitHub search on 2026-11-25. Only repository metadata was read; none was evaluated, installed or run, and none is a recommendation. Licenses are what GitHub reported.
@@ -43,4 +37,4 @@ Apple's Game Porting Toolkit documentation and license (D3DMetal's actual terms)
## Provenance decision
At this initial discovery review, VIctory-family projects were not adopted. The later shader-only snapshot is recorded above; no broader adoption follows from it. Their GPL grants apply to their own source; they do not establish that the material they were built for is authorized. The registry records them for architecture ideas visible in public documentation (cache identity, upload visibility, test structure). No code, shader corpus, asset or tooling from them enters BetterXen without a recorded per-file review, and anything game-specific or decryption-related is excluded.
VIctory-family projects are not adopted. Their GPL grants apply to their own source; they do not establish that the material they were built for is authorized. The registry records them for architecture ideas visible in public documentation (cache identity, upload visibility, test structure). No code, shader corpus, asset or tooling from them enters BetterXen without a recorded per-file review, and anything game-specific or decryption-related is excluded.
+8 -19
View File
@@ -1,12 +1,10 @@
# victory-shader integration (GFX10 to DXIL recompiler)
This report separates the initial snapshot results from the subsequent [wave investigation and fixes](shader-wave-semantics.md), now included through PR #394 and the top of the split stack, PR #395. All recorded hardware results remain local observations, not independent acceptance. The runner dependencies are separate.
Evidence: classes noted per row. Everything ran on one machine (Apple M4, 24 GiB, macOS 27.0, CrossOver 26.3.0.39832, bottle `betterxen-test`, default backend) and has **not been independently reproduced**. No game, console title or leaked material was used.
Evidence: classes noted per row. Everything ran on one machine (Apple M4, 24 GiB, macOS 27.0, CrossOver 26.3.0.39832, bottle `betterxen-test`, default backend) and has **not been independently reproduced**. BetterXen's runs used no game files or leaked material. **The vendored code itself was developed against one commercial title's shaders** and is not approved for merge: see [victory-shader-provenance.md](victory-shader-provenance.md).
## What was integrated
`crates/victory-shader` is a snapshot of `crates/victory-shader/` from skakwy's [victory-mac](https://github.com/skakwy/victory-mac) (head `22b3f8e45a59`). It translates GFX10 (RDNA 2) machine code to PC DXIL, shader model 6.6, in pure Rust: a GFX10 decoder with an SP3 printer, control-flow structurizer, register spilling, wave emulation, fp64 by integer operations, its own LLVM 3.7 bitcode writer and DXIL container writer. About 43,500 lines against 4,022 in BetterXen's native `xenora-shader`. The native RDNA-to-Metal compiler is untouched and still paused; the two are different targets (DXIL for D3D12 under CrossOver versus MSL) and nothing was replaced. Provenance, authors, licences, the initial 19 lint-only lines and subsequent wave changes are in [`crates/victory-shader/UPSTREAM.md`](../../crates/victory-shader/UPSTREAM.md). Licensing: GPL-3.0 upstream, GPL-3.0-or-later here, one MIT Mesa-derived table with its notice kept.
`crates/victory-shader` is a snapshot of `crates/victory-shader/` from skakwy's [victory-mac](https://github.com/skakwy/victory-mac) (head `22b3f8e45a59`). It translates GFX10 (RDNA 2) machine code to PC DXIL, shader model 6.6, in pure Rust: a GFX10 decoder with an SP3 printer, control-flow structurizer, register spilling, wave emulation, fp64 by integer operations, its own LLVM 3.7 bitcode writer and DXIL container writer. About 43,500 lines against 4,022 in BetterXen's native `xenora-shader`. The native RDNA-to-Metal compiler is untouched and still paused; the two are different targets (DXIL for D3D12 under CrossOver versus MSL) and nothing was replaced. Provenance, authors, licences and the 19 changed lines are in [`crates/victory-shader/UPSTREAM.md`](../../crates/victory-shader/UPSTREAM.md). Licensing: GPL-3.0 upstream, GPL-3.0-or-later here, one MIT Mesa-derived table with its notice kept.
Left out on purpose: the upstream repository's loader, HLE, GPU runtime and game-specific code (one console title's runtime) and their provenance questions; the console shader containers the crate can also parse were not exercised, because no authorized container exists.
@@ -14,7 +12,7 @@ Left out on purpose: the upstream repository's loader, HLE, GPU runtime and game
- `emit::translate_native` (BetterXen addition, `emit/betterxen.rs`): the crate only accepted shaders inside console containers; this entry point takes a compute program as machine code plus root layout, which is what BetterXen has.
- `emit/betterxen_tests.rs`: BetterXen's own synthetic gfx1030 Wave32 fixtures (`fixtures/rdna2/*.bin`, original, assembled with LLVM's `llvm-mc`) are wrapped in a short descriptor-table prologue, translated to DXIL, and compared with the expected words in `fixtures/manifest.toml`. Those expectations were derived by hand in the manifest and are checked by BetterXen's independent reference; none comes from the recompiler. Six of the eleven manifest fixtures have input and expected words (add, float-exact, bitwise-branch, or, shifts, ashr); the five graphics-stage fixtures (`x9-*`) have none and are not bridged.
- Running the cross-built Windows test executable under CrossOver is done by `scripts/hybrid/run-shader-gpu-tests.sh` through `betterxen-hybrid run`. The script is in PR #395 on top of the shader crate (#394); the `betterxen-hybrid` runner and stall supervision are separate PRs #384 and #388, absent from that base. The GPU results below were produced with those dependencies present. See the [architecture guide](../architecture.md) and [testing prerequisites](../testing/README.md).
- Running the cross-built Windows test executable under CrossOver is done by `scripts/hybrid/run-shader-gpu-tests.sh` through `betterxen-hybrid run`. Those live in separate pull requests (the hybrid runner, and the script on top of it); the GPU results below were produced with them.
## Results
@@ -26,24 +24,15 @@ Left out on purpose: the upstream repository's loader, HLE, GPU runtime and game
| BetterXen fixtures run on the GPU: D3D12 under CrossOver 26.3 (D3DMetal) | **6 of 6 output words match the manifest** | via `betterxen-hybrid run`, 2.3 to 2.6 s including bottle start; the GPU is a D3D12 device with shader model 6.6 as upstream's host layer requires |
| Negative control | a flipped expected word is rejected; the output is not the zeroed buffer | `a_wrong_expectation_is_detected` |
| Same GPU tests on DXMT, DXVK and wined3d (no D3D12) | fail with "no SM 6.6 D3D12 hardware device: not verified" | confirms they cannot pass by skipping; upstream's own tests print "skipped" instead |
| Original vendored suite before the wave fixes, under CrossOver (default backend), 229 tests | 224 passed, **2 failed**, 3 ignored | the two failures are explained in `shader-wave-semantics.md` |
| Whole suite with the wave fixes in the integration stack, under CrossOver | **232 tests: 229 passed, 0 failed, 3 ignored** | the 3 additional tests are BetterXen's f64 tests; see below |
| Whole upstream suite, vendored unchanged, under CrossOver (default backend), 229 tests | 224 passed, **2 failed**, 3 ignored | the two failures are explained in `shader-wave-semantics.md` |
| Whole suite with the fixes in this PR, under CrossOver | **232 tests: 229 passed, 0 failed, 3 ignored** | the 3 additional tests are BetterXen's f64 tests; see below |
| Upstream suite on a backend without D3D12 (DXMT) | 201 passed, 25 failed, 3 ignored | see the classification below |
The initial failures were `whole_wave_f64_sum_and_cvt_f32_f64` (returned 0,
expected `0x40a00000`) and
`a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit`
(returned 0, expected `0x5914`). The later
[wave investigation](shader-wave-semantics.md) supersedes the initial wave-width
hypothesis: it records unsupported native double operations for the first case
and an invalid 64-lane test precondition on a 32-lane device for the second.
The stack now uses integer fp64 addition for the sum and device-aware rejection
for the 64-lane-only case. Neither change establishes Xbox-hardware agreement.
The two failures are `whole_wave_f64_sum_and_cvt_f32_f64` (a wave-wide fp64 sum returned 0, expected `0x40a00000`) and `a_sum_of_halves_where_lanes_have_left_is_the_consoles_tree_bit_for_bit` (64 lanes: got 0, expected `0x5914`). Both are cross-lane wave reductions of the console's 64-lane waves. Hypothesis, **not verified**: the host's waves are 32 lanes wide (Apple GPU) and D3DMetal does not honour the required wave size or wave operation semantics. The cause, and whether upstream passes them on a Windows GPU, were not investigated.
## Which tests actually executed on the GPU
The harness reports a test as passed whether or not it touched the GPU; many return early when no device is available. Each test was therefore run on the default backend (D3D12 via D3DMetal) and on DXMT (no D3D12), with libtest JSON output including each test's own printed output (`--format json --show-output`). A test counts as GPU-dependent if its outcome changes without D3D12 or it prints "no SM 6.6 hardware device; skipped" there. After the included wave fixes (232 tests: 225 upstream, 7 BetterXen):
The harness reports a test as passed whether or not it touched the GPU; many return early when no device is available. Each test was therefore run on the default backend (D3D12 via D3DMetal) and on DXMT (no D3D12), with libtest JSON output including each test's own printed output (`--format json --show-output`). A test counts as GPU-dependent if its outcome changes without D3D12 or it prints "no SM 6.6 hardware device; skipped" there. Final content of this PR (232 tests: 225 upstream, 7 BetterXen):
| Group | Tests |
| --- | --- |
@@ -52,7 +41,7 @@ The harness reports a test as passed whether or not it touched the GPU; many ret
| Not GPU-dependent: CPU-side (decode, structurize, lower, emit, container) or ignored | 201, including 3 ignored |
| Total | 232 |
For the vendored upstream code before the included wave fixes the same method gave 229 tests: 32 GPU-dependent, 30 passed on the device and 2 failed (they "passed" without D3D12 by skipping, which hid the failures), see `shader-wave-semantics.md`. Three of the 31 are BetterXen's GPU tests (fixtures, negative control, bit-exact f64 sums). Counts are by name from the JSON events and are exact for this binary and machine. "WARP" skips (the software adapter, which Wine does not provide) and "no `dxil.dll`" skips are not GPU runs and are not counted as such.
For the vendored upstream code before the fixes in this PR the same method gave 229 tests: 32 GPU-dependent, 30 passed on the device and 2 failed (they "passed" without D3D12 by skipping, which hid the failures), see `shader-wave-semantics.md`. Three of the 31 are BetterXen's GPU tests (fixtures, negative control, bit-exact f64 sums). Counts are by name from the JSON events and are exact for this binary and machine. "WARP" skips (the software adapter, which Wine does not provide) and "no `dxil.dll`" skips are not GPU runs and are not counted as such.
## Limits
@@ -0,0 +1,66 @@
# victory-shader: per-file provenance and licence review
**Status: NOT APPROVED. A maintainer decision is required before PR #394 can merge.** This is the review the engineering rules require for VIctory-family code. It records facts; it does not grant approval, and its author is the person who proposed the import, so it is not an independent review.
Upstream: <https://github.com/skakwy/victory-mac>, revision `22b3f8e45a59f7d11fef7718988c58d0b3f1d0f9`. Method: every tracked file of `crates/victory-shader/` at that revision; authors from `git shortlog`; licence from the repository `LICENSE` and a search of each file for other notices; title references by searching for shader names of the form `module:CS_Name` and the words title, titles, game, games. The search finds references, not every dependence: a file without one may still have been developed against the same title.
## Findings
1. **Licence:** GPL-3.0, compatible with BetterXen's GPL-3.0-or-later. One third-party notice (Mesa-derived opcode names, MIT, Valve) in `src/gfx10/opcodes.rs`, kept. Some comments cite Mesa behaviour and LLVM definitions. skakwy and the VIctory-macOS maintainer authorized reuse of their own contributions (relayed by the maintainer); other authors' lines rest on the repository licence.
2. **The crate was developed against one commercial title's shaders.** 17 of 36 files refer to "the title" or "the game"; comments describe that title's programs, layouts and structures, and four places cite its shaders by name (`wave64_tests.rs`, `wave.rs`, `own_bits.rs`). The upstream project's stated purpose is to run that title's Xbox Series build; this registry and PortWatch record that build as leaked.
3. **What is not in the crate:** a search found no shader binaries, shader dumps, game assets, keys or decryption code. The references are in comments, test descriptions and handling of shader constructs.
4. **Earlier statements that were wrong:** the integration record and PR descriptions said the crate had nothing game-specific. That claim came from searching only for the game's and publisher's names. It is withdrawn.
## How this meets the engineering rules (`AGENTS.md`)
| Rule | Assessment |
| --- | --- |
| "Projects whose stated purpose depends on leaked or unauthorized builds ... are discovery references at documentation level; adopt nothing from them without a per-file provenance and license review recorded in the registry." | This file is that record. Recording it does not by itself approve adoption. |
| "Game-specific, asset-specific and decryption-related code is never adopted." | Handling written for and documented against one title's shaders is present in at least some files. Whether that makes a file "game-specific code" is the decision to make; it is a general GFX10 recompiler in structure, with title-driven behaviour inside it. |
| "Provenance first: exclude anything derived from leaked proprietary material or unauthorized software." | Layouts "as observed in shipped titles" (`native.rs`) and behaviour tuned to the title's programs are plausibly derived from that material. |
| "Never copy, port, translate or adapt source from emulator projects built for leaked or unauthorized material." | Read plainly, this applies to this import. Author permission does not change it. |
**Reviewer's recommendation to the maintainer:** under the rules as written, do not merge the import. Either decline it (keep the crate as a documentation-level reference; BetterXen's own fixtures, probes and findings stand on their own), or change the rule explicitly in `AGENTS.md` with the legal question considered, and then decide file by file. This is not legal advice.
## Per-file record
| File (under `crates/victory-shader/`) | Lines | Upstream authors (commits) | Licence and third-party notes | Shader names of a title | Lines saying title/game |
| --- | --- | --- | --- | --- | --- |
| `Cargo.toml` | 40 | Marvis (2), fxceless (1) | GPL-3.0 (repository licence) | - | - |
| `src/bvh.rs` | 696 | fxceless (2) | GPL-3.0 (repository licence) | - | 5 |
| `src/dxbc.rs` | 181 | Marvis (2) | GPL-3.0 (repository licence) | - | - |
| `src/dxil.rs` | 211 | Marvis (1) | GPL-3.0 (repository licence); cites LLVM | - | - |
| `src/emit/bitcode.rs` | 1240 | Marvis (3), fxceless (2), Lyrnc (1) +2 more | GPL-3.0 (repository licence); cites LLVM | - | - |
| `src/emit/bitcode/census.rs` | 174 | fxceless (1) | GPL-3.0 (repository licence) | - | - |
| `src/emit/bitcode/opt.rs` | 2140 | armin (1), fxceless (1) | GPL-3.0 (repository licence) | - | 1 |
| `src/emit/container.rs` | 419 | Duff (1), Marvis (1), fxceless (1) +1 more | GPL-3.0 (repository licence) | - | - |
| `src/emit/diff_tests.rs` | 1287 | Marvis (3), fxceless (1) | GPL-3.0 (repository licence) | - | 5 |
| `src/emit/f64.rs` | 409 | skakwy (1) | GPL-3.0 (repository licence) | - | - |
| `src/emit/host.rs` | 1472 | fxceless (3), Marvis (1), skakwy (1) | GPL-3.0 (repository licence) | - | - |
| `src/emit/intersect.rs` | 557 | fxceless (1) | GPL-3.0 (repository licence) | - | 12 |
| `src/emit/intersect_tests.rs` | 690 | fxceless (1) | GPL-3.0 (repository licence) | - | 15 |
| `src/emit/lower.rs` | 12268 | Marvis (21), skakwy (9), fxceless (6) +23 more | GPL-3.0 (repository licence); comment cites Mesa behaviour; cites LLVM | - | 18 |
| `src/emit/mod.rs` | 1755 | Marvis (7), fxceless (6), skakwy (4) +8 more | GPL-3.0 (repository licence) | - | 16 |
| `src/emit/own_bits.rs` | 914 | fxceless (1) | GPL-3.0 (repository licence) | 1 | 3 |
| `src/emit/rect.rs` | 484 | fxceless (2) | GPL-3.0 (repository licence) | - | 2 |
| `src/emit/sampler.rs` | 125 | Marvis (1) | GPL-3.0 (repository licence) | - | 1 |
| `src/emit/shader.rs` | 908 | fxceless (4), Claude (1), Duff (1) +4 more | GPL-3.0 (repository licence) | - | 8 |
| `src/emit/threading.rs` | 218 | fxceless (1) | GPL-3.0 (repository licence) | - | - |
| `src/emit/validator.rs` | 221 | Marvis (1), lameloball2813-ui (1) | GPL-3.0 (repository licence) | - | - |
| `src/emit/valu_tests.rs` | 1624 | Marvis (6), r4. (5), fxceless (4) +6 more | GPL-3.0 (repository licence) | - | - |
| `src/emit/waterfall_tests.rs` | 435 | r4. (3), Marvis (1), Noname0202 (1) +1 more | GPL-3.0 (repository licence) | - | - |
| `src/emit/wave.rs` | 1228 | fxceless (3), skakwy (2), AscilCH (1) +1 more | GPL-3.0 (repository licence) | 1 | - |
| `src/emit/wave64_tests.rs` | 532 | fxceless (1), triippywhale (1) | GPL-3.0 (repository licence) | 2 | - |
| `src/gfx10/fields.rs` | 815 | Marvis (1), fxceless (1) | GPL-3.0 (repository licence) | - | - |
| `src/gfx10/mod.rs` | 496 | Marvis (3), tedin7 (1) | GPL-3.0 (repository licence) | - | - |
| `src/gfx10/opcodes.rs` | 1333 | Duff (1), Marvis (1) | GPL-3.0 (repository licence); Mesa-derived, MIT (Valve), notice in header; cites LLVM | - | - |
| `src/gfx10/sp3.rs` | 784 | Marvis (1) | GPL-3.0 (repository licence) | - | - |
| `src/io.rs` | 826 | Marvis (1), fxceless (1), local (1) | GPL-3.0 (repository licence) | - | - |
| `src/ir.rs` | 1791 | fxceless (4), Marvis (2), Yaekai (1) +1 more | GPL-3.0 (repository licence) | - | 1 |
| `src/lib.rs` | 38 | Marvis (3), fxceless (1) | GPL-3.0 (repository licence); cites LLVM | - | - |
| `src/native.rs` | 1103 | Marvis (4), fxceless (1), local (1) | GPL-3.0 (repository licence) | - | 1 |
| `src/resource.rs` | 3848 | Claude (3), fxceless (3), Marvis (2) +2 more | GPL-3.0 (repository licence); cites LLVM | - | 10 |
| `src/spill.rs` | 380 | fxceless (2) | GPL-3.0 (repository licence) | - | 1 |
| `src/structure.rs` | 1899 | Marvis (2), fxceless (2), DexNom (1) +2 more | GPL-3.0 (repository licence) | - | - |
BetterXen's additions (`src/emit/betterxen.rs`, `src/emit/betterxen_tests.rs`, `Cargo.toml`, `UPSTREAM.md`) are original, GPL-3.0-or-later. Functional edits to upstream files are listed in `crates/victory-shader/UPSTREAM.md`.
-2
View File
@@ -1,7 +1,5 @@
# Open Phase 01 risks
**Historical native Phase 01 register.** Owners and next experiments below retain their original candidate scope; they are not current assignments or hybrid priorities. Active hybrid risks and exit conditions are in the [roadmap](roadmap.md), with component boundaries in [architecture.md](architecture.md).
| ID | Risk and impact | Current evidence | Owner and next experiment |
|---|---|---|---|
| R1 | Console shader container, launch state and resource descriptors remain unknown, so the fixture cannot establish console compatibility. | Public related-target specifications, class C | Xbox research. Seek an authorized exact-target specification before proposing a parser. |
+2 -4
View File
@@ -1,7 +1,5 @@
# BetterXen roadmap
The [architecture guide](architecture.md) separates code present in the split integration stack from the separate hybrid runner PRs. Local synthetic results do not satisfy the independent baseline or advance the phase automatically. Issue lists and parked items below record the transition plan; consult current issue state before selecting work.
**This is the single authoritative active roadmap.** GitHub Issues hold the current phase's tasks, the open milestone names the current phase, and this file explains strategy, phase order, parked work and completion criteria. If another document disagrees, this one governs, except [ADR 0005](adr/0005-crossover-hybrid-direction.md) for the decision itself.
## Direction
@@ -26,7 +24,7 @@ Only the current phase has a GitHub milestone and detailed issues. Later phases
## Engineering rules
[AGENTS.md](../AGENTS.md) (`CLAUDE.md` is a symlink to it) was rewritten to permit CrossOver, Wine-based infrastructure, Rosetta 2 and D3DMetal subject to licensing; ADR 0005 records the decision. The honesty, verification, provenance and clean-room rules are unchanged. The transition is recorded in repository history; use the requested PR base or current `main`, not the former planning branch, for new work.
[AGENTS.md](../AGENTS.md) (`CLAUDE.md` is a symlink to it) was rewritten to permit CrossOver, Wine-based infrastructure, Rosetta 2 and D3DMetal subject to licensing; ADR 0005 records the decision. The honesty, verification, provenance and clean-room rules are unchanged. Both are on the local branch `planning/hybrid-first-transition` and await maintainer review; nothing has been pushed.
## How progress is reported
@@ -48,7 +46,7 @@ Phase status is one of: Not started, Researching, In development, Blocked, In va
6. A reproducible CrossOver environment and a recorded baseline of CPU, GPU, memory and stability, reproduced by a second contributor ([#355](https://github.com/MacosPorters/betterxen/issues/355)).
7. BetterXen's responsibilities versus CrossOver's recorded in an ADR a maintainer accepts ([#351](https://github.com/MacosPorters/betterxen/issues/351)).
**Transition issue inventory (not a live status query):** #145, #348, #350, #351, #353, #354, #355, #363, #364, #365, plus #346 (project board, needs the GitHub `project` token scope; does not block engineering).
**Open issues:** #145, #348, #350, #351, #353, #354, #355, #363, #364, #365, plus #346 (project board, needs the GitHub `project` token scope; does not block engineering).
**Known risks:** CrossOver is proprietary, so bundling or modifying may be prohibited; integration interfaces may be undocumented (see below); Xbox titles may not run at all.
-2
View File
@@ -1,7 +1,5 @@
# Runtime service registry
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
Guest imports resolve through one lookup, `ImportRegistry::resolve`. Binding, the static probe and the command-line reports all use it, and they read the import directory with one bounded parser, `import_table::parse_imports`.
| Part | File | Role |
-2
View File
@@ -1,7 +1,5 @@
# Typed runtime services
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
Generated by `xenora-runtime-gen` from `crates/loader/runtime/services.txt`. Do not edit.
A declared service is not a claim of compatibility. `implemented` and `partial` describe behaviour against the documented contract for the synthetic guest. No service has been independently accepted.
-2
View File
@@ -1,7 +1,5 @@
# Guest threads
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
`crates/loader/src/scheduler.rs` runs guest threads deterministically on one host thread. A guest thread is a CPU context, a guarded stack and a TEB; it is never a host thread. Guest threads never execute at the same time, so no guest memory-ordering model is relied on (#199).
## Scheduling
-2
View File
@@ -1,7 +1,5 @@
# gfx1030 instruction coverage
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
For counts of every gfx1030 form in AMD's metadata against forms Xenora can execute, run `xenora shaders coverage`. Its "discovered" column is metadata coverage, not execution support.
The decoder accepts an explicitly tagged, little-endian gfx1030 Wave32
-2
View File
@@ -1,7 +1,5 @@
# Synthetic compute lowering
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
The compiler accepts explicitly tagged raw gfx1030 code up to 1,024 bytes and requires a whole number of 32-bit words. The verifier checks source initialization, exact resource slots and address operands, immutability of VGPR 0, memory ordering, one completed output store and program termination. VGPR 0 is reserved for resource indexing. Keeping it out of arithmetic means the host's grid position is never exposed as a guest register value.
Verification maps each initialized register to its latest typed temporary. Reads after a load require a load wait. Because generated memory accesses are synchronous expressions within a thread and buffers are disjoint, waits can be discharged during verification. Metal completion is still required before host readback. Store and load aliases between lanes are excluded by the [fixture ABI](../adr/0003-demo-memory-model.md). The output buffer uses Metal index 1 and the read-only input uses index 0.
-2
View File
@@ -1,7 +1,5 @@
# Independent gfx1030 CPU reference
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
`xenora_ref::execute` reads raw little-endian code bytes and input words without dependencies on the production ISA crate, the compiler or Metal. It accepts at most 1024 instruction bytes and 4096 input words. The synthetic ABI gives every invocation its own input and output word. The indexed load and store forms need no host address arithmetic, and V0 is reserved for that indexing. Dispatch indices form Wave32 waves of 32 consecutive invocations, executed in lockstep with shared scalar state. The reference accepts uniform forward branches driven by scalar register state or by a compare mask in VCC_LO. Cross-lane register access other than compare masks, and EXEC derived from lane data, are outside the subset. Floating-point arithmetic is restricted to positive normal inputs and exact normal results.
| AMD RDNA 2 ISA guide instruction | Reference operation |
-2
View File
@@ -1,7 +1,5 @@
# SOP2 scalar ALU subset
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
Xenora decodes and executes thirty-three gfx1030 SOP2 forms. Each takes 32-bit
operands and writes a normal SGPR (s0-s105). The seventeen below set SCC; the
sixteen in [Arithmetic, select and bit-field forms](#arithmetic-select-and-bit-field-forms)
-2
View File
@@ -1,7 +1,5 @@
# SOPK scalar immediate forms
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
Xenora decodes and translates sixteen gfx1030 SOPK integer forms through the
semantic registry (`crates/isa/semantics/rdna2/sopk.toml`, operand rules
`sopk_sgpr` and `sopk_compare`). Each is one 32-bit word: SIMM16 in bits 0-15,
-2
View File
@@ -1,7 +1,5 @@
# Adding an instruction through the semantic registry
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
The semantic registry is a data file that declares what each supported gfx1030
instruction form does. A generator checks it and turns it into Rust tables that
the decoder uses. This page explains where entries live, what each field means,
-2
View File
@@ -1,7 +1,5 @@
# Execution contract: bounded Wave32 VOPC integer compares (issue #186)
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
Status: v2, after independent review (codex-contract.log); findings 1-7 addressed. Scope is the Xenora compute-fixture ABI
(one input word and one output word per dispatched thread; dispatch index `i`
is wave `i / 32`, lane `i % 32`; every wave starts with EXEC_LO = 0xffffffff;
-2
View File
@@ -1,7 +1,5 @@
# Wave32 vector unary integer operations and swap
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
Xenora translates six gfx1030 VOP1 integer forms for the synthetic Wave32 compute
ABI. The AMD RDNA 2 ISA Reference Guide defines the operations in section 12.8,
the encoding in section 13.3.2, and the execution mask (EXEC) in section 3.3.
-2
View File
@@ -1,7 +1,5 @@
# Wave32 vector select, carry and borrow
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
The gfx1030 compute fixture ABI supports four 32-bit vector two-operand
instruction (VOP2) forms that read the vector condition code (VCC).
In Wave32, bit `n` of `VCC_LO` supplies lane `n`'s input `c`.
-78
View File
@@ -1,83 +1,5 @@
# Testing and acceptance
## Select checks by scope
Active hybrid work follows the [architecture guide](../architecture.md).
Preserved native tests remain regression checks, with their original synthetic
scope. Historical Phase 01/02 and G-number acceptance gates are not the current
hybrid phase criteria. The [roadmap](../roadmap.md) controls phase completion.
### Documentation-only changes
Run from the repository root:
```sh
python3 scripts/audit/docs_hygiene.py --require-yaml
python3 scripts/audit/status.py --check
python3 scripts/audit/semantic_coverage.py --check
scripts/audit/claims.sh
scripts/audit/dependencies.sh
git diff --check
```
Hygiene checks tracked relative Markdown file links, conflict markers and
workflow YAML; it does not validate anchors or external URLs. Status and coverage
checks detect drift in generated native tables. These are consistency checks,
not CPU/GPU execution or independent acceptance. API documentation can also be
compiled with `CARGO_BUILD_JOBS=2 cargo +1.100.0 doc --locked --workspace --no-deps`.
### Hybrid shader fixtures
On native ARM64 macOS with Rust 1.100.0 selected, `cargo test --locked -p victory-shader` runs CPU-side
compiler tests. Windows-only GPU tests require a Windows guest executable,
an externally installed CrossOver with a configured bottle and a D3D12-capable
backend. DXIL emission alone is not GPU verification.
The following command additionally requires a checkout containing the
`betterxen-hybrid` runner from [PR #384](https://github.com/MacosPorters/betterxen/pull/384)
and stall supervision from [PR #388](https://github.com/MacosPorters/betterxen/pull/388).
They are absent from the split shader/script stack's base. Install Rust 1.100.0
with `x86_64-pc-windows-gnullvm` and provide an unpacked llvm-mingw toolchain
(the recorded integration used release 20261117):
```sh
scripts/hybrid/run-shader-gpu-tests.sh /path/to/llvm-mingw betterxen-test fixtures
# Optional whole upstream suite, including the wave fixes now in this stack:
scripts/hybrid/run-shader-gpu-tests.sh /path/to/llvm-mingw betterxen-test all
```
`fixtures` filters on `betterxen`; the latest stack adds three fp64 tests to the
original four BetterXen tests. The script still expects the literal summary
`test result: ok. 4 passed`, so that expectation may reject a successful run of
the expanded selection. This documentation PR leaves the script unchanged.
Use `all` for the recorded whole-suite procedure and inspect output and skips. The script obtains the executable from Cargo build messages and
uses `debug/deps` as a fallback. It delegates supervision to the hybrid runner
and writes records under ignored `artifacts/hybrid-runs/`.
Record source revisions, host, CrossOver/bottle/backend, Rust and cross-toolchain
versions, commands, output and pass/fail/skip counts. Inspect whether each test
actually dispatched: some upstream tests return success after skipping when
D3D12, WARP or `dxil.dll` is unavailable. BetterXen's GPU tests fail without the
required hardware device. The [integration report](../research/victory-shader-integration.md)
preserves the original two failures and the included
[wave fixes](../research/shader-wave-semantics.md), which report 229 passed,
0 failed and 3 ignored on the recorded host. The device-width rejection test
is a CPU rejection check on that host, not a verified 64-lane GPU sum. No independent reproduction or
phase completion is claimed.
### Workspace and preserved native regressions
Use `cargo fmt --all -- --check`,
`cargo clippy --locked --workspace --all-targets -- -D warnings` and
`cargo test --locked --workspace` as appropriate to code changes.
`scripts/test-gpu.sh`, `scripts/demo.sh`, the independent semantic review,
fixture assembly, mutation and benchmark procedures below exercise the
preserved native path. They do not launch CrossOver or validate the DXIL path.
A successful native run does not substitute for hybrid workload readback.
Keep unavailable tools, excluded target modules and ignored tests visible.
## Preserved procedures and evidence
- [Migrated pull-request integration review](migration-pr-review.md) — Merge decisions, fixes, native verification and remaining scope limits.
- [AMD RDNA2 desktop GPU (gfx1030) form acceptance](shader-form-acceptance.md) — Rule and evidence required to promote a form from local results to `fixture verified`.
- [Test inventory comparison](test-inventory.md) — Detect missing or newly ignored Cargo tests across commits.
-2
View File
@@ -1,7 +1,5 @@
# Benchmark protocol
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
The benchmark harness measures each fixture in its manifest that passes its
correctness test in the same run. It never reports a number for a shader that
failed or was skipped.
-2
View File
@@ -1,7 +1,5 @@
# CPU test runtime, shards and coverage map
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
This page records what the CPU test gate costs, describes
`scripts/cpu-tests.sh`, which splits that gate into deterministic shards, and
maps which x86-64 and loader behavior the tests verify. The shards are a
-63
View File
@@ -1,63 +0,0 @@
# Hybrid documentation consistency audit
Audited 2026-11-25 for the maintainer's documentation-only alignment task.
Base: `59b6c4db5e2ceba5aecafc947d1f314c8fe0a895`, the head of split integration
[PR #395](https://github.com/MacosPorters/betterxen/pull/395), stacked on
[PR #394](https://github.com/MacosPorters/betterxen/pull/394). The documentation
branch is `docs/hybrid-architecture-alignment`. The base advanced during the audit
to include the wave fixes from #394; the documentation branch was rebased onto
that updated top before final checks. No new issue was requested or
created. This is a documentation consistency review, not independent technical
acceptance of either implementation PR.
## Coverage and disposition
The audit inventories the base's 95 tracked Markdown paths, including the
`CLAUDE.md` symlink, and checks architecture/development references in issue
forms, Cargo metadata, crate API comments and documentation registries. Ignored
experiments and generated local artifacts are outside the published documentation.
| Surface | Disposition |
| --- | --- |
| `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, PR template | Point agents and contributors to hybrid boundaries and appropriate checks; preserve the symlink, claim precedence, provenance rules and native pause. Explain direct maintainer assignments and stacked bases. |
| Root README and documentation index | Put hybrid responsibilities and split dependencies first; label retained native diagrams, build procedures and capability counts. |
| Architecture, interfaces and ADRs | Add the current integration guide. Retain native fixture contracts in ADRs 0003/0004 with explicit scope; retain ADR 0005's strategic decision and distinguish subsequent observations from architectural acceptance. |
| Roadmap, milestones and archived plans | Keep Phase 1 active and its exit criteria intact. Mark issue-state inventories as snapshots; preserve already-labelled archived plans and retired milestone data. Remove obsolete local-branch instructions. |
| Crate documentation | Add a workspace crate guide and shader-crate README. Inspect crate-level Rustdoc and manifest descriptions; retain API text and legacy names, with component scope explained in the guides. No Rust sources or manifests changed. |
| CPU, runtime and shader contracts | Label maintained native procedures and inventories as preserved research. Keep generated coverage content unchanged; its native scope is explained by the index, architecture and progress pages. |
| Research, upstream registry and reuse matrix | Distinguish initial discovery decisions from the shader-only snapshot already in the base. Preserve original pins, notices, uncertainty and the requirement for independent provenance review. No broader upstream adoption is authorized. |
| Testing, validation, benchmarks and campaign ledgers | Separate hybrid readback from native regressions and historical acceptance. Mark old next tasks and campaign ownership as historical; retain recorded counts and candidate scope. Explain the expanded BetterXen test selection versus the script’s old four-test expectation. |
| Legal/security/support and attribution | Clarify input policy versus demonstrated execution and the native threat-model boundary. Preserve security reporting, conduct rules, license texts, upstream notices and historical benchmark reports. |
| Workflow/issue forms and machine-readable evidence | Existing hybrid task forms already describe active scope. Leave workflows, claims/status data, retired milestone JSON, fixture manifests and generated evidence untouched. |
Searches covered native-first/native-only language, former bans on Wine,
CrossOver, Rosetta or Vulkan, phase and milestone references, active priorities,
next-task instructions, licensing/reuse assertions and testing guidance. Retained
old terminology is scoped historical evidence or a component identifier, not a
second active roadmap. No external vendor facts were revalidated by this audit;
new architecture statements refer to the checked-in source and recorded PR
observations, with their limits preserved.
## Validation
Commands are listed in the [testing guide](README.md). Repository hygiene,
generated status/semantic coverage, claims, dependency direction and whitespace
checks passed on the aligned tree: hygiene checked 699 tracked files with zero
problems, claims checked 22 records and dependency direction checked five
graphics crates. Generated tables matched and whitespace checks passed. These
checks do not execute workloads, certify upstream
provenance or close a phase gate.
`CARGO_BUILD_JOBS=2 cargo doc --locked --workspace --no-deps` initially stopped
because the default compiler was Rust 1.94.1, below the workspace requirement.
`CARGO_BUILD_JOBS=2 cargo +1.100.0 doc --locked --workspace --no-deps` completed.
It emitted 38 Rustdoc warnings in unchanged sources: 3 in `victory-shader`, 12 in
`xenora-loader`, 16 in `xenora-ref` and 7 in `xenora-isa` (private links,
unresolved bracketed expressions and an unclosed HTML tag). This is a successful
API-documentation build with warnings, not a warning-free build. Logs are under
ignored `artifacts/docs-alignment/`.
CPU, GPU, CrossOver workloads, mutation and performance tests were not rerun for
this documentation-only change. Existing results remain attributed to their
original candidates and hosts. Independent reproduction and acceptance remain
outstanding wherever the source records say so.
-2
View File
@@ -1,7 +1,5 @@
# Gate A: a compiled C program
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
Gate A asks for an independently compiled C program, exercising allocation,
file operations, arithmetic, function calls and error handling, to run through
Xenora. The maintainer split it into two milestones. Gate A is complete only
-2
View File
@@ -1,7 +1,5 @@
# Infrastructure QA tooling
**Scope:** the Phase II/III tooling names below belong to the earlier infrastructure campaign, not the active hybrid roadmap. Native CPU/RDNA2 candidate lists are read-only inventories, not authorized work queues. Use the [hybrid testing guide](../README.md) for current validation scope; reuse these helpers only where applicable.
Standalone helpers under `scripts/qa/` and `scripts/release/`. They do not replace
`scripts/audit/*`, `scripts/benchmark.sh` or `scripts/test-gpu.sh`. New checks are
advisory until reviewed.
@@ -1,7 +1,5 @@
# Phase III compatibility-intelligence checkpoint ledger
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../../architecture.md) for active priorities.
Branch: `feat/infra-phase3-compat`. Issue #277.
Approved paths only. No push without separate authorization.
-2
View File
@@ -1,7 +1,5 @@
# Phase 01 mutation testing
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
The source campaign covers the decoder, fixture parser,
verifier, lowering and reference interpreter through the default CPU workspace
tests. The independent semantic and oracle campaigns are separate requirements.
-2
View File
@@ -1,7 +1,5 @@
# GPU and guest execution evidence
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
The resumed checkout started clean on main at
`4b9a4cecf35c8d4d90d8ecdb9c1510e7bd260102`, tracking origin/main.
The diff since `5c479005b0e0631a608a369b9e41327da61bb61e` contains three
-2
View File
@@ -1,7 +1,5 @@
# Phase 01 assurance checkpoint
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
**NOT RELEASE-READY.** The full source mutation campaign and native
technical evidence in this checkpoint ran from the clean
`aff46b0904a0182a6f0543125e4491ab67270f64` candidate on 2026-11-22. The
-2
View File
@@ -1,7 +1,5 @@
# Phase 01 engineering checkpoint
**Historical native record.** Plans and results below retain their original candidate scope. Native development is paused under [ADR 0005](../adr/0005-crossover-hybrid-direction.md); follow the [hybrid architecture](../architecture.md) for active priorities.
**NOT RELEASE-READY.** The evidence below was recorded on 2026-11-22 against the integrated local working tree based on `9ab5bf9`. The release brief requires evidence against one final candidate commit. Every formal gate therefore remains **NOT MET**. A passing local check is identified separately from outstanding work.
| Gate | Local evidence and remaining requirement |
-2
View File
@@ -1,7 +1,5 @@
# Independent review
**Scope:** retained independent reviews of native synthetic candidates. Their named commits, gates and required follow-ups are historical evidence, not certification of CrossOver or the vendored DXIL compiler. Active validation scope is in the [testing guide](README.md).
## gfx1030 form acceptance
Use the [AMD RDNA2 desktop GPU (gfx1030) form acceptance rule](shader-form-acceptance.md) for entries that
-2
View File
@@ -1,7 +1,5 @@
# AMD RDNA2 desktop GPU (gfx1030) form acceptance
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
This is the promotion rule for AMD RDNA2 desktop GPU (`gfx1030`) instruction
forms in [`docs/status.toml`](../status.toml). It implements the documentation
step of [#302](https://github.com/ranveersoni98/Xenora/issues/302). It does not
-2
View File
@@ -1,7 +1,5 @@
# Persistent resources and translated rendering acceptance
**Preserved native research.** This page governs existing synthetic fixtures and their regression checks. It does not define CrossOver compatibility or authorize native expansion; follow the [hybrid architecture](../architecture.md) for active work.
The upstream observations below describe pinned source inspected for this
milestone. Xenora tests use original fixtures. The upstream tests were not
run here. PASS records a native ARM64 run with assertions, FAIL a reproduced
+1 -7
View File
@@ -1,13 +1,7 @@
# Shader input and execution limits
## Scope
The limits below describe the preserved native fixture/compiler path. They are not a sandbox or security guarantee for CrossOver, Wine, D3DMetal or the vendored shader parser. Hybrid launches add an external process, bottle, selected backend and guest workload; assess those boundaries separately for the exact installed versions. Runner timeouts and resource supervision do not establish isolation or recovery from GPU stalls. The [architecture guide](architecture.md) records which launch dependencies are present.
## Native fixture boundaries
The public demo runs embedded, reviewed synthetic fixtures. The compiler library accepts arbitrary byte slices and requires an explicit gfx1030 target. It checks size and alignment before decoding and rejects unsupported forms, uninitialized registers and resource accesses beyond the fixture ABI. There is no container whose offsets can select host memory. An invalid stream cannot load arbitrary Metal source.
The Metal backend accepts trusted MSL under a two-buffer contract. It checks source size and dispatch dimensions, allocates disjoint buffers, dispatches one thread per word and waits for command completion before copying readback. It does not parse MSL. Treat the native API as a boundary for trusted source. The demo script bounds process runtime at 30 seconds and enables API and shader validation. A process timeout does not guarantee recovery from a hardware stall.
The fuzz harnesses exercise host-side parsers only. Corpus mutations do not reach the GPU. Logs, compiler diagnostics, and local artifacts can contain absolute paths and are kept outside tracked files. This original fixture flow has no capture replay or protected-content input path; it is not an inventory of all current workspace caches or parsers.
The fuzz harnesses exercise host-side parsers only. Corpus mutations do not reach the GPU. Logs, compiler diagnostics, and local artifacts can contain absolute paths and are kept outside tracked files. There is no cache, capture replay or protected-content input path.
-2
View File
@@ -1,7 +1,5 @@
# Synthetic guest execution experiments
**Preserved native research.** This fixture or validation procedure is for the paused independent native path, not CrossOver integration. Retain existing regression checks; proposed expansion is historical unless a specific hybrid need or maintainer decision authorizes it. See the [active architecture](../../docs/architecture.md).
The bounded x86-64 guest interpreter (X1) runs on native ARM64 macOS.
This isolated Cargo workspace implements the original fixtures in the
+36 -21
View File
@@ -16,37 +16,52 @@ BOTTLE=${2:-betterxen-test}
WHICH=${3:-fixtures}
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
cd "$ROOT"
# Build the host tool first, into the normal target directory, before the Windows build redirects it.
rustup run 1.100.0 cargo build -q -p betterxen-hybrid
export PATH="$TC/bin:$PATH"
export CARGO_TARGET_X86_64_PC_WINDOWS_GNULLVM_LINKER="$TC/bin/x86_64-w64-mingw32-clang"
export CARGO_TARGET_DIR="$ROOT/artifacts/victory-win"
# Build the Windows test executable and take its path from cargo's own build message. It normally
# lands in <target>/x86_64-pc-windows-gnullvm/debug/deps/, but cargo's layout can differ with the
# build configuration, so the path is not guessed; `deps/` is only the fallback.
EXE=$(rustup run 1.100.0 cargo test -q -p victory-shader --target x86_64-pc-windows-gnullvm --no-run \
--message-format=json | python3 -I -c '
# Both executables are taken from the messages of the cargo invocation that built them, and only
# when that invocation succeeded: no path is guessed and nothing left over from an earlier build can
# be run. (Cargo is not piped into the parser: under /bin/sh a pipeline reports only the parser's
# exit status.)
LOG=$(mktemp)
trap 'rm -f "$LOG"' EXIT
# built_exe <target name> <is test: true|false>: the executable named in $LOG.
built_exe() {
python3 -I -c '
import json, sys
exe = None
for line in sys.stdin:
name, test, exe = sys.argv[1], sys.argv[2] == "true", ""
for line in open(sys.argv[3]):
try:
m = json.loads(line)
except ValueError:
continue
if m.get("reason") == "compiler-artifact" and m.get("profile", {}).get("test") \
and m.get("target", {}).get("name") in ("victory_shader", "victory-shader") and m.get("executable"):
t = m.get("target", {})
if (m.get("reason") == "compiler-artifact" and m.get("executable")
and t.get("name", "").replace("-", "_") == name
and bool(m.get("profile", {}).get("test")) == test):
exe = m["executable"]
print(exe or "")')
if [ -z "$EXE" ]; then
EXE=$(ls -t "$CARGO_TARGET_DIR"/x86_64-pc-windows-gnullvm/debug/deps/victory_shader-*.exe 2>/dev/null | head -1)
fi
[ -n "$EXE" ] && [ -f "$EXE" ] || { echo "could not find the victory-shader test executable" >&2; exit 1; }
print(exe)' "$1" "$2" "$LOG"
}
# The host tool first, before the environment is pointed at the Windows toolchain.
rustup run 1.100.0 cargo build -q -p betterxen-hybrid --message-format=json-render-diagnostics >"$LOG" \
|| { echo "building betterxen-hybrid failed" >&2; exit 1; }
B=$(built_exe betterxen_hybrid false)
[ -n "$B" ] && [ -x "$B" ] || { echo "the host build named no betterxen-hybrid executable" >&2; exit 1; }
export PATH="$TC/bin:$PATH"
export CARGO_TARGET_X86_64_PC_WINDOWS_GNULLVM_LINKER="$TC/bin/x86_64-w64-mingw32-clang"
export CARGO_TARGET_DIR="$ROOT/artifacts/victory-win"
rustup run 1.100.0 cargo test -q -p victory-shader --target x86_64-pc-windows-gnullvm --no-run \
--message-format=json-render-diagnostics >"$LOG" \
|| { echo "building the victory-shader test executable failed" >&2; exit 1; }
EXE=$(built_exe victory_shader true)
[ -n "$EXE" ] && [ -f "$EXE" ] || { echo "the build named no victory-shader test executable" >&2; exit 1; }
file "$EXE" | grep -q "PE32+ executable.*x86-64" || { echo "not an x86-64 PE: $EXE" >&2; exit 1; }
B="$ROOT/target/debug/betterxen-hybrid"
rm -f "$LOG"
if [ "$WHICH" = all ]; then
exec "$B" run --bottle "$BOTTLE" --timeout 900 --stall-timeout 120 --expect "test result: ok" \
--out artifacts/hybrid-runs -- "$EXE" --test-threads=1
else
exec "$B" run --bottle "$BOTTLE" --timeout 300 --stall-timeout 120 --expect "test result: ok. 4 passed" \
# The exact count is deliberate: a looser marker would also accept a filter that matches nothing
# ("0 passed"). Update it when BetterXen adds or removes tests in emit/betterxen_tests.rs.
exec "$B" run --bottle "$BOTTLE" --timeout 300 --stall-timeout 120 --expect "test result: ok. 10 passed" \
--out artifacts/hybrid-runs -- "$EXE" betterxen --test-threads=1
fi
+79
View File
@@ -0,0 +1,79 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
# Regression test for run-shader-gpu-tests.sh with a stubbed `rustup`/cargo and a stubbed runner:
# no toolchain, CrossOver or GPU is needed. Checks that
# 1. a failed Windows test build stops the script and the runner is never invoked, even when an
# older test executable is lying in the target directory;
# 2. a successful build runs exactly the executable that build named;
# 3. the host runner is the one the host build named, also with an inherited CARGO_TARGET_DIR.
set -u
HERE=$(cd "$(dirname "$0")" && pwd)
T=$(mktemp -d)
trap 'rm -rf "$T"' EXIT
fails=0
check() { if eval "$2"; then echo "ok $1"; else echo "FAIL $1"; fails=1; fi; }
# A file `file` reports as an x86-64 PE32+ executable.
make_pe() {
python3 -I -c '
import struct, sys
b = bytearray(512); b[0:2] = b"MZ"; struct.pack_into("<I", b, 0x3C, 0x80)
b[0x80:0x84] = b"PE\0\0"; struct.pack_into("<HHIIIHH", b, 0x84, 0x8664, 0, 0, 0, 0, 240, 0x22)
struct.pack_into("<H", b, 0x98, 0x20B); struct.pack_into("<H", b, 0x98 + 68, 3)
open(sys.argv[1], "wb").write(b)' "$1"
}
setup() { # $1 = case directory
R=$1/repo
mkdir -p "$R/scripts/hybrid" "$1/bin" "$1/tc/bin"
cp "$HERE/run-shader-gpu-tests.sh" "$R/scripts/hybrid/"
: > "$1/tc/bin/x86_64-w64-mingw32-clang"; chmod +x "$1/tc/bin/x86_64-w64-mingw32-clang"
# The stub runner records how it was called.
runner() { mkdir -p "$(dirname "$1")"; printf '#!/bin/sh\necho "$0 $*" >> "%s"\n' "$2" > "$1"; chmod +x "$1"; }
# A runner left over from an earlier build at the old hard-coded place.
runner "$R/target/debug/betterxen-hybrid" "$1/stale-runner.log"
# An older test executable lying around in the target directory.
old="$R/artifacts/victory-win/x86_64-pc-windows-gnullvm/debug/deps"
mkdir -p "$old"; make_pe "$old/victory_shader-0000stale.exe"
cat > "$1/bin/rustup" <<STUB
#!/bin/sh
# stands in for: rustup run 1.100.0 cargo <build|test> ...
shift 3
cmd=\$1
dir=\${CARGO_TARGET_DIR:-$R/target}
case "\$cmd" in
build)
mkdir -p "\$dir/debug"
printf '#!/bin/sh\necho "\$0 \$*" >> "%s"\n' "$1/runner.log" > "\$dir/debug/betterxen-hybrid"
chmod +x "\$dir/debug/betterxen-hybrid"
echo "{\"reason\":\"compiler-artifact\",\"target\":{\"name\":\"betterxen-hybrid\",\"kind\":[\"bin\"]},\"profile\":{\"test\":false},\"executable\":\"\$dir/debug/betterxen-hybrid\"}"
;;
test)
[ "\${STUB_TEST_BUILD_FAILS:-0}" = 1 ] && exit 101
mkdir -p "\$dir/fresh"; cp "$old/victory_shader-0000stale.exe" "\$dir/fresh/victory_shader-1111new.exe"
echo "{\"reason\":\"compiler-artifact\",\"target\":{\"name\":\"victory_shader\",\"kind\":[\"lib\"]},\"profile\":{\"test\":true},\"executable\":\"\$dir/fresh/victory_shader-1111new.exe\"}"
;;
esac
STUB
chmod +x "$1/bin/rustup"
}
# 1. failed test build
c=$T/fail; setup "$c"
STUB_TEST_BUILD_FAILS=1 PATH="$c/bin:$PATH" sh "$c/repo/scripts/hybrid/run-shader-gpu-tests.sh" "$c/tc" >/dev/null 2>&1; rc=$?
check "failed build: script exits non-zero (got $rc)" "[ $rc -ne 0 ]"
check "failed build: no runner is invoked" "[ ! -e '$c/runner.log' ] && [ ! -e '$c/stale-runner.log' ]"
# 2. successful build
c=$T/ok; setup "$c"
PATH="$c/bin:$PATH" sh "$c/repo/scripts/hybrid/run-shader-gpu-tests.sh" "$c/tc" >/dev/null 2>&1; rc=$?
check "good build: script succeeds (got $rc)" "[ $rc -eq 0 ]"
check "good build: runs the executable this build named" "grep -q 'victory_shader-1111new.exe' '$c/runner.log' 2>/dev/null"
# 3. inherited CARGO_TARGET_DIR
c=$T/dir; setup "$c"
CARGO_TARGET_DIR="$c/elsewhere" PATH="$c/bin:$PATH" sh "$c/repo/scripts/hybrid/run-shader-gpu-tests.sh" "$c/tc" >/dev/null 2>&1; rc=$?
check "inherited target dir: script succeeds (got $rc)" "[ $rc -eq 0 ]"
check "inherited target dir: the freshly built runner is used" "grep -q '$c/elsewhere/debug/betterxen-hybrid' '$c/runner.log' 2>/dev/null"
check "inherited target dir: the stale runner is not used" "[ ! -e '$c/stale-runner.log' ]"
exit $fails
-2
View File
@@ -1,7 +1,5 @@
# Synthetic PE32+ import fixtures
**Preserved native research.** This fixture or validation procedure is for the paused independent native path, not CrossOver integration. Retain existing regression checks; proposed expansion is historical unless a specific hybrid need or maintainer decision authorizes it. See the [active architecture](../../docs/architecture.md).
Run `tests/compat_fixtures/build.sh` on ARM64 macOS with native LLVM and LLD.
The script writes two x86-64 guest executables and their import listings under
`artifacts/compat-fixtures/`. Both variants come from the original C source
-2
View File
@@ -1,7 +1,5 @@
# Original AVX integer fixture specification
**Preserved native research.** This fixture or validation procedure is for the paused independent native path, not CrossOver integration. Retain existing regression checks; proposed expansion is historical unless a specific hybrid need or maintainer decision authorizes it. See the [active architecture](../../../docs/architecture.md).
This fixture is a proposed known-answer test for the
[guest AVX contract](../../../docs/cpu/avx-contract.md). It uses only the
source below, fixed register values and synthetic guest memory. Run the
-2
View File
@@ -1,7 +1,5 @@
# Native semantic mutation
**Preserved native research.** This fixture or validation procedure is for the paused independent native path, not CrossOver integration. Retain existing regression checks; proposed expansion is historical unless a specific hybrid need or maintainer decision authorizes it. See the [active architecture](../../docs/architecture.md).
Run serially on the native Apple Silicon gate machine.
```sh
-2
View File
@@ -1,7 +1,5 @@
# Independent review of the first RDNA2 fixture
**Preserved native research.** This fixture or validation procedure is for the paused independent native path, not CrossOver integration. Retain existing regression checks; proposed expansion is historical unless a specific hybrid need or maintainer decision authorizes it. See the [active architecture](../../docs/architecture.md).
AMD's RDNA2 ISA reference §8.1 defines indexed buffer addressing and the four-SGPR resource operand. Under Xenora's synthetic descriptors, the first instruction reads input word `i` into v1 and the store writes word `i` of the independent output. The vector memory wait permits the read's result to be consumed before the add. Section 12 gives the VOP1 move and carry-free unsigned addition semantics, so v2 receives `0x12345678` and v1 receives the sum reduced modulo `2^32`. The SOPK store wait completes the outstanding store. The SOPP end instruction also implicitly waits on RDNA2. Requiring both explicit waits is a conservative policy of this fixture compiler. These semantics are class B for RDNA2 and do not establish Xbox-specific applicability. [AMD RDNA2 ISA Reference Guide](https://docs.amd.com/v/u/en-US/rdna2-shader-instruction-set-architecture)
LLVM 23.1.6 and the production decoder agreed on all seven fixture instructions, including their bytes, lengths, offsets and printed operands. AMD defines hardware semantics. LLVM is class E evidence for the tool's encoding and decoding behavior.
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Control for add_f64_4: the same run-time load, add and store in single precision. If this writes
// and the double version does not, the load/store path is not the cause.
// Expected (by hand): word 0 = 2.0f (0x40000000), word 1 = 0 for each of the 4 threads.
RWByteAddressBuffer o : register(u0);
[numthreads(4, 1, 1)]
void main(uint t : SV_GroupIndex) {
uint z = o.Load(t * 8) ^ 0xDEADBEEF;
float s = asfloat(z ^ 0x3FA00000) + asfloat(z ^ 0x3F400000); // 1.25 + 0.75
o.Store2(t * 8, uint2(asuint(s), z));
}
@@ -1,11 +1,16 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// No wave operation: a plain double addition 1.25 + 0.75 = 2.0 (0x4000000000000000), to separate
// "doubles unsupported" from "wave operations on doubles unsupported".
// Expected (by hand): low word 0x00000000, high word 0x40000000.
// No wave operation: a double addition 1.25 + 0.75 = 2.0 (0x4000000000000000) whose operands are
// only known at run time, so the compiler cannot fold it. The host fills the buffer with
// 0xDEADBEEF; `z` is therefore 0 when the shader runs, but not at compile time. The compiled DXIL
// must contain `fadd ... double` (check with `dxc -dumpbin`). Separates "doubles unsupported" from
// "wave operations on doubles unsupported".
// Expected (by hand): low word 0x00000000, high word 0x40000000 for each of the 4 threads.
RWByteAddressBuffer o : register(u0);
[numthreads(4, 1, 1)]
void main(uint t : SV_GroupIndex) {
double a = 1.25, b = 0.75 + (double)(t - t);
uint z = o.Load(t * 8) ^ 0xDEADBEEF;
double a = asdouble(z, z ^ 0x3FF40000); // 1.25
double b = asdouble(z, z ^ 0x3FE80000); // 0.75
double s = a + b;
uint lo, hi;
asuint(s, lo, hi);
@@ -1,11 +1,13 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Expected (by hand): 4 threads each add the double 1.25; the sum is 5.0, whose bit pattern is
// 0x4014000000000000, so each lane stores low word 0x00000000 and high word 0x40140000.
// A wave sum over a double that is only known at run time (see add_f64_4.hlsl).
// Expected (by hand): 4 threads each add 1.25, sum 5.0 = 0x4014000000000000, so each stores low
// word 0x00000000 and high word 0x40140000.
// The device reports DoublePrecisionFloatShaderOps = 0; this probe shows what actually happens.
RWByteAddressBuffer o : register(u0);
[numthreads(4, 1, 1)]
void main(uint t : SV_GroupIndex) {
double s = WaveActiveSum(1.25);
uint z = o.Load(t * 8) ^ 0xDEADBEEF;
double s = WaveActiveSum(asdouble(z, z ^ 0x3FF40000));
uint lo, hi;
asuint(s, lo, hi);
o.Store2(t * 8, uint2(lo, hi));