Commit Graph
985 Commits
Author SHA1 Message Date
ates cd72ef8ec3 [M2-E3] gameinput: implement device-callback lifecycle and SetFocusPolicy (#481)
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 23:47:28 +03:00
Ateş 52e786664d Merge pull request #476 from jelly013/track-d/445-guest-shader-bridge
[M2-D] dxbc-accc: reach Windows guests as bx_shader_bridge.dll (#445)
2026-11-26 23:40:30 +03:00
Ateş b22ec27c79 Merge pull request #477 from sahib453/track-a/474-staging-ownership
[Track A] Keep system32 shim staging from overwriting files it did not create (#474)
2026-11-26 23:39:16 +03:00
sahib453 0749dcf236 Address review: stub visibility, link entries, partial staging
A bottle that launched from a different prefix fails the run only when
the staged shims cannot be found with the same contents there; a
private stub linking back to the managed prefix is accepted. The
destination entry is inspected without following links, so a dangling
symbolic link is a foreign entry and is left alone. New files are
installed without replacing anything. Temporary copies are all written
first and each installed file is recorded in the manifest before the
next, so a later failure leaves earlier files owned.

Signed-off-by: sahib453 <sahibsingh4533@gmail.com>
2026-11-27 02:06:27 +05:30
jelly013 238daa6b25 dxbc-accc: tighten the guest build and check from review
guest/build.sh:
- Always build into, and copy from, <repo>/target, whatever
  CARGO_TARGET_DIR says, so a stale DLL can no longer be packaged.
- Resolve cargo and rustc through rustup, check that this rustc has std
  for x86_64-pc-windows-gnu, and print which rustc was used.
- Check the whole Export Address Table the way build-shims.sh does:
  every populated entry must be a direct RVA owned by one of the three
  names, so an ordinal-only extra or a forwarder fails. Imports must be
  Wine-provided system DLLs from an allowlist.

guest/check_bridge.c:
- Load the DLL by full path from the EXE's own directory.
- Check the exact DXIL and ACCC chunk sizes and the root signature
  flag, derived from the program's own chunk-table walk, and the
  digest against header bytes 4..20 for every container.
- Add a container with trailing bytes, checking that only the declared
  container is reported and copied.

The README documents how a calling shim must locate the bridge: by
full path from its own directory, not by bare name. It also records
that CI does not build the bridge yet.

Refs #445

Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com>
2026-11-26 21:27:51 +01:00
jelly013 7815a947e5 Merge remote-tracking branch 'upstream/main' into track-d/445-guest-shader-bridge
Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
2026-11-26 21:27:01 +01:00
Jelly 99bfbc26ef [M2-E2] Offline XGameSave and XPackage through QueryApiImpl (#472)
QueryApiImpl now serves offline XGameSave and XPackage as COM IUnknown
objects under BetterXen synthetic keys (shims/xgameruntime/synthetic_keys.h),
backed by bottle-local storage. Public Microsoft.GDK.Windows com_dispatch.cpp
wiring remains tracked in #468.

- XGameSave: provider init, containers, updates, blob writes, async submit
  and read, enumeration, and parent-child handle cascade close. Saves are
  isolated per SCID under C:\bx_pls\<exe_hash>\saves\<scid_hash>\ with
  atomic temp-file + MoveFileExW replacement, cross-process named mutex
  serialization, FILE_SHARE_DELETE readers, strict BXGS format validation,
  256-byte blob-name limits counted toward the 16 MiB update cap, and
  E_GS_OUT_OF_LOCAL_STORAGE mapping.
- XPackage: treats the running executable's directory as the installed
  package (BXPKG<16 hex> identifier, XPackageKind::Game, and mount queries).
- Lifetimes & XAsync: generic AsyncOp support with runtime generation guard
  before execute(), disjoint handle tag ranges, and full handle/result
  cleanup on final XGameRuntimeUninitialize.
- Tests: tests/conformance/test_xgameruntime_saves covering round-trip,
  SCID isolation, crafted corrupt files, atomic replace, 64 threaded +
  160 cross-process submits, uninitialize memory release, and UTF-8 paths.

Refs #468

Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com>
2026-11-26 23:21:19 +03:00
sahib453 1ec92916b9 Keep system32 shim staging from overwriting files it did not create
Fixes the three points of #474 in bx-cli run. Staging records what it
wrote in a .bx-staged manifest (one SHA-256 per file) and replaces only
files listed there and unchanged since; any other same-named file stops
the run before anything is written. For a named bottle the prefix is
re-resolved after the run and a launch in a different prefix is
reported and fails the run. When initialization uses the whole
--timeout the guest is not started. Adds 9 unit tests.

Signed-off-by: sahib453 <sahibsingh4533@gmail.com>
2026-11-27 01:19:53 +05:30
jelly013 9d504d12d7 dxbc-accc: reach Windows guests as bx_shader_bridge.dll
Shims that see shader bytecode run as x86-64 PE32+ DLLs inside
CrossOver and cannot load the arm64 host library. Build this same crate
for x86_64-pc-windows-gnu instead: its cdylib becomes
bx_shader_bridge.dll, exporting exactly the three bx_shader_bridge.h
entry points, with no MinGW runtime DLL dependency. There is no second
implementation to keep in sync.

guest/build.sh builds the DLL, checks its exports and imports, and
builds check_bridge.exe, a C guest program compiled against the frozen
header. It sends a real DXC SM 6.6 blob and seven synthetic containers
through the DLL, checks classification, prepare and free, and prints a
DXIL vs. ACCC count. It passes under CrossOver 26.3 in a prefix and a
D3DMetal bottle.

The abi/defs export list, staging in build-shims and the d3d12_xs PSO
hook (#466) are separate changes.

Closes #445

Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com>
2026-11-26 20:43:56 +01:00
Ateş f7fb52bc56 Merge pull request #455 from Scarlet-Noble/track-f/453-d3dmetal-gpu-limits
[M2-F] D3DMetal GPU limits research and test_d3dmetal_gpu_limits fixture (#453)
2026-11-26 22:22:22 +03:00
atharvranjan ec2170d480 Merge main into track-f/453-d3dmetal-gpu-limits
Bring in main at cc5ce59 and resolve three documentation conflicts:

- CHANGELOG.md: keep the #453 entry above the entries added on main.
- docs/README.md: keep both new research links (swapchain references
  and D3DMetal GPU limits).
- docs/roadmap.md: take main's milestone table, including the verified
  M0/M1 status and the expanded M2 row, and append only the two
  measured-constraint links from this branch to the M2 and M3 rows.

No source, shader, header or research-note content changes relative to
either parent.

Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-26 13:16:44 -06:00
Ateş cc5ce59d21 Merge pull request #463 from MacosPorters/track-f/m2-docs-sync
[M2-F] Update README and roadmap for M1 completion and M2 kickoff
2026-11-26 21:35:40 +03:00
ates 61fc3590b2 Merge remote-tracking branch 'origin/main' into track-f/m2-docs-sync
Signed-off-by: ates <ahmetrizaates@hotmail.com>

# Conflicts:
#	CHANGELOG.md
2026-11-26 21:34:31 +03:00
Ateş 58fc63c7ec Merge pull request #462 from MacosPorters/track-e/456-query-api-impl-dispatch
[M2-E] Public GDK COM QueryApiImpl dispatch in xgameruntime.dll (#456)
2026-11-26 21:33:40 +03:00
ates 600a0ab08f Merge remote-tracking branch 'origin/main' into track-f/m2-docs-sync
Signed-off-by: ates <ahmetrizaates@hotmail.com>

# Conflicts:
#	CHANGELOG.md
2026-11-26 21:31:51 +03:00
ates cda66a57f2 Merge remote-tracking branch 'origin/main' into track-e/456-query-api-impl-dispatch
Signed-off-by: ates <ahmetrizaates@hotmail.com>

# Conflicts:
#	CHANGELOG.md
2026-11-26 21:31:48 +03:00
ates a5c1995f21 Link Wave 2 M2 issues (#464-#469) in README progress board
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 21:25:25 +03:00
atharvranjan 868444ed30 Merge pull request #458 from Scarlet-Noble/track-a/457-system32-staging
[M1-A] Stage xgameruntime.dll and its shim imports into system32 (#457)
2026-11-26 12:22:56 -06:00
atharvranjan 510b6d1d66 Supervise wineboot and tolerate partial shim folders in system32 staging (#457)
A --shims folder without xgameruntime.dll made every bx-cli run fail; it is now reported and skipped.

wineboot --init ran before the signal handlers and outside --timeout, so Ctrl-C during a first run left wineserver and its services running. It now runs under the supervisor and shares the --timeout budget.

The temporary staging file name is now per process, so concurrent runs cannot publish each other's partial write.

Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-26 12:22:42 -06:00
ates 92c2ff7add Update README and roadmap for M1 completion and M2 kickoff
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 21:19:26 +03:00
ates 39baf092a3 Wire offline IXUser change-event and query slots in com_dispatch
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 21:17:41 +03:00
ates 0a30562cde Implement public GDK COM QueryApiImpl dispatch in xgameruntime.dll (#456)
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 21:15:21 +03:00
Vicente Abarca fb56805459 Stage xgameruntime.dll and its shim imports into system32 (#457)
GDK titles load the runtime with LoadLibraryExW(L"xgameruntime.dll",
NULL, LOAD_LIBRARY_SEARCH_SYSTEM32), which never searches WINEPATH, so
the bootstrap failed with E_GAMERUNTIME_DLL_NOT_FOUND before the #441
loader exports were reached.

bx-cli run now copies xgameruntime.dll into the environment's
drive_c/windows/system32 before launch. It also copies every BetterXen
shim that DLL imports, found with bx-probe (today bx_runtime_veh.dll),
because the restricted search also applies to a DLL's own imports.
Copies are idempotent and replaced through a rename, and bx-cli prints
what it staged. A bare --prefix with no system32 is initialized with
wineboot --init under the same isolated environment. A bottle with no
system32 fails with a hint.

Adds 8 unit tests for staging and the dependency walk, and
tests/conformance/test_system32_staging with a --expect-missing
negative control.

Signed-off-by: Vicente Abarca <135478656+Scarlet-Noble@users.noreply.github.com>
2026-11-26 15:00:38 -03:00
Vicente Abarca 1eb963d883 Address review of test_d3dmetal_gpu_limits and its note (#453)
Fixture:
- check_lock64 keeps its upload buffer alive until the list that copies
  from it has run.
- The spin lock takes an acquire DeviceMemoryBarrier after winning the
  lock, before reading the data, as well as the release barrier.
- A check that fails partway through recording closes and resets the
  list (abandon) instead of leaving stale commands for the next check.
- wave.control checks what D3D12 guarantees: one wave width for every
  thread, and lane indices forming a permutation within each wave, with
  waves identified by WaveReadLaneFirst(id.x). It no longer assumes
  lane == i % width.
- Skips with exit 77 when shader model 6.6 is unavailable or the query
  fails.
- submit checks Signal, SetEventOnCompletion and the Reset calls.
  Resources the GPU may still use are leaked rather than released after
  a hung or removed queue.

Note: the measured constraints are separated from the reports taken
from a commercial title. The reports move to an "Unverified reports
(not evidence)" section, each with the synthetic workload that would
verify it. The M2-gate inference is dropped, and the roadmap rows link
only the measured section. The results are re-measured after the fixes:
with the acquire fence, the 64-try cap drops 96-108 of 512 updates. The
1024-try cap is still exact.

Signed-off-by: Vicente Abarca <135478656+Scarlet-Noble@users.noreply.github.com>
2026-11-26 14:53:44 -03:00
Ateş ac0fd2e502 Merge pull request #454 from MacosPorters/track-a/408-bx-cli-supervision
[M1-A1] Supervised timeout, cleanup and trace summary for bx-cli run
2026-11-26 20:45:44 +03:00
ates 73c190d725 Merge remote-tracking branch 'origin/main' into HEAD
Signed-off-by: ates <ahmetrizaates@hotmail.com>

# Conflicts:
#	CHANGELOG.md
2026-11-26 20:43:46 +03:00
ates f3c2b7fe34 Re-resolve bottle prefix on timeout/signal cleanup for managed first-launch stubs
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 20:43:20 +03:00
Ateş 4333a7cc5e Merge pull request #452 from skakwy/track-a/437-api-set-shims
Add API-set resolution fixture and ADR 0007 (#437)
2026-11-26 20:42:35 +03:00
ates 66e9351410 Require valid module lookups in test_apiset_resolution and accept ADR 0007
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 20:42:05 +03:00
Ateş 060083cc56 Merge pull request #441 from devil8blade/track-e/439-xgameruntime-dynamic-api-impl
[M1-E3][ABI] Dynamic GDK loader exports in xgameruntime.dll
2026-11-26 20:36:09 +03:00
Vicente Abarca 120a5ec5f6 Document D3DMetal GPU limits and add test_d3dmetal_gpu_limits (#453)
Adds docs/research/d3dmetal-gpu-limits.md: the D3DMetal and Apple GPU
constraints a shader translator has to handle (wave64 splitting, 64-bit
atomics and lock emulation, the 32 KiB mesh output limit, an Apple
shader compiler crash on early-merged output stores, and
OpenExistingHeapFromAddress). Each item is marked as either measured by
the new fixture or reported from local builds of a commercial title. It
is linked from the M2 and M3 roadmap rows and from the docs index.

Adds tests/conformance/test_d3dmetal_gpu_limits: an original D3D12
compute fixture that talks to the host d3d12.dll directly. It has four
original HLSL kernels with committed DXC 1.9.2609 output, and
shaders/compile.sh regenerates them. Expected values are computed on
the CPU.

On an Apple M3 Pro (macOS 27.2.1, CodeWeavers Wine 11.0 built from
source, D3DMetal 4.0b3) the WaveSize(64) pipeline and the kernels using
SM 6.6 64-bit atomics are created but never run. The bounded lock
emulation is exact at a 1024-try cap and drops updates at 64 tries.

Signed-off-by: Vicente Abarca <135478656+Scarlet-Noble@users.noreply.github.com>
2026-11-26 14:32:09 -03:00
atharvranjan 7d7249ee8b Clean up the bottle CrossOver actually launches; limit --backend to bottles
- Locate --bottle through CrossOver's CXBottle module with the launch's
  environment, so CX_BOTTLE_PATH, configured paths and managed bottles are
  stopped correctly. Refuse to launch if it cannot be located.
- Require --bottle for --backend: a bare prefix loads Wine's own D3D12.

Both reproduced by atesahmet0 on #454.

Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-26 11:19:36 -06:00
atharvranjan d0395a61da Add supervised timeout and cleanup to bx-cli run (#408)
- --timeout, and cleanup on timeout, SIGINT, SIGTERM or SIGHUP: stop the
  launcher process group, then wineserver for the selected bottle or prefix.
  wineserver -k exit 1 (nothing running) is accepted only if -w succeeds.
- Pass shim overrides with bin/wine --dll and --backend with --env in bottle
  mode, because bin/wine discards WINEDLLOVERRIDES and applies bottle
  settings over the environment. First found by jelly013.
- Print the trace summary after a run with --log.
- Record the libc dependency and a one-host D3D12 swapchain observation.

Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-26 11:01:28 -06:00
skakwyandClaude Sonnet 5.5 2eb59e033b Add API-set resolution fixture and ADR 0007 (#437)
test_apiset_resolution imports one export from each of the six win32_bridge
API-set DLLs through the PE import directory and reports, per name, whether a
BetterXen shim file or a host module serves it, and which module the import
address table slot is bound to. --expect host (default) or --expect shim
selects the outcome that passes.

On CrossOver 26.0 all six names are served by the host (twinapi.appcore.dll
for PSM, user32.dll for ntuser) and +loaddll shows no Loaded record for any
shim file. ADR 0007 proposes relying on Wine's built-ins and records that
evidence; a CrossOver 26.3 re-run is still needed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: skakwy <nils_0805@icloud.com>
2026-11-26 17:53:14 +01:00
Ateş eec56dd028 Merge pull request #448 from MacosPorters/track-f/446-boot-texture-computer
[M1-F2] Exercise the texture computer in test_integration_boot
2026-11-26 19:27:14 +03:00
devil8blade e7899574ab Keep XErrorReport logs valid UTF-8 and record loader provenance
Invalid bytes are written as \u00XX and a multi-byte character is not
split when the detail buffer fills. The six loader prototypes are
recorded as BetterXen-defined. The two changelog notes are one entry.

Signed-off-by: devil8blade <360741796+devil8blade@users.noreply.github.com>
2026-11-26 16:25:51 +00:00
atharvranjan 486f7b197f Check full footprints and keep one Fixed changelog section
Also verify footprint format, width, height and depth, call Release through
the computer's own vtable, and state the release check precisely.

Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-26 10:11:04 -06:00
atharvranjan 390e85fc8d Exercise the texture computer in test_integration_boot
The fixture passed a null descriptor to XGCreateTextureComputer and reported
the stage as pending, although #415 implemented it. Create a 100x50 two-mip
RGBA8 computer, check its layout against hand-computed values, require the
suggested layout to be linear and require release to free the object.

Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-26 10:09:10 -06:00
devil8blade 18178da12c Address review: surface unsupported QueryApiImpl in trace, null out on failure
Unsupported and mismatched QueryApiImpl queries keep their structured log
and also call BX_STUB_LOG so bx-cli trace lists them. Failure paths clear
the output pointer. XErrorReport uses the public void signature.

Signed-off-by: devil8blade <360741796+devil8blade@users.noreply.github.com>
2026-11-26 16:05:11 +00:00
Ateş bfa80dee8b Merge pull request #440 from MacosPorters/track-a/438-trace-summary
Report sampled CLWB bounds and guest crashes in bx-cli trace
2026-11-26 18:47:38 +03:00
ates 829a94fa2f bx-cli: print clwb VEH traps : 0 when no CLWB records exist
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 18:47:28 +03:00
devil8blade 2e895e0f9b Export GDK dynamic loader entry points from xgameruntime.dll
The static loader resolves InitializeApiImpl, InitializeApiImplEx,
InitializeApiImplEx2, UninitializeApiImpl, QueryApiImpl, and XErrorReport
with GetProcAddress. Those initialize entry points share the existing
runtime refcount with XGameRuntimeInitialize and
XGameRuntimeInitializeWithOptions. UninitializeApiImpl releases that same
state. QueryApiImpl dispatches the offline families this DLL already
implements and logs any other class or interface. XErrorReport records
the code and message and does not terminate the process.

Closes #439

Signed-off-by: devil8blade <360741796+devil8blade@users.noreply.github.com>
2026-11-26 15:38:34 +00:00
Ateş 02b8924de7 Merge pull request #427 from MacosPorters/track-b/412-xmem-physical
[M1-B2] Map xmem physical pages into shared aliases
2026-11-26 18:31:10 +03:00
ates 925311e852 Merge main and address PR #427 review findings
- Wire physical-page accounting into xmem.cpp via shims/xmem/xmem_accounting.h so XMemGetWorkingSetStatistics and bx_xmem_get_internal_stats report allocated_physical_bytes and enforce one shared title memory budget across heap, virtual, and physical allocations.
- Require exact full-span coverage in unmap_span; empty or partially mapped spans now fail with ERROR_INVALID_PARAMETER without disturbing existing views.
- Document Win32 AWE-modeled synthetic signatures (AllocateUserPhysicalPages / FreeUserPhysicalPages in memoryapi.h) and intra-span duplicate-tag aliasing vs duplicate-tag free rejection.
- Expand test_xmem_physical to cover working-set stats, shared cap enforcement, invalid flags, intra-span duplicate-tag aliasing, duplicate and stale free non-mutation, and partial/empty unmap rejection.
- Resolve CHANGELOG.md conflict with origin/main.

Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 18:30:37 +03:00
Ateş f7194d0255 Merge pull request #431 from MacosPorters/track-a/410-win32-bridge
[M1-A3] Cover Win32 bridges and track offline PSM registrations
2026-11-26 18:20:03 +03:00
ates 7ea4f1f6ca Merge main and address PR #431 review findings
- Replace std::mutex/std::unordered_set + -fexceptions in psm_appnotify.cpp with a Win32 SRWLOCK and HeapAlloc open-addressed token set, keeping -fno-exceptions and reducing both PSM DLLs from ~2.4 MB back to 118 KB.
- Tag state (PSM1) and constrained (PSM2) tokens so cross-family unregisters log foreign_token while duplicate, null, or arbitrary invalid tokens log unknown_token.
- Fix load_bridge to call FreeLibrary on path mismatch or path-query failure without leaking the module handle or reporting a stale GetLastError().
- Verify exact per-(event, detail) JSONL counts inside test_win32_bridge (both with caller-provided BX_LOG_FILE and a self-managed temp log).
- Resolve CHANGELOG.md conflict with origin/main.

Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 18:19:30 +03:00
Ateş bd8edd8f70 Merge pull request #429 from MacosPorters/track-e/419-audio-input
Implement bounded audio queues and GameInput ordinal 1 COM stub
2026-11-26 18:09:00 +03:00
ates 058bc981dc Merge main and address PR #429 review findings
- Reject ApuAlloc before ApuCreateHeap is called and reset used=0 explicitly on heap creation
- Validate max_streams > 0 and record it on DSP connections in XDspConnectWithMaximumStreamLimit
- Expand test_audio_input to cover pre-heap ApuAlloc failure, single-output ApuAlloc, zero max_streams rejection, and GameInput v0 QueryInterface/method dispatch
- Resolve CHANGELOG.md merge conflict with main

Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 18:08:53 +03:00
ates a8c4dbb77e Report sampled CLWB bounds and guest crashes in bx-cli trace
Signed-off-by: ates <ahmetrizaates@hotmail.com>
2026-11-26 18:08:33 +03:00
Ateş d8b83818c1 Merge pull request #430 from MacosPorters/track-a/409-veh-clwb-crash-log
[M1-A2] Cover CLWB addressing and log unhandled guest exceptions
2026-11-26 18:01:49 +03:00