Commit Graph
260 Commits
Author SHA1 Message Date
Adeeb Rahman c4428d13a0 Merge origin/main into feat/system-runtime-expansion
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 20:05:53 -05:00
Adeeb Rahman 6eb35222d8 Add CRT character and line stdio and fflush
fputc, putc, fputs, puts, fgetc, getc and fflush now run as runtime
services on the shared fopen stream state. fflush writes host-backed
streams to their mount before fclose. The import metadata classified
these as native libc calls although they take guest FILE cookies.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 20:05:34 -05:00
Ranveer Soni 042c08c855 Merge pull request #337 from zachdoxsee/task/333-pe-headers
loader: map the PE headers at the image base (#333)
2026-11-25 06:33:39 +05:30
Ranveer Soni 7e4ccd1e97 Merge pull request #316 from soggyramennoodle/feat/runtime-fuzz-bench
Runtime fuzzing, dispatch benchmarks, CRT string scans and MSVC name decoding
2026-11-25 06:32:53 +05:30
Ranveer Soni 96c772edc5 Merge pull request #398 from maridogolpeador/loader/121-shld-shrd
loader: add SHLD and SHRD, the double-precision shifts (#121)
2026-11-25 06:31:45 +05:30
zachdoxsee 496938aef4 Merge upstream main into task/333-pe-headers
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-25 01:56:51 +01:00
Adeeb Rahman d75ce94da6 Merge remote-tracking branch 'origin/main' into feat/system-runtime-expansion 2026-11-24 19:52:50 -05:00
Adeeb Rahman 5ea41817aa Add bounds-checked CRT string copy and append
strcpy_s, strcat_s, strncpy_s, strncat_s and their wcs forms follow the
documented EINVAL, ERANGE and _TRUNCATE rules. The import metadata had
mapped six of them to unchecked libc functions that ignore the buffer
size; they are now runtime services, and the pipeline test asserts so.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:52:42 -05:00
Adeeb Rahman 4befaaa4b5 Record parked timer work and claimed files in the runtime handoff
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:46:58 -05:00
Adeeb Rahman 4fd1432599 Add GetTimeZoneInformation and GetLogicalProcessorInformation
The guest time zone is UTC with no daylight transition. Processor
topology reports one core per profile processor and one package; no
simulated cache entries are reported.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:41:53 -05:00
Adeeb Rahman 7cb2da51f0 Add IsProcessorFeaturePresent from the guest CPUID table
Each PF_* feature is present only when guest CPUID reports every bit it
depends on, so startup code cannot pick instruction sets the translator
does not advertise. Features without a CPUID test report FALSE.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:38:21 -05:00
Adeeb Rahman 2e8d7faa32 Add UCRT _msize, _recalloc and aligned allocation
_msize, _recalloc, _aligned_malloc, _aligned_realloc, _aligned_msize
and _aligned_free on the CRT heap. Aligned blocks are tracked so double
and mismatched frees stop the guest.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:32:23 -05:00
Adeeb Rahman 112853ff88 Add std::exception message copy and destroy helpers
__std_exception_copy duplicates an owned message on the CRT heap and
shares a borrowed one; __std_exception_destroy frees an owned message
and clears the record.

Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 19:27:26 -05:00
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
maridogolpeador 67023d292b loader: add SHLD and SHRD, the double-precision shifts (#121)
Both engines refused SHLD and SHRD (0F A4/A5, 0F AC/AD) as illegal
instructions. They are now declared in the x86 registry and run on the
shared semantics for 16-, 32- and 64-bit register and memory
destinations, with the count in an 8-bit immediate or in CL.

- instructions.toml, x86_table.rs (generated), generate_x86.py,
  x86_decode.rs: the two operations and two operand encodings,
  rm_reg_imm and rm_reg_cl (ModRM destination, reg source, count).
- x86_exec.rs: the destination is shifted with the vacated bits filled
  from the source register. The count is masked to five bits (six for
  64-bit operands), a masked count of zero changes nothing, CF takes the
  last bit shifted out, ZF/SF/PF follow the result and OF is set only
  for a count of one. A 16-bit count above 16 is undefined in the SDM;
  the flags are kept and no test relies on the result.
- cpu_known_answers.rs: eight SDM-derived cases move from refused to
  verified.
- tests/x86: 72 assembled SHLD and SHRD instructions, with a
  bit-at-a-time reference in x86_integer.rs. A destination the
  reference marks undefined now skips the memory operand check too.
- docs/cpu/instruction-registry.md, CHANGELOG.md.

Nothing is lowered to ARM64.

Signed-off-by: maridogolpeador <354308468+maridogolpeador@users.noreply.github.com>
2026-11-24 20:47:45 -03: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 324eab08c3 Merge remote-tracking branch 'origin/main' into feat/runtime-fuzz-bench
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
2026-11-24 18:32:27 -05:00
jelly013 38359969cd Merge main into phase3b-runtime
Signed-off-by: jelly013 <22855910+jelly013@users.noreply.github.com>
2026-11-24 22:44:09 +01:00
zachdoxsee cc4dd092cf Merge upstream main into task/333-pe-headers
Any conflict was in CHANGELOG.md, where every entry is kept.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 22:01:29 +01: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
zachdoxsee fd0e73bc28 Merge upstream main into task/333-pe-headers
Conflict in CHANGELOG.md only: every entry is kept.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 21:43:49 +01: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