Commit Graph
232 Commits
Author SHA1 Message Date
Adeeb Rahman cdb43d03b0 Add an API coverage report and fix stale stub metadata
xenora imports coverage lists every standard runtime service by module
and status and where the import metadata disagrees with the registry.
It found six kernel32 services the metadata still classified as stubs.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:21:43 -05:00
Adeeb Rahman 9f472c9115 Add C++ type_info helpers to vcruntime140
__std_type_info_compare, __std_type_info_hash, __std_type_info_name and
__std_type_info_destroy_list compare and hash by decorated name and
undecorate plain class, struct, union and enum names. Decorations they
do not model stop the guest instead of returning a wrong name.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:19:23 -05:00
Adeeb Rahman 626de36f39 Add XInput controller services with a simulated source
XInputGetState, XInputSetState, XInputGetCapabilities and XInputEnable
on xinput1_4.dll, reachable from xinput1_3.dll and xinput9_1_0.dll.
Readings come from a host-connected ControllerSource; without one,
every slot reports ERROR_DEVICE_NOT_CONNECTED.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:16:39 -05:00
Adeeb Rahman 1fdefc7250 Add ioctlsocket FIONREAD and FIONBIO for loopback sockets
FIONREAD reports unread stream bytes or the size of the next datagram.
FIONBIO accepts non-blocking mode; blocking mode returns WSAEOPNOTSUPP
because loopback sockets never block.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:57:02 -05:00
Adeeb Rahman 16e0ff446a Add process-local Winsock TCP loopback
Stream sockets listen, accept and connect between guest sockets on
127.0.0.1 inside the runtime; no host socket is opened. Each socket
buffers up to 64 KiB, send takes what fits, recv returns 0 at end of
file after shutdown(SD_SEND) or closesocket, and sending to a closed
peer reports WSAECONNRESET. WSAPoll reports listen-queue readiness,
write space and POLLHUP. TCP and UDP ports are separate namespaces.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:54:04 -05:00
Adeeb Rahman 9a7ae95f61 Record PR push, CI and MoveFileExW in the runtime handoff
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:47:37 -05:00
Adeeb Rahman 6229447a6a Add MoveFileExW with replace and write-through on both drives
MoveFileExW accepts MOVEFILE_REPLACE_EXISTING, MOVEFILE_WRITE_THROUGH
and MOVEFILE_COPY_ALLOWED. A closed file may atomically replace another
closed file on a host mount or the synthetic C: drive; directories are
never replaced, and open files can neither move nor be replaced. Write
through flushes both host directories. Moves between drives report
ERROR_NOT_SAME_DEVICE, or ERROR_NOT_SUPPORTED when a copy is allowed.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:47:18 -05:00
Adeeb Rahman 7bb47989e5 Rename files and directories within writable host mounts
MoveFileW now renames closed files and directories inside one writable
host mount using an exclusive host rename (renameatx_np RENAME_EXCL on
macOS, renameat2 RENAME_NOREPLACE on Linux), so an existing name is
never replaced. A change of case alone renames in place. Open files,
read-only mounts, the mount root and moves between drives fail with
explicit Win32 errors.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:38:16 -05:00
Adeeb Rahman b1b6629f8b Update system-runtime handoff after upstream sync and mount quota
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:33:49 -05:00
Adeeb Rahman 30cf55e753 Bound net growth of writable host mounts with an optional quota
HostMount::with_quota limits the net bytes and the number of files and
directories guest operations add to a writable mount. Win32 writes,
extending SetEndOfFile, CreateFileW, CreateDirectoryW, GetTempFileNameW
and CRT fopen/fclose are charged; deletion and shrinking give the
amount back, never below zero. Exceeding a limit fails with
ERROR_DISK_FULL (CRT ENOSPC) and leaves the host unchanged.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:33:49 -05:00
Adeeb Rahman bbfe9027a9 Honor timestamp suppression on synthetic guest file handles
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 16:00:28 -05:00
Adeeb Rahman b031640fef Advance synthetic file timestamps using the guest clock
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:59:03 -05:00
Adeeb Rahman 6dc241323b Track explicit timestamps on synthetic guest files
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:57:53 -05:00
Adeeb Rahman cda25954fa Update mounted file timestamps through guest handles
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:56:26 -05:00
Adeeb Rahman c4a2b53ac4 Read Win32 file timestamps from open guest handles
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:55:12 -05:00
Adeeb Rahman 7b0255b4df Merge remote-tracking branch 'origin/main' into feat/system-runtime-expansion
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>

# Conflicts:
#	CHANGELOG.md
2026-11-24 15:54:37 -05:00
Adeeb Rahman da9f2c0035 Expose mounted file timestamps to Win32 guests
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:53:55 -05:00
Zach Doxsee 3a36379db4 Merge pull request #342 from Swastickc/qa/cpu-test-selection-159
qa: measure CPU test runtime and add deterministic test-target shards (#159)
2026-11-24 21:53:45 +01:00
Adeeb Rahman b15226efe9 Return extended Win32 path metadata
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:52:08 -05:00
Adeeb Rahman 0fdd33a440 Flush writable guest file handles
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:48:41 -05:00
Adeeb Rahman ef5337557f Support ASCII Win32 file creation and open
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:47:18 -05:00
Adeeb Rahman f21d8ea1be Create guest temporary files on explicit host mounts
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:43:10 -05:00
Adeeb Rahman 941ac8cf2e Create temporary files on the synthetic guest drive
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:41:41 -05:00
Adeeb Rahman db20a1870f Expose guest-scoped Win32 temporary directory lookup
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:39:40 -05:00
Adeeb Rahman c45e11d5af Report host directory creation collisions consistently
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:37:28 -05:00
Adeeb Rahman 96bbfcb883 Merge remote-tracking branch 'origin/main' into feat/system-runtime-expansion
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>

# Conflicts:
#	CHANGELOG.md
2026-11-24 15:15:08 -05:00
Zach Doxsee a7e3e1e42c Merge pull request #358 from sahib453/task/199-fences
loader: accept MFENCE, LFENCE and SFENCE and document guest memory ordering (#199)
2026-11-24 21:14:51 +01:00
Adeeb Rahman d0f199b0e8 Merge remote-tracking branch 'origin/main' into feat/system-runtime-expansion
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>

# Conflicts:
#	CHANGELOG.md
2026-11-24 15:10:54 -05:00
Zach Doxsee 7dd1329866 Merge pull request #367 from jelly013/probe-default-folder
cli: use a neutral default folder for probe reports (#364)
2026-11-24 21:07:02 +01:00
Adeeb RahmanandCursor c789dc6fd0 Merge upstream main 3c8b6ba into system runtime branch
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-24 15:04:03 -05:00
Adeeb RahmanandCursor 05135df227 Refresh handoff tip commit after publishing the brief.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-24 15:03:09 -05:00
Adeeb RahmanandCursor 36f9b1c4ba Document system-runtime handoff for the next agent.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-24 15:02:57 -05:00
Adeeb Rahman 8a677bc265 Drop dead AT_EMPTY_PATH unlink and document name-based remove limits.
Linux unlinkat rejects AT_EMPTY_PATH, and macOS never compiled that path,
so every remove was already name-based. State the in-mount TOCTOU plainly.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 15:00:57 -05:00
zachdoxsee c9505e53e2 Merge upstream main into task/199-fences
Conflicts: CHANGELOG.md, where both entries are kept; the generated
crates/loader/src/x86_table.rs, rebuilt with generate_x86.py from the
merged instructions.toml; and one sentence of
docs/cpu/instruction-registry.md, where the list of rejected
instructions now drops both RCL/RCR (from #351) and the fences.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 20:54:40 +01:00
zachdoxsee b1b57cf16a Merge upstream main into task/128-exact-unmasked-overflow
Conflict in CHANGELOG.md only: both new entries are kept.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 20:40:31 +01:00
Zach Doxsee cdcc55c33e Merge pull request #351 from sahib453/task/121-rcl-rcr
loader: add RCL and RCR, the rotates through carry (#121)
2026-11-24 20:39:46 +01:00
jelly013 e5aca73c55 cli: use a neutral default folder for probe reports
`xenora probe` and `xenora imports sync` defaulted to a folder named after
one commercial game. Give both one shared default, `diagnostics/probe`, and
ignore it in Git. Keep the old ignore rules so existing local reports stay
out of commits.

Closes #364

Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com>
2026-11-24 20:31:13 +01:00
sahib453 94783fa603 docs: take the fences off the rejected-on-purpose list (#199)
The instruction registry document listed fences among the forms
rejected on purpose. This branch accepts them and explains why in the
new memory-ordering section, so the list no longer names them.

Signed-off-by: sahib453 <117431595+sahib453@users.noreply.github.com>
2026-11-25 00:44:40 +05:30
sahib453 c1cea65e17 docs: take RCL and RCR off the rejected-on-purpose list (#121)
The instruction registry document listed RCL and RCR among the forms
rejected on purpose. This branch implements them, so the list no longer
names them. SHLD and SHRD stay on it.

Signed-off-by: sahib453 <117431595+sahib453@users.noreply.github.com>
2026-11-25 00:44:28 +05:30
sahib453 d195978903 loader: accept MFENCE, LFENCE and SFENCE and document guest memory ordering (#199)
Both engines refused the three fences as illegal instructions, and no
document said what ordering guest memory accesses have.

- instructions.toml, x86_table.rs (generated): the register forms of
  0F AE digits 5, 6 and 7. The memory forms stay undeclared.
- x86_exec.rs: a fence changes nothing. Each engine runs one guest
  instruction at a time on one host thread and completes its loads and
  stores before the next, so accesses are already totally ordered.
- docs/cpu/instruction-registry.md: states that ordering, why the
  fences are no-ops under it, and that it holds only while guest
  threads do not run on several host threads.
- Tests: five single-thread known-answer cases, three assembled
  fixtures, two rejected memory forms, and MASKMOVDQU as the refused
  SSE2 instruction in cpu_features.rs now that MFENCE runs.

No multi-thread behaviour is established.

Signed-off-by: sahib453 <117431595+sahib453@users.noreply.github.com>
2026-11-25 00:25:27 +05:30
sahib453 403a67747f loader: set only the overflow flag for an exact unmasked overflow (#128)
With the overflow exception unmasked, an overflow whose result is exact
before the exponent is bounded set the MXCSR precision flag as well as
the overflow flag. The Intel SDM (Vol. 1, D.4.2.3, Table D-16) reports
precision there only if rounding with an unbounded exponent is inexact.

- softfloat.rs: Control reads the overflow mask, and round() reports
  precision on an unmasked overflow only when the result was rounded.
  The masked response is unchanged.
- cpu_known_answers.rs: the five exact-overflow cases are no longer an
  ignored defect, three more cover the other rounding modes, and the
  scalar and conversion sweeps now compare the precision flag here.
- docs/cpu/instruction-registry.md: the behaviour is no longer listed
  as unasserted.

Signed-off-by: sahib453 <117431595+sahib453@users.noreply.github.com>
2026-11-24 23:25:07 +05:30
Vedant Dadhich dc3b02b62f Merge latest main into docs/gfx1030-form-acceptance
# Conflicts:
#	CHANGELOG.md
2026-11-24 23:14:13 +05:30
Vedant Dadhich d847d7ea6e Docs: clarify gfx1030 acceptance terminology
Address review feedback: introduce AMD RDNA2 desktop GPU (gfx1030) before the internal codename, define the LLVM three-way decoder check, document the Apple M5 status spelling, use GitHub logins in acceptance records, and mark the independence rule as proposed pending maintainer confirmation.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
2026-11-24 23:11:55 +05:30
Swastickc b9372408c8 qa: measure CPU test runtime and add deterministic test-target shards (#159)
Add scripts/cpu-tests.sh, which lists the default-feature workspace test
targets, runs shard K of N of them in a fixed round-robin order, and checks
that N shards cover every target exactly once. It fails when Cargo cannot
build the workspace instead of running a partial list. The full gate
(cargo test --locked --workspace) and scripts/test-gpu.sh are unchanged.

Record the measured gate cost and the selected-versus-full comparison in
docs/testing/cpu-coverage.md, index it in docs/README.md, and add a
changelog entry.

Signed-off-by: Swastickc <28708247+Swastickc@users.noreply.github.com>
2026-11-24 23:11:18 +05:30
elforeign 0fdb995892 isa, decoder, shader, ref: VOP3A encodings of eleven VOP2 integer forms and the sixteen integer compares (#215) (#311)
* isa, decoder: VOP3 encodings of the eleven registry VOP2 integer forms (#215)

Eleven [[encoding_variant]] entries re-encode the VOP2 integer forms as
VOP3A (_e64) under operand rule vop3_vgpr2: two VGPR sources, no
modifiers, SRC2 the unused inline zero. Opcodes from the pinned XML,
checked against llvm-mc. Decoder known words and per-bit rejections.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* fixtures, decoder, shader: LLVM-assembled fixture and goldens for the eleven VOP3 VOP2 variants (#215)

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* ref, validation: independent guide-derived oracle for VOP3 integer VOP2 forms and Wave32 VOP3 compares (#215)

crates/ref and tests/validation/independent_ref.rs decode and run the eleven
VOP3A (_e64) integer VOP2 forms and the sixteen V_CMP_*_{I32,U32}_e64 compares
writing a 32-bit lane mask to one SGPR (s0-s105) or vcc_lo, derived from the
AMD RDNA 2 guide only. New suites vop3_integer.rs and vop3_compare.rs, with
ignored native Metal parts.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* isa, decoder, shader: add VOP3A encodings for the sixteen integer compares (#215)

Sixteen gfx1030 Wave32 integer compares gain their VOP3A (_e64) encoding
as registry variants, with an explicit SGPR mask destination (guide 3.9,
13.3.3; pinned XML OPR_SREG), VCCZ branching through vcc_lo and
translation errors for reads of runtime-only SGPR results.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* fixtures, shader, validation: VOP3A compare fixture and native Metal runs (#215)

A fixture with all sixteen VOP3A integer compares (vcc_lo destination,
runtime s_cbranch_vccz) ties the new variants to fixture coverage, with
IR and MSL goldens. The VOP3 integer and compare Metal oracles now run in
the GPU gate: the translator they waited for is in this branch.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* changelog: VOP3A integer and compare encodings (#215)

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* shader, fixtures, docs: e64 compare names in the IR; status rows for the 27 VOP3A forms (#215)

The IR names a VOP3A compare by its _e64 mnemonic and prints its SGPR
destination; VOPC output is unchanged. The compare fixture now uses a
mid-range second source (so swapped unsigned opcodes change the golden)
and one plain SGPR destination. docs/status.toml and the rendered
instruction table list the 27 new forms.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* docs: use a recognized lowering phrase for the VOP3A integer rows (#215)

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* isa: VOP3A variants exist only for the 32-bit VOPC compares (#215)

After main gained the 16-bit compares (#327), the dispatch test expected a
VOP3A encoding for every non-64-bit compare. Only the 32-bit ones have one.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

---------

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 11:38:44 -06:00
Vedant Dadhich b55a4c24ef Merge main into docs/gfx1030-form-acceptance
# Conflicts:
#	CHANGELOG.md
2026-11-24 23:08:10 +05:30
Adeeb Rahman 550b2cec5f Merge upstream main d7f7d58 into system runtime branch
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 12:29:00 -05:00
Adeeb Rahman 680f572af4 Expand CRT I/O, env, time, rand and Winsock UDP helpers.
Mount-backed fopen, atoi/_putenv/time/rand/_stricmp, synthetic
GetModuleFileName paths, and sendto/recvfrom for the loopback stack.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 12:26:04 -05:00
elforeign d7f7d586d3 gpu: bind a texture and sampler to guest draws through descriptor tables (#303) (#336)
* gpu: bind a texture and sampler to guest draws through descriptor tables (#303)

A guest command list had no way to bind a texture: GraphicsCommand stopped
at vertex and index buffers. This adds the smallest D3D12-shaped binding the
translated image_sample_lz pixel stage needs: shader-visible CBV_SRV_UAV and
sampler heaps, CreateShaderResourceView for one-level RGBA8 and BC1 2D
textures, a point/clamp CreateSampler, a root signature with one pixel-stage
SRV table and one sampler table, and SetDescriptorHeaps and
SetGraphicsRootDescriptorTable. Everything else fails explicitly before any
draw.

The native path hands the bound level to a textured backend.
NativeCompute::render_rgba8_sampled_bc1 binds a BC1 level natively to
fragment texture 0 and sampler 0. The software reference point-samples with
clamp addressing.

BC1 fixtures use only endpoint colours. Apple's hardware decoder gives
171/84 for the interpolated palette entries where the spec-exact decoder
gives 170/85.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* gpu: tighten guest texture binding after independent review (#303)

The independent review found binding rules that diverged from D3D12:
changing descriptor heaps kept tables bound in the old heaps, setting the
same root signature again cleared its tables, and unsupported draw shapes
were drawn as one triangle. Now heap changes and a different root signature
invalidate tables, while redundant sets keep them. Table bases are checked
against the bound heap of their type when bound. Textured draws other than
one instance of three vertices fail, and zero vertices or instances draw
nothing.

Descriptor handle offsets can no longer carry into another heap's ID. SRVs
of array or multi-level textures are rejected. A texture whose state
excludes pixel-shader reads is not sampled. Vertex buffer offsets are
overflow-checked. The tests now cover swapped root parameters, a second
sampler slot, off-centre and out-of-range coordinates, state transitions,
draw shapes and resource bounds.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* loader: format the guest texture test (#303)

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

* gpu: close the review's remaining texture-binding gaps (#303)

The re-review found three partial fixes. The public software reference
could overflow on a huge viewport. A texture in a combined write and read
state could be sampled. The sampler-slot test used two identical filled
slots. The viewport is now bounded to 4096 pixels. A sampled texture must be
COMMON or a read-only state that includes PIXEL_SHADER_RESOURCE. The sampler
heap now leaves its middle slot empty. The docs now state the start-instance
rule and when table bases are checked.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>

---------

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 11:21:03 -06:00
Vedant Dadhich 291c9807ee Docs: define gfx1030 form acceptance
Add the promotion rule for moving desktop gfx1030 forms from local CPU and Metal results to fixture verified. The rule records clean-commit evidence, independent-runner requirements, exact commands, raw-log location, review-log summaries, failure handling and status regeneration. This is documentation only: no status rows, tests or fixtures change. Part of #302.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
2026-11-24 22:24:18 +05:30