mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 19:30:43 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8c7a39849 | ||
|
|
5b99b6bd63 | ||
|
|
d9333d272f | ||
|
|
395aaeb4e7 | ||
|
|
efb63a37d4 | ||
|
|
35cdf56e80 | ||
|
|
b39780b421 | ||
|
|
f8f497b578 |
No files matched your search
@@ -10,10 +10,13 @@ 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.
|
||||
- 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`.
|
||||
- Documented the original Windows workload set and Phase 1 hybrid measurement protocol (#353), including receipt-field sources, percentile definitions, negative controls and independent reproduction requirements. The protocol identifies the unmerged runner candidate and its missing raw traces and measurements; it adds no execution or compatibility claim.
|
||||
- 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 `docs/research/crossover-licensing.md`, a per-component license and redistribution record for the hybrid direction: CrossOver itself, Wine, DXMT, DXVK, VKD3D-Proton, MoltenVK, Apple's Game Porting Toolkit repository, D3DMetal and Rosetta 2, each with the exact text read or the missing document named, plus an entry in `docs/licenses.md` (#354). Nothing is bundled or redistributed; the D3DMetal text (third-party copy, not confirmed against Apple's) and Rosetta 2 terms remain unverified, and CrossOver 26.3.0's FOSS inventory is unknown. Research only; no code or dependency change.
|
||||
- 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.
|
||||
- Rewrote the README around the six development phases and the first-launchable-application target (#311), with colour-coded Mermaid diagrams (system flow, milestone roadmap, CPU, runtime-service and shader-form charts built from the generated registries), badges, a repository overview, a contributing section and corrected texture-sampling wording. The older X1–X25 capability map is kept in a collapsible section. The diagrams were not render-tested locally.
|
||||
|
||||
@@ -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).
|
||||
@@ -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");
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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")),
|
||||
|
||||
@@ -53,6 +53,7 @@ checkpoints retain their original evidence scope.
|
||||
|
||||
## Testing, validation, and benchmarks
|
||||
|
||||
- [Hybrid workloads and measurement protocol](testing/hybrid-workloads.md) — Original Windows workload selection, metric definitions, receipt sources and independent reproduction requirements; distinguishes the pending hybrid candidate from merged behavior.
|
||||
- [Migrated pull-request integration review](testing/migration-pr-review.md) — Merge decisions, integration fixes, native verification and excluded concurrent work.
|
||||
- [Testing and acceptance index](testing/README.md) — Entry point for test procedures, evidence and review records.
|
||||
- [AMD RDNA2 desktop GPU (gfx1030) form acceptance](testing/shader-form-acceptance.md) — Independence, command, log and promotion rules for fixture-verified instruction forms.
|
||||
@@ -68,6 +69,7 @@ checkpoints retain their original evidence scope.
|
||||
|
||||
- [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.
|
||||
@@ -75,6 +77,7 @@ checkpoints retain their original evidence scope.
|
||||
- [Synthetic integration and upstream evidence](research/synthetic-integration.md) — Audited source snapshots and remaining commercial startup prerequisites.
|
||||
- [Hybrid backlog research record](research/hybrid-backlog-research-2026-11-25.md) — Findings, registry candidates and the issues they produced (2026-11-25); not verified on hardware.
|
||||
- [Primary-source verification](research/primary-source-verification-2026-11-25.md) — Which hybrid-research claims were confirmed, contradicted or left unverified against vendor documentation.
|
||||
- [CrossOver licensing boundaries](research/crossover-licensing.md) — Per-component licenses and redistribution status for the hybrid direction, with the unread documents named.
|
||||
|
||||
## Security, licensing, and contributions
|
||||
|
||||
|
||||
@@ -116,3 +116,21 @@ These packages are resolved only by the isolated fuzz workspace. Use MIT when it
|
||||
| libfuzzer-sys | 0.4.13 | `719e4efb9b8857ebaa782ae59376c8cbb78fed0f` | MIT AND NCSA |
|
||||
| r-efi | 6.0.0 | `7e1b0322d31d625f81a5656096330934f9cd835d` | MIT |
|
||||
| shlex | 2.0.1 | `e82b1411beb7c92871c2c078c9ab415bbcf207ef` | MIT |
|
||||
|
||||
## External hybrid components (not distributed)
|
||||
|
||||
The hybrid direction relies on an externally installed CrossOver. Nothing below is bundled, linked or redistributed by BetterXen, and the licenses are the upstream texts read on 2026-11-25, not the revisions CodeWeavers ships in 26.3.0.
|
||||
|
||||
| Component | License read | Distribution model | Notes |
|
||||
|---|---|---|---|
|
||||
| CrossOver (product) | Proprietary EULA; FOSS components keep their licenses | External install | [EULA](https://www.codeweavers.com/crossover/eula) §2 permits building alternate Wine and does not supersede FOSS licenses; §3 restricts reverse engineering and redistribution. The source page lists Wine, Vkd3d, DXVK and MoltenVK, not DXMT or VKD3D-Proton |
|
||||
| Wine | LGPL-2.1-or-later | External | `either version 2.1 … or any later version` |
|
||||
| DXMT | LGPL-2.1-or-later; releases up to v0.80 were MIT (`LICENSE.OLD`) | External | Copyright 2023-2026 Feifan He for CodeWeavers |
|
||||
| DXVK | zlib | External | Retain the notice if ever distributed |
|
||||
| VKD3D-Proton | LGPL-2.1-or-later | External | Source headers carry the `or later` grant |
|
||||
| MoltenVK | Apache-2.0 | External | Compatible with GPL-3.0, not GPL-2.0; no `NOTICE` file at the pinned revision |
|
||||
| D3DMetal | Unverified: a third-party copy of the 4.0 `License.pdf` was reported; Apple's own copy was not read | User-supplied only; never bundled | The reported terms are non-commercial and no reverse engineering; the Apache-2.0 Game Porting Toolkit repository is not the D3DMetal license |
|
||||
| Rosetta 2 | Unknown; Apple's license text was not read | External OS component | Never redistributed |
|
||||
|
||||
Details, exact sources and the missing documents are in [research/crossover-licensing.md](research/crossover-licensing.md).
|
||||
|
||||
@@ -14,6 +14,7 @@ Companion to the [upstream registry](upstream-registry.md); same evidence limits
|
||||
| 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 | **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). |
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
# CrossOver licensing and redistribution boundaries
|
||||
|
||||
Research note for the hybrid direction. It records what the public license
|
||||
texts say about the components a CrossOver-based BetterXen would rely on, and
|
||||
which documents are still missing. It is not legal advice.
|
||||
|
||||
Reviewed 2026-11-25 against public sources only. No CrossOver installation, no
|
||||
Apple license text and no proprietary component was downloaded for this note.
|
||||
|
||||
## Distribution model
|
||||
|
||||
BetterXen does not bundle, redistribute or modify CrossOver, D3DMetal, Rosetta 2
|
||||
or any of the open-source components listed below. The intended model is an
|
||||
externally installed CrossOver that BetterXen invokes as a separate program, with
|
||||
all third-party components supplied by their own distributors. This note records
|
||||
licenses so that any later decision to ship, link or copy a component has a
|
||||
starting point; it does not approve one.
|
||||
|
||||
## Components
|
||||
|
||||
| Component | Version or revision read | License read | Source | Redistribution in BetterXen | Notes |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| BetterXen | current `main` | GPL-3.0-or-later | [`LICENSE`](../../LICENSE) | The project itself | Compatibility baseline for every row below |
|
||||
| CrossOver (product) | 26.3.0, per CodeWeavers' source page | Proprietary EULA; FOSS components keep their own licenses | [EULA](https://www.codeweavers.com/crossover/eula), [FOSS source page](https://www.codeweavers.com/crossover/source) | Not bundled; externally installed | EULA §2 permits building alternate Wine for use with CrossOver and states that the EULA does not supersede the FOSS licenses; §3 forbids decompiling or reverse engineering and distribution or derivative works except where law or those licenses permit. The source page publishes the 26.3.0 tarball and lists Wine, Vkd3d, DXVK and MoltenVK; it does not list DXMT or VKD3D-Proton. Whether 26.3.0 ships them, and at which revisions, is **unknown** |
|
||||
| Wine | `a79470449d03`, master on 2026-11-25 | LGPL-2.1-or-later | [`LICENSE`](https://raw.githubusercontent.com/wine-mirror/wine/a79470449d03/LICENSE) | Not bundled or linked today | "either version 2.1 of the License, or (at your option) any later version" |
|
||||
| DXMT | `faa73e4a0686`, main on 2026-11-25 | LGPL-2.1-or-later; releases up to v0.80 were MIT | [`LICENSE`](https://raw.githubusercontent.com/3Shain/dxmt/faa73e4a0686/LICENSE), [`LICENSE.OLD`](https://raw.githubusercontent.com/3Shain/dxmt/faa73e4a0686/LICENSE.OLD) | Not bundled or linked today | Copyright 2023–2026 Feifan He for CodeWeavers. `LICENSE.OLD` records MIT for releases up to v0.80, so the licence of a shipped DXMT depends on its version |
|
||||
| DXVK | `57b2a7c1e87b`, master on 2026-11-25 | zlib | [`LICENSE`](https://raw.githubusercontent.com/doitsujin/dxvk/57b2a7c1e87b/LICENSE) | Not bundled or linked today | Permission to use, alter and redistribute freely; the notice must be retained |
|
||||
| VKD3D-Proton | `71cae091b065`, master on 2026-11-25 | LGPL-2.1-or-later | [`COPYING`](https://raw.githubusercontent.com/HansKristian-Work/vkd3d-proton/71cae091b065/COPYING) | Not bundled or linked today | `COPYING` grants "either version 2.1 … or any later version"; the `LICENSE` file is the LGPL 2.1 text |
|
||||
| MoltenVK | `5189f8de86ec`, main on 2026-11-25 | Apache-2.0 | [`LICENSE`](https://raw.githubusercontent.com/KhronosGroup/MoltenVK/5189f8de86ec/LICENSE) | Not bundled or linked today | Compatible with GPL-3.0, not GPL-2.0. There is no `NOTICE` file at this pin, so Apache-2.0 §4(d) does not apply; §4(a)–(c) (license copy, change notices, retained notices) do |
|
||||
| Apple Game Porting Toolkit repository | `main`, read 2026-11-25 | Apache-2.0 | [`LICENSE`](https://raw.githubusercontent.com/apple/game-porting-toolkit/main/LICENSE) | Not bundled | This is the repository's license for its porting resources. It is not the license for the separately distributed D3DMetal framework |
|
||||
| D3DMetal | Game Porting Toolkit 4.0, reported | Unconfirmed: a third-party copy of the 4.0 `License.pdf` was read outside this repository; Apple's own download was not read | Third-party copy: `Sikarugir-App/Sikarugir` at `5446b7d18072`, `D3DMetal/{1.1,2.0,2.1,3.0,4.0}/License.pdf` | User-supplied only; never bundled | Reported (evidence class D, not confirmed against Apple's copy): a personal licence to install, use and test for developing, testing or evaluating games on Apple hardware, distribution solely for non-commercial purposes, no use on non-Apple hardware, Framework and Redistributables not separable, and no reverse engineering (sections 2A, 2C, 2D). The missing document is Apple's own copy in the Game Porting Toolkit download. Do not treat the repository's Apache-2.0 license as D3DMetal's |
|
||||
| Rosetta 2 | macOS feature | Unknown: Apple's applicable software license was not read | [Apple Rosetta documentation](https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment) | External OS component; not bundled | The documentation describes the translation environment; it is not the license grant |
|
||||
|
||||
## Compatibility with GPL-3.0-or-later
|
||||
|
||||
LGPL-2.1-or-later, zlib and Apache-2.0 are generally compatible with a
|
||||
GPL-3.0-or-later work, subject to each license's notice and source-availability
|
||||
conditions. That compatibility matters only if BetterXen links to or copies the
|
||||
component. Invoking an externally installed CrossOver as a separate program does
|
||||
not make its components part of BetterXen's distributed work, and this note does
|
||||
not decide otherwise.
|
||||
|
||||
The CrossOver EULA is recorded above; D3DMetal's own text is not. Neither may be
|
||||
bundled, linked or copied on the strength of this note alone: the product terms
|
||||
are restrictive, and D3DMetal's authoritative licence is still unread.
|
||||
|
||||
GPL-2.0-only components cannot be combined into this GPL-3.0-or-later workspace.
|
||||
A comment on this issue identified MacBox and ScarlettMac as GPL-2.0; they are
|
||||
not part of the component list above and this note does not rely on them.
|
||||
|
||||
## Unknowns and the exact missing documents
|
||||
|
||||
- **CrossOver 26.3.0's FOSS inventory.** The EULA points to Appendix A for the
|
||||
full list, but that list was not included inline on the page read and was not
|
||||
located elsewhere. The source page lists Wine, Vkd3d, DXVK and MoltenVK and
|
||||
does not list DXMT or VKD3D-Proton. Whether 26.3.0 ships DXMT, FEX and
|
||||
VKD3D-Proton, and at which revisions, is unknown.
|
||||
- **D3DMetal license.** It ships with the Game Porting Toolkit download; that
|
||||
download was not made. A third-party copy of the 4.0 `License.pdf` (in
|
||||
`Sikarugir-App/Sikarugir` at `5446b7d18072`) was reported to this issue with a
|
||||
section-level summary, but it is not Apple's copy and stays evidence class D.
|
||||
The `apple/game-porting-toolkit` repository is Apache-2.0 and does not
|
||||
establish the framework's terms. Confirm the summary against Apple's own copy
|
||||
before relying on it; until then D3DMetal is user-supplied and never bundled.
|
||||
- **Rosetta 2 terms.** Apple's license text was not read. Rosetta 2 stays an
|
||||
external macOS component and is never redistributed by BetterXen.
|
||||
- **Exact revisions.** The files above were read at these pins on 2026-11-25:
|
||||
Wine `a79470449d03`, DXMT `faa73e4a0686`, DXVK `57b2a7c1e87b`,
|
||||
VKD3D-Proton `71cae091b065`, MoltenVK `5189f8de86ec`. The revisions CodeWeavers
|
||||
ships in 26.3.0 are still unknown; pin them before any reuse or notice work.
|
||||
- **Linking versus invocation.** Which components, if any, BetterXen would link
|
||||
against rather than invoke is an architecture decision that has not been made
|
||||
here.
|
||||
|
||||
## Sources
|
||||
|
||||
- CodeWeavers, "Free and Open Source Software Code for CrossOver", listing the
|
||||
26.3.0 source tarball and the open-source projects:
|
||||
<https://www.codeweavers.com/crossover/source> (accessed 2026-11-25).
|
||||
- Wine `LICENSE`, wine-mirror/wine at `a79470449d03`, accessed 2026-11-25.
|
||||
- DXMT `LICENSE` and `LICENSE.OLD`, 3Shain/dxmt at `faa73e4a0686`, accessed
|
||||
2026-11-25.
|
||||
- DXVK `LICENSE`, doitsujin/dxvk at `57b2a7c1e87b`, accessed 2026-11-25.
|
||||
- VKD3D-Proton `COPYING`, HansKristian-Work/vkd3d-proton at `71cae091b065`,
|
||||
accessed 2026-11-25.
|
||||
- MoltenVK `LICENSE`, KhronosGroup/MoltenVK at `5189f8de86ec`, and its file list
|
||||
at that pin for the absence of `NOTICE`, accessed 2026-11-25.
|
||||
- CodeWeavers, "CrossOver End User License Agreement", sections 2 and 3:
|
||||
<https://www.codeweavers.com/crossover/eula>, read in a browser 2026-11-25.
|
||||
- D3DMetal third-party copies: `Sikarugir-App/Sikarugir` at `5446b7d18072`,
|
||||
`D3DMetal/{1.1,2.0,2.1,3.0,4.0}/License.pdf`. Not Apple's copy.
|
||||
- Apple Game Porting Toolkit repository `LICENSE`, apple/game-porting-toolkit at
|
||||
`main`, accessed 2026-11-25. Repository license only; it is not the D3DMetal
|
||||
license.
|
||||
- Apple, "About the Rosetta translation environment", accessed 2026-11-25.
|
||||
Documentation only, not the license text.
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -15,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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# victory-shader integration (GFX10 to DXIL recompiler)
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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`.
|
||||
@@ -0,0 +1,262 @@
|
||||
# Hybrid workloads and measurement protocol
|
||||
|
||||
This is the Phase 1 protocol for [issue #353](https://github.com/MacosPorters/betterxen/issues/353).
|
||||
It defines workload selection, measurement boundaries and the evidence a contributor
|
||||
must retain for the [CrossOver baseline task](https://github.com/MacosPorters/betterxen/issues/355).
|
||||
It adds no runner and reports no new Windows or GPU execution results.
|
||||
|
||||
## Implementation checkpoint
|
||||
|
||||
The commands below refer to [PR #384](https://github.com/MacosPorters/betterxen/pull/384),
|
||||
reviewed at commit `566272082a74d8b45fcec37edd00f4f6703df3ab` on 2026-11-25.
|
||||
Its `betterxen-hybrid` command, build script and Windows workloads are not on
|
||||
`main` at this document's base revision. Use a separate checkout of that exact
|
||||
candidate to review the recipe; after it merges, record the actual merged SHA
|
||||
and recheck the command options. A missing command is an unavailable prerequisite.
|
||||
Do not substitute the preserved native benchmark suite for a CrossOver run.
|
||||
|
||||
The implementation links in this document are pinned to that candidate. They
|
||||
describe source inspection, not independent acceptance of the author's recorded
|
||||
M4 results. Those results remain in the candidate's
|
||||
[baseline record](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/docs/research/crossover-baseline-2026-11-25.md).
|
||||
Use the [roadmap](../roadmap.md) for phase completion and
|
||||
[benchmark protocol](benchmarks.md) for the existing native benchmark's separate scope.
|
||||
|
||||
## Selected workloads and provenance
|
||||
|
||||
All four initial workloads are original BetterXen source. Each source below has
|
||||
an `SPDX-License-Identifier: GPL-3.0-or-later` header at the pinned revision.
|
||||
Use the repository [license](../../LICENSE); no external test source, shader,
|
||||
texture, game binary or asset is added by this selection. The C programs use
|
||||
external mingw-w64 headers; the Rust program uses the Rust standard library.
|
||||
Those build dependencies retain their own terms and are not relicensed by the
|
||||
workload headers. The build's exact dependency review belongs to
|
||||
[#364](https://github.com/MacosPorters/betterxen/issues/364) and
|
||||
[#354](https://github.com/MacosPorters/betterxen/issues/354).
|
||||
|
||||
| Workload and source at the candidate | Purpose and expected result | Limits |
|
||||
| --- | --- | --- |
|
||||
| [C self-check](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/workloads/win-selfcheck-c/selfcheck.c) | CRC-32 of `123456789` is `0xCBF43926`; four threads increment a shared counter to 400,000; stdout ends in `PASS`, exit 0. | CPU/runtime smoke check; no GPU work. The thread wait result is not checked separately. |
|
||||
| [Rust self-check](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/workloads/win-selfcheck-rust/src/main.rs) | Four thread-local counters give 1,000, 2,000, 3,000 and 4,000; their total is 10,000; the main thread's counter stays zero; `PASS`, exit 0. | One small threads/TLS case, not general Wine conformance. TLS means thread-local storage. |
|
||||
| [Direct3D 11 clear](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/workloads/d3d11-clear/d3d11_clear.c) | Clear a 64×64 RGBA8 target, read all 4,096 pixels, `PASS`, exit 0. Each channel must be within 0.6 of `(0.25, 0.5, 0.75, 1) × 255`; ideal bytes are `(64,128,191,255)`. | The specified conversion tolerance permits green 127 or 128. No shader, texture sampling or presentation. |
|
||||
| [Direct3D 11 indexed triangle/frame loop](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/workloads/d3d11-frameloop/frameloop.c) | A 640×360 target, one indexed triangle, vertex/pixel shaders and an event-query wait per iteration. First-frame readback checks corner `(0,0,0,255)` and centre `(51,102,204,255)` within the source's tolerance; `PASS frames=N`, exit 0. | Only two pixels of the first frame are checked. HLSL is compiled at runtime with `D3DCompile`, a deviation from #365's requested build-time compilation. No window, swapchain or presented frames. |
|
||||
|
||||
For both graphics programs, `--negative-control` deliberately changes the
|
||||
expected colour: require a mismatch and exit 1, not a missing-device result.
|
||||
Exit 2 with `NO DEVICE` is unsupported/unavailable graphics, never a pass; exit 3
|
||||
is an API failure. Re-derive pixel expectations from geometry and Microsoft's
|
||||
[data conversion rules](https://learn.microsoft.com/en-us/windows/win32/direct3d10/d3d10-graphics-programming-guide-resources-data-conversion)
|
||||
before accepting the output. Do not change tolerances after seeing a failure.
|
||||
|
||||
The x86-64 Windows PE builds are the initial execution set. ARM64 Windows builds
|
||||
are a separate admission experiment: record what the installed runtime does,
|
||||
including refusal, without treating it as x86-64 success or assuming every
|
||||
CrossOver release behaves alike. PE denotes Portable Executable, the Windows
|
||||
executable format; it is guest input, not the host executable architecture.
|
||||
|
||||
Texture sampling and compute workloads are still required by
|
||||
[#365](https://github.com/MacosPorters/betterxen/issues/365). Depth, presentation,
|
||||
Direct3D 12 and upstream Wine conformance runs are not established by these four
|
||||
programs. External test candidates need an exact revision and per-file license
|
||||
review before admission; none is selected here.
|
||||
|
||||
## Preparation and correctness run
|
||||
|
||||
Use an Apple Silicon Mac and record its actual chip and memory. The initial
|
||||
reference is an M4 with 24 GiB; another configuration is another observation,
|
||||
not a replacement for that host's acceptance. CrossOver and any required Rosetta
|
||||
installation must already be supplied by the contributor under their own terms.
|
||||
Nothing in this protocol installs, bundles or activates proprietary software.
|
||||
|
||||
1. Record the full candidate SHA, dirty state, Rust/compiler versions, build
|
||||
flags and target. Use native ARM64 host tools; retain `file`, `lipo -archs`
|
||||
and `otool -L` evidence for the tools and executable actually used. A universal
|
||||
tool's ARM64 slice and its Windows output target are different facts.
|
||||
2. Verify the llvm-mingw archive version and checksum against the pinned
|
||||
[toolchain note](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/docs/research/hybrid-toolchain.md).
|
||||
At this checkpoint the build script accepts an unpacked directory and does
|
||||
not enforce the pin. Rebuild twice, retain output hashes and report any
|
||||
directory-dependent differences; do not claim reproducibility from one build.
|
||||
3. Create a disposable, dedicated bottle through CrossOver's UI. Record its
|
||||
template, configuration and name locally. Keep unrelated programs out of it:
|
||||
stopping the runtime can stop every process in that bottle.
|
||||
4. Keep raw evidence under ignored `artifacts/`. Use a new directory per attempt;
|
||||
the candidate overwrites `bench.json` and names individual run JSON by seconds.
|
||||
Record setup, correctness and timing as separate attempts.
|
||||
|
||||
In the checkout containing the candidate implementation, with `LLVM_MINGW_DIR`
|
||||
set to the already verified toolchain directory:
|
||||
|
||||
```sh
|
||||
test -f crates/hybrid/Cargo.toml || exit 1
|
||||
: "${LLVM_MINGW_DIR:?Set the verified llvm-mingw directory}"
|
||||
export CARGO_BUILD_JOBS=2
|
||||
cargo +1.100.0 build --locked --release --target aarch64-apple-darwin -p betterxen-hybrid
|
||||
B=target/aarch64-apple-darwin/release/betterxen-hybrid
|
||||
OUT=artifacts/hybrid-protocol/correctness-01
|
||||
mkdir -p "$OUT"
|
||||
git rev-parse HEAD > "$OUT/candidate.txt"
|
||||
git status --porcelain > "$OUT/dirty.txt"
|
||||
"$B" receipt > "$OUT/receipt.json"
|
||||
scripts/hybrid/build-windows-workloads.sh "$LLVM_MINGW_DIR"
|
||||
shasum -a 256 artifacts/hybrid-workloads/x86_64/*.exe > "$OUT/workload-sha256.txt"
|
||||
|
||||
for p in selfcheck-c selfcheck-rust d3d11-clear d3d11-frameloop; do
|
||||
"$B" run --bottle betterxen-protocol --timeout 60 --expect PASS \
|
||||
--out "$OUT/$p" -- "$PWD/artifacts/hybrid-workloads/x86_64/$p.exe" \
|
||||
> "$OUT/$p.json" || exit 1
|
||||
done
|
||||
|
||||
"$B" run --bottle betterxen-protocol --timeout 60 \
|
||||
--out "$OUT/clear-negative" -- \
|
||||
"$PWD/artifacts/hybrid-workloads/x86_64/d3d11-clear.exe" --negative-control \
|
||||
> "$OUT/clear-negative.json"
|
||||
```
|
||||
|
||||
Create the bottle `betterxen-protocol` before this recipe. For the last command,
|
||||
require runner exit 1 **and** JSON `classification: failed_exit_1`, workload
|
||||
`exit_code: 1` and the pixel-mismatch diagnostic. Also run the triangle negative
|
||||
control with the same option. A runner error, timeout or `no_graphics_device`
|
||||
does not satisfy a negative control. The positive runs need their expected
|
||||
checks, not just a zero supervisor exit or the substring `PASS`.
|
||||
|
||||
At the pinned checkpoint, #384's stop path can leave a workload running because
|
||||
it selects the bottle incorrectly for `wineserver -k`. The correction is in
|
||||
[PR #388](https://github.com/MacosPorters/betterxen/pull/388); inspect the actual
|
||||
revision under test rather than assuming the correction merged. After any timeout
|
||||
or low-memory stop, stop the dedicated bottle in CrossOver and confirm the workload
|
||||
is gone before another run. A classification alone is not proof of cleanup.
|
||||
|
||||
## Receipt and run-record sources
|
||||
|
||||
`receipt` emits `betterxen-hybrid-receipt/0` with `host`, `crossover` and
|
||||
`windows_cross_compilers`. A `run` record (`betterxen-hybrid-run/0`) does **not**
|
||||
embed that host receipt at the pinned revision; keep the sibling `receipt.json`
|
||||
with each attempt. `bench` embeds `host` once. Supplement these records with
|
||||
candidate/workload hashes, build options, source commands and measurement settings;
|
||||
they are not all emitted by the current tool. Do not invent an implemented schema.
|
||||
|
||||
| Fact | Source at this checkpoint | Interpretation and missing data |
|
||||
| --- | --- | --- |
|
||||
| macOS version/build | `sw_vers -productVersion`; `sysctl -n kern.osversion` | Retain both; a marketing version alone is insufficient. |
|
||||
| Chip, memory and CPUs | `sysctl -n machdep.cpu.brand_string`, `hw.memsize`, `hw.logicalcpu`, `hw.perflevel0.physicalcpu`, `hw.perflevel1.physicalcpu` | Bytes for memory; failed or absent keys are unknown. Preserve raw perflevel values; their P/E labels are the collector's interpretation. |
|
||||
| Collector architecture and Rosetta execution probe | `receipt_binary_arch` comes from Rust's build target; `arch -x86_64 /usr/bin/true` supplies `rosetta_executes_x86_64` | The latter deliberately executes a system binary's Intel slice. Failure does not distinguish absence from disabled/unusable translation; it does not establish the Wine process's architecture. |
|
||||
| GPU and Metal description | `system_profiler SPDisplaysDataType -json`, first matching `sppci_model`, `sppci_cores`, `spdisplays_mtlgpufamilysupport` | Inventory strings, not runtime `MTLDevice` capability queries or execution proof. Capability queries not collected are unknown. |
|
||||
| CrossOver build and bundle architecture | `Contents/Info.plist` via `plutil`; `lipo -archs` on `Contents/MacOS/<CFBundleExecutable>` | Record the selected installation; the GUI executable's slices do not establish `wineloader`/`wineserver` architecture. Multiple installations need explicit reconciliation with the runner's first-discovered selection. |
|
||||
| Bottle search/preferences | `defaults read com.codeweavers.CrossOver BottleDir` and `ManagedBottleDirs`; candidate locations and `mdfind` | Unset/unreadable preferences are not proof of no bottles or no installation. |
|
||||
| Windows compiler identity | Resolved compiler path, `--version`, `-dumpmachine`; retain archive hash separately | Inspect native executables before running them. The receipt's probe does not establish the archive pin or inspect every helper. |
|
||||
| Requested/detected backend | CLI selection and `CX_GRAPHICS_BACKEND`; stdout/stderr banners or adapter-name heuristic in `run.rs` | The variable is undocumented for macOS in the reviewed sources (#350). Preserve `unknown` and `inferred` labels; `default` is not proof of a particular backend. |
|
||||
| Run outcome and lifetime | Child status/output; supervisor monotonic clock from spawn through completion/stop | Require correctness diagnostics and expected exit as well as classification. `duration_ms` includes startup and workload time, not isolated startup latency. |
|
||||
|
||||
Field definitions come from the candidate's
|
||||
[host collector](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/crates/hybrid/src/host.rs),
|
||||
[CrossOver discovery](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/crates/hybrid/src/crossover.rs),
|
||||
[CLI](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/crates/hybrid/src/main.rs)
|
||||
and [runner](https://github.com/MacosPorters/betterxen/blob/566272082a74d8b45fcec37edd00f4f6703df3ab/crates/hybrid/src/run.rs).
|
||||
This describes their implementation, not a guarantee that every probe works on
|
||||
every macOS version. Preserve JSON `null` and explain absent fields as unknown;
|
||||
never replace them with zero or a nearby machine's values.
|
||||
|
||||
## Metric definitions and collection limits
|
||||
|
||||
| Metric | Definition / collection | Required qualification |
|
||||
| --- | --- | --- |
|
||||
| Average rate and frame-time percentiles | Positive finite intervals `t[i]` in milliseconds; rate = `1000 × n / sum(t)`. Sort intervals; percentile p is rank `ceil(p × n / 100)`, one-based. Report n, p50, p95, p99, p99.9 and maximum. | The hybrid analyzer uses nearest rank; the preserved native startup benchmark uses interpolation. Do not combine them. Report sample count; a small sample's p99.9 can be its maximum. |
|
||||
| 1% and 0.1% lows | `1000/p99_ms` and `1000/p99.9_ms`, respectively. | These are reciprocal percentiles, not averages of the slowest 1% or 0.1%. Keep that definition in reports. |
|
||||
| Stutters | Count intervals strictly greater than twice p50. | A protocol convention, not a universal perceptual threshold. Intervals equal to twice p50 do not count. |
|
||||
| CPU | Sample `/bin/ps -axo rss=,pcpu=,command=`; sum matched CrossOver/bottle processes and average the samples. | Percent of one core, can exceed 100%. Path matching is heuristic and can include unrelated CrossOver processes. This is not CPU time divided by the run's wall time. Zero samples means unavailable, not zero usage. |
|
||||
| Unified memory / memory pressure | `memory_pressure -Q` free-percentage line; retain starting and minimum observed percent plus poll interval. `ps` provides sampled peak summed resident set size (RSS, KB). | The free-percentage text format is observed, not a stable documented API. System free percentage and process RSS are not total unified/GPU allocation. RSS can double-count shared pages; failed `ps` currently also yields zeros, so do not accept those as measured zero. |
|
||||
| GPU utilization | Not collected by the candidate. | Unknown; do not infer it from FPS, RSS or elapsed time. A future collector must name its source and overhead. |
|
||||
| Startup and shader compilation | Current `duration_ms` covers the whole supervised process. D3D11 HLSL compilation occurs before the loop. | Separate spawn-to-first-result and compile durations are not instrumented. Mark them uncollected; a first run is not necessarily a cold-cache run. |
|
||||
| Thermals | `pmset -g therm` before/after; retain raw warnings and power-source/idle notes (`pmset -g batt`, `uptime`). | No warning is not a temperature reading, proof of no throttling or a sustained-load result. |
|
||||
| Long-duration stability | Predeclare wall-time/iteration budget, timeout, sampling interval and stop conditions; retain every failure, memory trend and repeat. | The tiny triangle is not representative load. Its only pixel readback is at the beginning, so successful exit does not establish correctness of all later frames. |
|
||||
|
||||
The frame loop uses
|
||||
[QueryPerformanceCounter](https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter)
|
||||
around submission and a
|
||||
[GetData event-query wait](https://learn.microsoft.com/en-us/windows/win32/api/d3d11/nf-d3d11-id3d11devicecontext-getdata).
|
||||
It measures CPU-observed offscreen iteration intervals, including wait, loop and
|
||||
logging overhead. It does not measure GPU timestamp duration or displayed FPS.
|
||||
The first interval starts before first submission; after the first readback the
|
||||
clock is reset. Preserve that boundary when describing the series. The busy wait
|
||||
also affects CPU and thermal observations.
|
||||
|
||||
The runner computes statistics from `frame_ms` lines but deletes its full raw
|
||||
stdout/stderr files, retaining only tails without the frame lines in JSON.
|
||||
Consequently its summary alone cannot be independently reanalyzed. Full trace
|
||||
retention, presented-frame capture per backend and capture-overhead measurement
|
||||
remain [#145](https://github.com/MacosPorters/betterxen/issues/145) work. Until they
|
||||
exist, label these runs exploratory offscreen summaries. Do not present them as
|
||||
validated frame-pacing or capture-overhead results.
|
||||
|
||||
## Repetition and analysis check
|
||||
|
||||
Run correctness and both graphics negative controls for each backend before
|
||||
using its timing. Use release builds, AC power, an otherwise idle machine and
|
||||
one GPU job at a time. Record validation variables and toolchain settings;
|
||||
keep correctness with validation enabled separate from timing with it disabled.
|
||||
Reuse the [native protocol's](benchmarks.md#protocol) environment discipline.
|
||||
|
||||
Declare iteration count (for example 2,000), two untimed warm-up processes and
|
||||
five measured processes per backend before starting. Record the exact backend
|
||||
order and reverse/rotate it for a repeated comparison. Do not silently discard
|
||||
failed attempts, outliers, the first interval or additional warm-ups. The
|
||||
candidate does not implement within-process warm-up exclusion; report the full
|
||||
series it actually summarizes. Keep first-run and warmed observations separate
|
||||
without claiming to have cleared any driver cache.
|
||||
|
||||
After correctness passes, a measured block on the candidate can use:
|
||||
|
||||
```sh
|
||||
OUT=artifacts/hybrid-protocol/timing-01
|
||||
mkdir -p "$OUT"
|
||||
MTL_DEBUG_LAYER=0 MTL_SHADER_VALIDATION=0 "$B" bench \
|
||||
--bottle betterxen-protocol --backends d3dmetal,dxmt --repeat 5 \
|
||||
--timeout 60 --min-start-free 50 --min-free 15 --expect PASS --out "$OUT" \
|
||||
-- "$PWD/artifacts/hybrid-workloads/x86_64/d3d11-frameloop.exe" 2000 \
|
||||
> "$OUT/bench-stdout.json"
|
||||
```
|
||||
|
||||
Run the declared warm-ups separately before that block. These backend names are
|
||||
candidates, not promises of availability; retain refusals and unknown identity.
|
||||
Report each process's statistics and the median/range across processes. Do not
|
||||
pool intervals across processes or call a median of p99 values the pooled p99.
|
||||
Do not subtract an assumed capture overhead; it has not been measured.
|
||||
|
||||
Check the analyzer independently with 100 synthetic intervals: 98 at 10 ms,
|
||||
one at 20 ms and one at 100 ms. Their sum is 1,100 ms, mean 11 ms and rate
|
||||
`1000/11` per second. Nearest ranks 50, 95, 99 and 100 give p50=10, p95=10,
|
||||
p99=20 and p99.9=100 ms. The lows are 50 and 10 per second; exactly one
|
||||
interval exceeds twice the median. In the implementation checkout:
|
||||
|
||||
```sh
|
||||
mkdir -p artifacts/hybrid-protocol
|
||||
python3 -c 'print("\n".join(["10"] * 98 + ["20", "100"]))' \
|
||||
> artifacts/hybrid-protocol/known-intervals.txt
|
||||
"$B" frames artifacts/hybrid-protocol/known-intervals.txt
|
||||
```
|
||||
|
||||
This arithmetic is a check of analysis conventions, not Windows/GPU evidence or
|
||||
a new performance measurement. An independent reviewer must re-derive it rather
|
||||
than use the analyzer to generate its own expected answers.
|
||||
|
||||
## Evidence and independent acceptance
|
||||
|
||||
Attach the candidate identity, workload hashes, receipt, settings, command exit
|
||||
statuses, output checks and run records to each local attempt. Classify CPU,
|
||||
graphics readback, runtime admission and timing separately. Record `passed`,
|
||||
failed, unavailable, unsupported and not-run outcomes explicitly. Missing
|
||||
tooling, a skipped test or a timeout cannot establish GPU support.
|
||||
|
||||
Keep source review (class D), local original-fixture execution and independent
|
||||
reproduction distinct under the repository's [claims registry](../claims.toml)
|
||||
and [review records](review-log.md). Do not promote one machine's observation to
|
||||
M1–M5 compatibility, Xbox-hardware verification or game compatibility. A second
|
||||
contributor records their own candidate, hardware, commands and disagreements;
|
||||
the implementer cannot independently accept their result.
|
||||
|
||||
Before posting evidence, review a separate redacted copy: remove personal paths,
|
||||
email addresses, unrelated process data and private bottle/program names, while
|
||||
retaining versions, units, outcomes and hashes needed to understand the run.
|
||||
Use repository-relative paths and a pseudonym. Raw receipts can contain local
|
||||
compiler/application paths and stdout tails; this protocol never uploads them.
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user