98 lines
7.3 KiB
Markdown
98 lines
7.3 KiB
Markdown
# EonaCat.XSBOX
|
||
|
||
EonaCat.XSBOX is a Windows-first Rust host/runtime for the Xbox title implementation in this repository. It translates and hosts the title's console-facing services on a Windows PC, with Direct3D 12 as the graphics backend.
|
||
|
||
> **Compatibility note:** this project preserves the supplied Rust implementation and includes a Windows Forms launcher. The launcher is built separately from the Rust engine and is published in the selected Cargo profile output directory.
|
||
|
||
## Project layout
|
||
|
||
| Folder | Contents |
|
||
|---|---|
|
||
| `crates/engine` | Runtime host, command-line entry point and console compatibility services |
|
||
| `crates/graphics` | Direct3D 12, DXGI, shaders, pipelines, GPU memory and frame scheduling |
|
||
| `crates/game` | Title-specific metadata, package handling and compatibility hooks |
|
||
| `launcher/windows` | Windows Forms launcher, configuration, game library and launch workflow |
|
||
| `assets` | Application icons and artwork |
|
||
| `settings/graphics` | Example graphics profiles |
|
||
| `scripts` | Build support, benchmarks and profile installation |
|
||
| `docs` | Architecture and performance documentation |
|
||
|
||
## Workspace
|
||
|
||
| Crate | Responsibility |
|
||
|---|---|
|
||
| `eonacat-xsbox-engine` | Windows process host, CLI, executable inspection/translation, HLE runtime, audio/input/window integration |
|
||
| `eonacat-xsbox-game` | Title-specific build identities, package/container metadata, patches and prompt hooks |
|
||
| `eonacat-xsbox-gpu` | D3D12/DXGI objects, command queues/lists, resources, descriptors, shader translation/cache, formats, frame pacing, memory/residency and GPU host integration |
|
||
|
||
The executable is `eonacat-xsbox.exe` (package `eonacat-xsbox-engine`). The source is split by domain; GPU internals are further divided into `shader`, `pipeline`, `loader`, `replay`, `streamline`, `formats`, `host`, `memory` and related subsystems.
|
||
|
||
## Build requirements
|
||
|
||
- Windows 10/11 x64 (Windows-first runtime; several runtime modules are `cfg(windows)`).
|
||
- Rust stable with the `x86_64-pc-windows-msvc` target.
|
||
- Visual Studio 2022 Build Tools with **Desktop development with C++** and a Windows SDK.
|
||
- .NET 8 SDK to build the Windows Forms launcher; .NET 8 Desktop Runtime to run it.
|
||
- Cargo dependencies available locally or network access for the first dependency resolution.
|
||
|
||
Build the engine and launcher from a Visual Studio Developer Command Prompt:
|
||
|
||
```bat
|
||
build.bat release
|
||
```
|
||
|
||
The engine is written to `target\x86_64-pc-windows-msvc\release\eonacat-xsbox.exe`. The launcher is published to the adjacent `launcher` folder and resolves the engine from its parent profile directory. Use `build.bat fast` for iteration or `build.bat diag` for diagnostics.
|
||
|
||
Fast iteration and diagnostics:
|
||
|
||
```powershell
|
||
cargo build --target x86_64-pc-windows-msvc --profile fast -p eonacat-xsbox-engine
|
||
cargo build --target x86_64-pc-windows-msvc --profile diag -p eonacat-xsbox-engine --features diagnostics
|
||
```
|
||
|
||
Run the CLI help with `target\x86_64-pc-windows-msvc\release\eonacat-xsbox.exe --help`.
|
||
|
||
## Performance design
|
||
|
||
The preserved implementation already includes several performance-oriented choices:
|
||
|
||
- Direct3D 12 host rendering and GPU-side shader/pipeline work, rather than software rendering for the primary graphics path.
|
||
- A dedicated GPU crate, keeping title/runtime code separate from graphics implementation.
|
||
- `mimalloc` as the non-diagnostic global allocator in the GPU crate.
|
||
- `zlib-rs`, `memchr` and BLAKE3 for optimized data-processing hot paths.
|
||
- Pipeline/shader caches, upload arenas/pools, resource residency and frame pacing subsystems.
|
||
- Release profile with fat LTO and one codegen unit; a separate `fast` profile for iteration.
|
||
|
||
GPU acceleration is not a switch that automatically makes all work faster. CPU work remains for guest instruction translation, API emulation, draw/dispatch submission, synchronization, decompression, audio and input. The GPU crate uses Windows D3D12/DXGI APIs; actual acceleration and optional features depend on the GPU, driver, OS and runtime components. No CUDA-only dependency is imposed, so NVIDIA, AMD and Intel D3D12 devices can use the supported Direct3D path subject to feature support.
|
||
|
||
## Memory and CPU tuning principles
|
||
|
||
### Conservative CPU defaults
|
||
|
||
- Runtime pipeline compilation now defaults to half of the logical processors (1–8 workers); on systems identified as having limited host RAM it defaults to roughly one third (1–4 workers). This reduces simultaneous driver compiles and leaves more CPU time for the guest and D3D12 submission. `EONACAT_XS_PIPELINE_WORKERS=1..64` remains the explicit override.
|
||
- Offline shader translation, shader-cache warming and pipeline-library warming default to half of the logical processors. `EONACAT_XS_CPU_THREADS=<n>` sets their default worker count; explicit CLI `--jobs` takes precedence.
|
||
- The worker count is bounded by the number of tasks where that count is known. No busy-wait loop or permanent worker pool is added by this policy.
|
||
|
||
Example PowerShell settings for a quieter CPU profile:
|
||
|
||
```powershell
|
||
$env:EONACAT_XS_PIPELINE_WORKERS = "2"
|
||
$env:EONACAT_XS_CPU_THREADS = "2"
|
||
```
|
||
|
||
## FPS priority preset
|
||
|
||
Select **FPS PRIORITY (4K / 120 HZ)** in the launcher's Presets page and restart the title. It selects Series X, 4K output, DLSS Balanced, ray tracing off, and a 120 FPS cap / 120 Hz report. All quality presets now share the display defaults: borderless stretch, FPS line off, bottleneck advisor off, fast-core submission placement and memory range memoization. Individual quality presets still retain their own render-resolution and image-quality targets.
|
||
|
||
The 120 FPS value is a cap, not a promise of 120 FPS. The latest supplied performance log measured about 38.8 FPS (25.8 ms/frame), with roughly 24.5 ms of submitting-thread preparation and 15.2 ms of GPU list execution. Memory refresh work included about 9.4 ms per frame for refreshes outside the arena, and the refresh pass skipped about 9,700 of 10,000 ranges as unchanged. These measurements point to both host submission and GPU execution costs; the preset is a controlled optimization profile, not a measured performance guarantee.
|
||
|
||
If you prefer to keep your current custom settings, leave the preset on Custom. Explicit command-line overrides still take precedence over the FPS preset.
|
||
|
||
|
||
|
||
## Low-CPU smooth-play preset
|
||
|
||
Select **LOW CPU (30 BASE / 60 FRAME-GEN)** in the in-game Presets page and restart the title. It uses the Series S workload profile, 1440p output target, 540p internal render size with DLSS Performance, ray tracing off, a 30 FPS simulation cap, and 2x frame generation. The intent is to reduce guest simulation and draw workload while presenting generated frames at up to about 60 FPS when DLSS Frame Generation is available. Generated frames are not equivalent to 60 native game/simulation frames, and input latency follows the lower base rate.
|
||
|
||
The supplied 4 December 2026 log shows the current 120 FPS cap is not being reached: sustained samples are roughly 25–28 FPS (about 36–40 ms/frame), with submitting-thread preparation around 31–35 ms/frame. The GPU list timing is also substantial (about 27 ms in the final per-frame card-meter sample). This is a mixed host-submission and GPU workload, not simply a GPU saturation problem. The low-CPU preset is a conservative workload reduction, not a measured benchmark result. Confirm that the log reports `framegen=true` after restarting; if it remains false, use the preset without expecting generated frames.
|