Commit Graph
239 Commits
Author SHA1 Message Date
atharvranjan 522560d0a2 Integrate PR #271 while preserving BetterXen terminology
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 21:48:34 -06:00
atharvranjan d28d539a90 Integrate PR #274 instruction-length fault handling
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 21:46:54 -06:00
atharvranjan 8c4b2344df Integrate PR #272 benchmark comparison mode
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 21:46:50 -06:00
atharvranjan 4652eb08cb Integrate PR #267 with current native runtime
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 21:45:36 -06:00
atharvranjan d1bcd0249d Integrate PR #268 and clarify Win64 shadow-space expectations
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 21:44:49 -06:00
atharvranjan 097bb0b5b8 Merge commit '19f63a0' into integration/pr-284
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 21:43:15 -06:00
atharvranjan 19f63a0985 Merge remote-tracking branch 'origin/main' into integration/pr-270
Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 21:42:09 -06:00
devil8blade f0c61c7a91 loader: copy mid-size TLS templates into the zeroed block (#111)
Templates from 64 KiB up to 1 MiB were staged in a second buffer and
copied again into the thread block. Proving those bytes readable, then
copying them into the block that is already zeroed, avoids that buffer
and still maps nothing when the template cannot be read. Smaller
templates and templates of 1 MiB or more keep the single staged read,
which measured as fast or faster.

Signed-off-by: devil8blade <360741796+devil8blade@users.noreply.github.com>
2026-11-24 21:01:31 -05:00
Ranveer Soni 6fc06dccff Merge branch 'main' into runtime/guest-clock-fixtures 2026-11-25 06:56:20 +05:30
Ranveer Soni a1295d5a48 Merge pull request #331 from zachdoxsee/task/329-gate-a1
loader: add process exit and the Gate A1 compiled C program (#329)
2026-11-25 06:55:50 +05:30
Ranveer Soni 20d7b9ece4 Merge pull request #376 from GDemay/perf/105-contiguous-data-access
loader: avoid resolver allocations in guest data access
2026-11-25 06:46:38 +05:30
zachdoxsee 501117c4d8 Merge upstream main into task/378-fninit
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-25 02:10:46 +01:00
zachdoxsee 66f7127553 Merge upstream main into task/329-gate-a1
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-25 02:10:46 +01:00
Ranveer Soni d8f7f2cb13 Merge pull request #380 from vedantdadhich21/fix/noncanonical-address-gp
fix(loader): raise GP for non-canonical data addresses (#379)
2026-11-25 06:34:40 +05:30
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 26148f49f6 Merge upstream main into task/378-fninit
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-25 01:56:51 +01:00
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
zachdoxsee 9d94c0f40a Merge upstream main into task/329-gate-a1
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-25 01:56:40 +01:00
zachdoxsee 4e18000798 Merge upstream main into task/329-gate-a1
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-25 01:56:31 +01:00
Ranveer Soni 8c188b04c9 Merge pull request #377 from katherinebytes/codex/cpu-differential-corpus
Test 524 seeded x86-64 programs on the interpreter and native DBT
2026-11-25 06:24:35 +05:30
Ranveer Soni 9eb75522f0 Merge pull request #375 from Arths17/test/194-c7-immediate-store
test: add known answers for C6 and C7 immediate stores (#194)
2026-11-25 06:23:04 +05:30
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 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
Bartosz Szczepański 0d6cef6c4e loader: raise #GP for instructions longer than 15 bytes (#384)
The shared decoder already stopped before fetching a 16th byte, but it
reported the instruction as unsupported, so both engines exited with an
illegal instruction. It now returns DecodeError::TooLong, which maps to
ExitReason::GeneralProtection (Intel SDM Vol. 3A, 7.15). The DBT retries a
block that fails this way one instruction at a time, as it already does for
illegal instructions and fetch faults, so earlier instructions in the block
complete and the fault reports the overlong instruction's RIP.

The known answer recorded as a defect by #155 is enabled, with three more
cases, and two page-end tests check that no 16th byte is fetched.

Signed-off-by: Bartosz Szczepański <bartosz.szczepanski@hotmail.com>
2026-11-24 23:16:49 +01:00
Bartosz Szczepański 53e5e38a4e bench: compare two dbt_bench JSON results (#114)
With XENORA_DBT_BENCH_COMPARE=<baseline.json>,<candidate.json> set,
dbt_bench reads two documents written through XENORA_DBT_BENCH_JSON and
compares them instead of running. For the interpreter and cold and warm
DBT it prints both medians, the change, and whether the change exceeds
the larger recorded IQR, and it lists changed cold DBT counters.

It refuses, with exit status 1 and the differing field named, to compare
runs whose CPU, OS or architecture differ or are unknown, or whose
workload, sample or warmup counts, debug assertions or build label
differ. The new optional XENORA_DBT_BENCH_BUILD_LABEL records build
settings the benchmark cannot observe, such as LTO; version 1 documents
without it count as unlabelled.

The documents are read by a small RFC 8259 reader in the bench file, so
no dependency is added. Unit tests cover the reader, reading back an
exported document, the report lines, and every refusal rule.

Signed-off-by: Bartosz Szczepański <bartosz.szczepanski@hotmail.com>
2026-11-24 23:08:04 +01:00
zachdoxsee 47a819e05b loader: add FNINIT and the x87 control, status and tag words (#378)
The decoder refused FNINIT (DB E3), which the mingw-w64 C runtime runs
once before main. Guest state gains the x87 control, status and tag
words, and FNINIT sets them to the Intel SDM values 037F, 0 and FFFF.
Both engines run the shared semantics.

The registry gains a form key, rm, that pins a register-only form to one
ModRM byte: the other bytes of DB /4 are different instructions. No other
x87 instruction is added and CPUID still reports no FPU.

Part of Gate A2.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 23:01:33 +01:00
Guillaume Demay 7d28fc89de loader: avoid resolver allocations for contiguous data access
Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
2026-11-24 22:56:32 +01:00
Vedant Dadhich 9a29bd9c37 fix(loader): raise GP for non-canonical data addresses
Check canonical 48-bit address ranges in shared interpreter accesses, 16-byte SIMD paths, and every native DBT memory helper. Enable and expand the architectural known-answer group across operand widths, vector accesses, segment-base wrapping, boundary crossings, and valid canonical endpoints.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
2026-11-25 03:21:14 +05:30
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 652c6ae02f Merge upstream main into the C6/C7 immediate-store tests branch
Conflict in CHANGELOG.md only: both new entries are kept.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 22:24:27 +01:00
zachdoxsee 0529c62226 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:24:13 +01:00
zachdoxsee e6fa931264 Merge upstream main into task/329-gate-a1
Any conflict was in CHANGELOG.md, where every entry is kept.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 22:24:13 +01:00
Zach Doxsee 3b47c21bb0 Merge pull request #348 from 1Bartosz/cpu/195-adc-sbb-dbt
loader: run ADC and SBB register and immediate forms natively in the DBT (#195)
2026-11-24 22:20:44 +01:00
Arthur Lacoste af1b84ad75 loader: fix needless_range_loop in Win64 ABI tests (#201)
Address review feedback from zachdoxsee on PR #369: replace index-only XMM range loops with iterator-based loops so strict clippy passes on Rust 1.100.

Signed-off-by: Arthur Lacoste <arthurlacoste@users.noreply.github.com>
2026-11-24 22:14:29 +01:00
Arthur Lacoste cf438e25aa Merge remote-tracking branch 'origin/main' into runtime/win64-service-abi-201
# Conflicts:
#	CHANGELOG.md
2026-11-24 22:13:14 +01:00
katherinebytes bd46504a97 Add a seeded CPU differential corpus
Signed-off-by: katherinebytes <rebooteduck+kr@gmail.com>
2026-11-24 21:11:03 +00: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
zachdoxsee 04ee981103 Merge upstream main into task/329-gate-a1
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
Zach Doxsee bbc84c0da0 Merge pull request #373 from 1Bartosz/bench/112-json-export
bench: export dbt_bench results as JSON (#112)
2026-11-24 21:57:25 +01:00
Bartosz Szczepański d2f77cdea3 Merge upstream main into cpu/195-adc-sbb-dbt
Signed-off-by: Bartosz Szczepański <bartosz.szczepanski@hotmail.com>
2026-11-24 21:55:01 +01:00
Zach Doxsee 147e2a9f1a Merge pull request #372 from GDemay/perf/104-allocation-free-fetch
loader: avoid allocations when fetching instruction bytes
2026-11-24 21:53:30 +01: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
zachdoxsee 35de41bd5f Merge upstream main into task/329-gate-a1
Conflict in CHANGELOG.md only: every entry is kept.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 21:43:49 +01:00
Zach Doxsee e6b657a2e9 Merge pull request #341 from sahib453/task/175-page-boundary-faults
loader: report the first inaccessible byte of a page-crossing guest fault (#175)
2026-11-24 21:43:08 +01:00
atharvranjan 6bac25f099 test: add known answers for C6 and C7 immediate stores (#194)
Covers byte to qword widths, SIB and displacement forms, imm32 sign extension, register forms and store faults. Both engines already agree.

Signed-off-by: Arths17 <Atharvranjan8@gmail.com>
2026-11-24 14:35:48 -06:00
plokhi d35c278284 Clarify ARM64 encoding audit coverage
Signed-off-by: plokhi <37208555+Plokhi@users.noreply.github.com>
2026-11-24 21:33:37 +01:00
Bartosz Szczepański 061c28b405 bench: export dbt_bench results as JSON (#112)
dbt_bench printed its results only as text. With
XENORA_DBT_BENCH_JSON=<path> set it now also writes one JSON document:
host CPU, OS and architecture, git revision and dirty state, debug
assertions, the workload and sample counts, median, min, max, p95, p99,
IQR and MIPS for the interpreter and cold and warm DBT, and the cold
DBT counters. Values the benchmark cannot determine are null.

The statistics are computed once in a Summary that feeds both the text
line and the JSON, so the two cannot disagree. The text output and the
timed work are unchanged, and no dependency is added.

Unit tests cover string escaping, null handling, the whole document for
fixed inputs and the text line format.

Signed-off-by: Bartosz Szczepański <bartosz.szczepanski@hotmail.com>
2026-11-24 21:22:58 +01:00
zachdoxsee 3b52215a30 Merge upstream main into task/175-page-boundary-faults
Conflict in CHANGELOG.md only: both new entries are kept.

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
2026-11-24 21:20:41 +01:00