138 Commits

Author SHA1 Message Date
Jeremy
74c2ebdd90 x64: Enable JIT module chaining and v2 regions (#195) 2026-12-04 23:20:05 +01:00
Pooya Parsa
247c4c2bda Merge main into x86-exp 2026-12-03 12:48:23 +00:00
Jeremy
cea476453a x64: Optimize native x86 execution to outperform Box64 (#162)
* kwemu: publish shared code invalidation after stores complete

Close the interval between writeHost notifying about an x86 code page and
the caller changing its bytes. Another CPU can consume that early epoch,
revalidate the old instructions and otherwise keep running the stale
decode after the writer has finished its store.

Keep a pending completion bit in the private SMC state and publish the
shared code epoch again at the instruction boundary. Route reference,
decoded and generic JIT exits through finishSmc in both front ends,
including fault paths and raw-pointer atomic updates. Preserve pending
completion when an instruction also requests local invalidation. The
public ABI and the reference instruction semantics are unchanged.

Add a deterministic two-CPU regression that lets the reader consume the
early notification before the writer performs an aligned atomic store.
It fails with the previous clear-only behavior and passes in native,
Wasm JIT and no-SIMD configurations with completion publication.

Validate the integrated tree on the physical x86-64 host with both normal
and atomics builds: 196 x86 guest comparisons per build, 50 x86 Wasm unit
tests per SIMD configuration, 77 AArch64 oracle comparisons per build,
and 138 AArch64 Wasm unit tests with one expected skip per configuration.
The rebuilt kernel matrix passes 76 of 79 cases, including code-write
coherence and atomic checks; three SMP scheduling-placement assertions
remain unresolved and are not claimed as passing.

* x64: check compatibility code limits before compiled indirect branches

Validate the masked i386 target against the current CS limit before a
compiled indirect jump, call or return can change architectural state.
The previous JIT check returned immediately in compatibility mode even
though the reference and decoded executors reject an out-of-limit target.

Hand the instruction back on a limit violation so the existing executor
constructs the precise fault, including call and return stack ordering.
Keep valid targets compiled and load the descriptor limit at execution
time rather than embedding mutable segment state in a module.

Add reference comparisons for register and memory indirect jumps and
calls and for returns with a target beyond CS.limit. Validate with the
full x86 test suite in normal and atomics builds, including eager Wasm
JIT with SIMD enabled and disabled, and the 196 physical-CPU guest
comparisons per build.

* x64: compile rotations, memory ALU operands and indirect branches

Move 32/64-bit register ROL/ROR, memory-source register ALU operations
and memory-indirect CALL/JMP out of the generic instruction path. Reuse
the decoded operand representation, shared ALU emitter, normal data TLB
checks and precise fault handback. Preserve carry and overflow rules,
zero-count writes, prior flags on load faults, source-register aliases
and call target validation before any stack change.

Add differential coverage for rotation counts and flags, memory ALU
operations, fault ordering and indirect branch source/stack aliases.
Keep the reference executor and all existing guest tests. Add a unit-only
x86 build step while retaining those units in the full test-x64 step.

Expose x86 generic encoding families and decoded operation counts only
in statistics builds, account for compiled retirements and handbacks,
and preserve Wasm function names for CPU profiles. Add interleaved,
physical-output-checked CPU and same-kernel Box64 benchmark drivers,
verified disposable runtime/input preparation, and a measurement report.
Retain invalid outputs and timeouts rather than counting them as wins.

Five rotated CPU-harness rounds on the physical x86-64 host reduce x64
SHA JIT median time from 561.34 to 31.69 ms and the interpreter workload
from 665.49 to 253.73 ms. i386 also improves on those workloads. Record
the short fib and i386 FP slowdowns explicitly. CoreMark profiling still
finds substantial byte/word ALU and memory-immediate generic execution;
scalar FP also remains expensive. The full application comparison is
still running and the target of beating Box64 everywhere is not met.

Validate normal and atomics x86 suites, AArch64 regression suites,
physical VEX and XED dispatch audits, four shadow-stack configurations,
kernel patch/bundle checks, amd64 Alpine SSH/Python and the constrained
API matrix. Preserve the documented SMP scheduler-placement failures,
default-concurrency API timing failures, incomplete application results
and physical AArch64/browser verification limits.

* x64: validate canonical addresses on shared data TLB hits

Keep a translation cached by an AArch64 task from bypassing x86 address
validation. The ISA-neutral MMU accepts the low 48-bit address space,
including addresses with bit 47 set that are noncanonical in x86 mode.
A compiled x86 access previously trusted a warm data TLB entry for such
an address and could load, store or branch instead of raising GP or SS.

Add an optional ISA hook to the shared JIT TLB check. The x86 hook sends
addresses above the low canonical half back to the existing executor,
which preserves segment selection, exception priority and precise state.
Canonical negative addresses retain the MMU's page-fault behavior through
the same handback. AArch64 emits no additional check and the shared MMU
address space and public ABI remain unchanged.

Add warm-TLB reference comparisons for scalar and vector loads/stores,
memory ALU, indirect calls/jumps, push/pop and return, including stack
segment addressing. Disabling the hook makes the regression fail in
both SIMD and no-SIMD Wasm JIT runs; enabling it passes the integrated
53-test suites in both configurations, including existing fault-priority,
segment, debug-state and randomized instruction regressions.

* x64: compile byte and word register arithmetic with precise lazy flags

Extend the existing ALU and TEST decoded operations to 8/16-bit register,
accumulator and immediate forms, including sign-extended group immediates.
Preserve unrelated register bits and distinguish AH..BH from the REX byte
registers in operand reads, writeback and register-use accounting.

Track lazy add, subtract and logic flags at the operand's actual width.
Keep parity and auxiliary carry unshifted, derive signed conditions with
the correct sign extension, and preserve carry through ADC/SBB chains.
Retain the same reference instruction executor and precise stop behavior.

Add differential matrices over edge values, operand directions, partial
register aliases, immediate encodings and all condition codes. Assert that
the tested encodings actually decode into the new execution paths. Keep
the existing randomized regressions, which also caught a signed-condition
emission error during implementation.

Five interleaved rounds against the preceding optimized executor reduce
CoreMark 3000 from 7413.53 to 3409.09 ms and i386 SHA from 166.71 to
140.69 ms. This comparison also includes the shared-TLB address correction.
Record the x64 memory and longer x64/i386 fib regressions explicitly;
address-check and generated-code costs still need investigation, and the
Box64 acceptance target remains unmet.

Validate full normal and atomics x86 builds with 196 physical guest
comparisons each and 53 Wasm JIT units in both SIMD configurations.
Re-run both AArch64 builds: 77 oracle comparisons each, 138 passing JIT
units with one expected skip per configuration, plus native/fuzz checks.
Final rebuilt-kernel and corrected application comparisons remain pending.

* test: validate benchmark chroots before comparing Box64

Bind the guest proc, sys and device filesystems into each disposable
application root. Check process maps, CPU topology, /dev/null and lscpu
before timing. Missing mounts previously prevented Box64 CPU discovery;
reject that preliminary application's timings and failures explicitly.

Retain guest signals and execution errors alongside exit status and
output hashes, and record host JIT counters for every sample. Reject a
sample with a signal, execution error or failed JIT compilation. Verify
OCI configuration size as well as its digest before accepting an image.

Validate CPU discovery in both roots across three boots. Python startup
runs correctly under the native front end and both Box64 releases. Node
startup runs natively; all four Box64 configurations still abort after
calling a null target, with guest SIGABRT retained in the diagnostic
report and zero host JIT failures. These failures are compatibility
results and cannot be counted as performance wins. Recheck the pinned
Python image configuration and the benchmark driver's syntax.

* x64: compile scalar SSE arithmetic with exact MXCSR guards

Add decoded scalar SSE and AVX register moves and arithmetic, legacy
memory arithmetic, and scalar loads and stores. Preserve lane merges,
upper YMM zeroing, fault priority and unmasked exceptions through the
existing reference executor and exact floating-point helpers. Adapt the
initial scalar design and edge-value guest from Gabriel Pérez's upstream
PR #113, retaining its copyright notices:
https://github.com/pithings/unkernel/pull/113

Compile arithmetic only under default controls, non-denormal inputs and
safe result ranges. When PE is clear, prove exactness using TwoSum,
significand predicates or exact binary64 products before writing back.
Do not manufacture sticky flags or change the reference executor. Cache
unchanged MXCSR controls within each member, invalidate after unknown
helpers, and keep the cache separate from SIMD scratch locals.

Keep vector execution out of the central decoded dispatch frame. V8
profiles exposed larger frames and integer throughput regressions when
scalar/vector temporaries were inlined there. Centralize precise generic
execution so unmasked scalar operations retain the same stop handling.
Add optional FP operation/MXCSR counters without changing the public ABI.

Add 393,216 randomized single-operation result and MXCSR comparisons per
guest mode, retaining the edge, rounding and merge matrices. Extend JIT
differentials for exceptional controls, precise memory faults, warmed
noncanonical translations and LDMXCSR helper invalidation. Removing that
invalidation makes its regression fail; restoring it passes.

Five interleaved rounds reduce x64 FP from 214.47 to 20.09 ms with the
JIT and from 237.24 to 43.41 ms decoded before control caching. The cache
reduces a longer FP JIT run from 84.26 to 82.09 ms. Record integer JIT
and i386 FP timing regressions rather than claiming every path improves;
portable i386 FP still uses x87. The Box64 acceptance target remains unmet.

Validate both normal and atomics builds: 210 x86 physical comparisons
and 56 JIT units per SIMD configuration; 77 AArch64 oracle comparisons
and 138 JIT units with one expected skip per configuration. Regenerate
62,914,560 XED probes and recheck 194,147 representatives and 50,688 VEX
combinations with zero classification errors. The rebuilt kernel passes
77/79 cases, with two unresolved wakeup-placement assertions retained.
Remaining integration reruns and corrected full application measurements
are explicitly outstanding in the performance report.

* test: retain host JIT failures in application benchmark reports

Record host warnings, per-sample starting JIT counters and the existing
ending counters. Keep the strict zero-failure boot requirement, output
checks and signal handling unchanged. Capture the starting statistics
outside the timed interval so diagnosis adds no measured setup work.

Add an optional Node diagnostic preload that retains failed synchronous
Wasm modules and their original errors. Use a constructor proxy to keep
module prototypes and instanceof checks compatible with async compilation,
and preserve exact input-view bounds and the original thrown error.
Keep its artifacts separate from accepted performance measurements.

Retain the interrupted application run where Box64 sort produced correct
output but the host JIT failure count increased. Do not count that run as
accepted performance evidence. Six diagnostic boots produce 240 correct
samples without reproducing the failure; CPU validation ran concurrently,
so their timings are excluded and the rare failure remains unresolved.

Update the report with the complete rotated scalar CPU measurements and
completed API, Alpine, patch and stack checks. Preserve both the earlier
timing regressions and the later observations, the kernel's two failed
wakeup-placement assertions, and the SMP JIT stack audit's early stop.

Check benchmark syntax remotely. Verify failure capture with an invalid
Wasm view, exact saved bytes and the original CompileError, and verify
successful synchronous and asynchronous module construction and imports.

* x64: compile memory arithmetic with precise write fault reporting

Add unlocked memory-destination ALU and TEST operations at every integer
width, with register and immediate sources. Extend memory-source register
arithmetic to bytes and words, including high-byte and REX aliases. Keep
one 16-byte operation per instruction by packing raw displacement and
immediate fields and reconstructing relative addresses when needed.

Reuse the existing ALU flag emitter with a temporary value destination.
Complete read and write checks before updating architectural state, retain
read-only CMP/TEST behavior, and keep operands outside segment-check
scratch locals. Preserve the MMU, canonical checks, partial registers,
completed code-store publication and existing locked execution paths.

Correct an existing reference fault-classification error exposed by the
new tests. A read phase of ALU read-modify-write must report a write page
fault. Retain its original address, validation order, register state and
retirement behavior while correcting the access metadata in the reference
and decoded executors, including split-page locked ALU fallback reads.
The physical CPU reports error code 6 where the old kernel reported 4.

Add differential matrices for every width, carry, partial alias, immediate
form, relative address and memory fault, and regressions for current-block
code writes and cached targets. Extend physical integer and kernel fault
guests without removing existing cases. Keep raw coincident PF/AC results
on stderr and check architecture-defined invariants across processors;
separate tier/JIT tests require the reference's exact exception choice.

The new write-access assertion fails before the fault correction in both
SIMD configurations. Afterward both normal and atomics builds pass 210
physical comparisons and 61 JIT units per SIMD configuration. Both A64
builds pass 77 guest comparisons and 138 JIT units with one expected skip
per configuration. Rebuilt kernels pass all 79 matrix cases, stronger
physical fault comparisons, and all four complete shadow-stack audits.
Retain the preceding matrices' intermittent placement failures in the
report; this passing run does not establish their cause.

A CoreMark statistics/profile run reduces generic executions from
36,095,145 to 9,466,328, with 6,131,951 remaining byte SHR operations.
Keep those counts separate from timings: application diagnostics ran
concurrently, so an isolated speed comparison remains outstanding and
the Box64 acceptance target is not yet met.

* kwemu: retain ISA identity when joining and rebuilding JIT regions

Tag each region with its front end in unused page metadata bits. Require
that identity when joining a page region or growing along compiled exits.
A64 and x86 tasks can share a virtual code page, and their blocks can
occupy any cache set at different PCs even though same-PC keys differ.

Reject a reused guest block slot belonging to the other front end before
reading its decoded ops. An evicted guest's copy can remain in a region
whose live home members still keep it installed. A later rebuild must not
interpret the replacement's fields through the original ISA's op layout.
Keep cache sizes, the public ABI and execution-time op checks unchanged.

Add shared-core differentials for both ISA orders on one page and for an
A64 region guest replaced by x86 code before rebuilding. The first fails
without region tagging. Keeping tags but removing the reused-slot check
makes the second fail in both SIMD configurations with a mixed region.
Restoring both passes 140 A64 Wasm units and one expected skip per SIMD
configuration, including atomics, with no host failures or module leaks.
Expose the existing A64 unit checks as a separate build step without
removing any checks from the full test target.

A 660-sample application diagnostic captures eight malformed-module host
warnings across five of six boots, including impossible local counts and
integer instructions reading SIMD locals. Document the incompatible A64
maddl and x86 vec_op handler layouts behind these failures. Retain the
failed modules and exclude every diagnostic timing from acceptance.

Both normal and atomics builds pass 77 A64 oracle comparisons and 210 x86
physical comparisons each. Rebuilt UP and SMP kernels pass all 79 matrix
cases. Regenerated XED representatives and physical VEX encodings have
zero classification mismatches. A fresh application comparison remains
outstanding; this correction does not establish the Box64 speed target.

* kernel: retain function names while stripping DWARF during lowering

Discard DWARF before Binaryen lowers memory64 and table64, while keeping
the name section for traps and CPU profiles. The statistics library from
Zig 0.16 contains DW_LNE_define_file line programs that Binaryen 133
cannot parse when preserving DWARF. Keep the original memory64 kernel
and its debugging information unchanged.

The statistics kernel reproduces the parser failure before this change
and builds and bundles successfully afterward. Compare the normal UP and
SMP lowered kernels with the new option: both remain byte-identical.
Check the build script's shell syntax and document which debugging
information each output retains.

* test: capture per-process CPU profiles and reject diagnostic timings

Allow an application specification to select a CPU-profile directory.
Start and stop Node's inspector around each guest execution, retain the
profile path and copy available kwemu counters before and after it.
Keep the existing output, signal, panic and cumulative JIT checks intact.

Mark profiled reports and reports with observed kwemu instrumentation as
ineligible for timing comparisons. Print DIAGNOSTIC instead of medians
while preserving raw execution data and correctness results. Disconnect
the inspector and retain the report on failure as well as completion.
Document profiling separately from acceptance measurements.

Check syntax and exercise three boots with first and later executions:
six profiled samples retain readable CPU profiles and valid output while
rejecting timing acceptance; six unprofiled control samples remain
eligible. A statistics kernel without an inspector also rejects all six
timings and retains its counters. Verify that counters become available
only after the first JIT compile in each boot, as the SDK specifies.

A separate Python mixed-workload diagnostic passes all six samples with
zero host JIT failures. Its first execution exposes 403,535,341 generic
operations among 6,954,958,351 retired instructions, with major families
in byte/word MOV, memory-immediate stores, SIMD unpack and MOVQ. Preserve
those profiles and counts for the next investigation; their timings are
not performance acceptance results.

* x64: compile byte and word register shifts with precise flags

Extend SHL/SAL, SHR, SAR, ROL and ROR register decoding and compilation to
bytes and words, with immediate, count-one and CL forms. Preserve partial
registers, legacy high bytes, REX aliases, zero masked counts and nonzero
counts whose effective rotation is a full width. Latch CL before writing
an aliased destination and retain the reference's undefined-flag choices.

Defer SZAP for constant narrow shifts while retaining exact CF and OF.
Keep variable counts and rotates precise, including carry consumers and
all branch conditions. Keep the original specialized wide rotations in
the central decoded dispatcher and move narrow alias and oversized-count
handling to a separate helper, avoiding a general modulo operation in
the existing 32/64-bit paths.

Add strict differential matrices across widths, aliases, edge counts,
all conditions and ADC/SBB chains after lazy flag producers. Extend the
physical integer guest with every CL count for low and high bytes while
retaining its previous cases and architecture-defined flag masks.

Five interleaved rounds reduce CoreMark from 1851.27 to 1572.50 ms after
memory arithmetic. Profiles and identical instruction/cache counts expose
a decoded SHA regression when every width shares the generalized path;
separating the helper recovers most of it. Record the complete broad
comparison and remaining smaller regressions rather than claiming all
workloads improve. The Box64 acceptance target remains unmet.

Normal and atomics x86 builds pass 210 physical comparisons and 63 JIT
units per SIMD configuration; A64 builds pass 77 oracle comparisons and
140 JIT units with one expected skip per configuration. The kernel matrix
is 76/79: two wakeup-placement assertions and one unobserved-preemption
assertion fail without an incorrect value or register-content report.
An isolated serial control passes 15/15 on the original kernel and 13/15
on the modified one, with two SMP2 wakeup-placement failures. Retain
this unresolved difference and the original test requirements for
continued investigation before final correctness acceptance.

* x64: compile narrow MOV and memory-immediate stores

Extend general register moves, immediate register moves and scalar loads
and stores to byte and word operands. Preserve high-byte and REX aliases,
partial-register writes and qword immediate sign extension. Keep existing
wide move emission unchanged where its operands already fit that path.

Add a memory-immediate store operation without enlarging decoded slots.
Pack raw displacement and immediate fields, share relative-address
reconstruction with immediate memory arithmetic, and retain the MMU,
canonical, segment, alignment and code-store completion checks. Preserve
flags and retirement on every fault, and leave the reference executor
unchanged, including unsupported address forms and segment overrides.

Add complete register-alias and immediate matrices, directed memory
checks, relative/indexed/segmented addresses, cold and warm fault cases
after a lazy flag producer, and current-block and cached-target code
writes. Extend invalid-LOCK checks and the physical integer guest's MOV
matrices while retaining all previous tests and flag masks.

Normal and atomics builds each pass 210 physical comparisons and 69 JIT
units per SIMD configuration with zero host JIT failures. A six-sample
Python mixed-workload diagnostic remains correct and reduces the
representative generic count from 403,535,341 to 206,826,747. Preserve its
profiles and the still-unclassified overflow counts; instrumented timings
are ineligible for acceptance. Isolated broad timing and final combined
kernel validation remain outstanding, and the Box64 target is not met.

* kernel: retain synchronous wakeup placement through movable returns

Carry WF_SYNC with a held task's placement hint. At its movable user
return, accept a target that is idle or still runs only the synchronous
waker, matching wake_affine_idle's expectation that the waker will sleep.
Recheck active CPUs and affinity, retain the source-work requirement, and
keep ordinary hints restricted to idle targets. Clear the synchronous
state when consuming a hint, cloning or requesting mandatory movement.
Export the autosquashed scheduler and wasm architecture patches.

Add eight handshakes that keep the waker runnable through the reader's
return from read and getcpu. Require every reader to leave the busy CPU
with intact messages and require an actual hinted move. Identical guests
fail all three old-kernel controls with zero hints followed; the fix
passes three boots each for A64/x86 on two/four CPUs, with 96/96 hinted
handoffs and every original SMP assertion intact. Exclude the retry-only
experiment that still failed the original A64 placement checks.

Strengthen the A64 state-preemption fixture after a diagnostic reproduces
two failures in 30 runs: the second child can finish its fixed spin after
the first competitor exits without itself being preempted. Preserve all
state comparisons and the original six million iterations per child.
Keep both competitors runnable until each records an involuntary switch
while its state is live, and fail after ten seconds. Thirty JIT and three
no-JIT executions pass; withholding acknowledgment fails at the bound,
and injected V0 corruption fails the state comparison.

The combined CPU and kernel candidate passes the complete 79-case kernel
matrix, including all repeated SMP placement checks. Record the controls,
rejected design and verification limits. This resolves the scheduling
validation failures; full application performance acceptance, remaining
ISA verification and the Box64 target are still outstanding.

* x64: compile SIMD interleaves and scalar vector transfers

Compile the complete low/high register unpack family for byte, word,
dword and qword elements in legacy SSE2, VEX.128 and AVX2.256 forms.
Apply the shuffle independently to each 128-bit lane, preserve aliased
sources and legacy upper lanes, and clear VEX.128 upper lanes. Keep
memory unpack operands on the existing reference path.

Compile register MOVQ and route scalar MOVD/MOVQ memory operands through
the existing four/eight-byte vector memory paths. Preserve exact access
widths, compatibility-mode VEX.W behavior, MXCSR, flags, exception state,
retirement and completed code-store publication. Leave the reference
executor and the shared CPU layout unchanged.

Add differential matrices for aliases, extended registers, randomized
lane canaries, both guest modes, all unpack widths and VEX.W forms.
Cover feature and reserved-field faults before operand access, cold/warm
memory faults after a lazy ADD, and stores into current/cached code.
Append twelve qword-unpack physical forms without renumbering existing
forms; retain every previous case and flag mask.

Normalize diagnostic encoding keys to combine operand register numbers
while retaining opcode-extension selectors and register/memory forms.
Keep the statistics layout and overflow accounting unchanged. Six valid
Python mixed-workload samples have no host warnings or JIT failures; a
representative generic count falls from 206,826,747 to 58,263,020. Only
324 executions remain unclassified after normalization. Preserve these
as exact diagnostic counts; concurrent correctness fuzzing makes their
timings ineligible for performance claims.

Normal and atomics builds pass 210 physical comparisons and 75 JIT units
per host SIMD configuration, including the additional code-store unit.
The combined kernel matrix passes 79/79. A fresh 62,914,560-pattern XED
sweep retains 194,147 representatives with no decode, length or illegal
classification errors and 86 explicit unprobed templates; all 50,688 VEX
oracle combinations match. Extended A64 fuzzing and isolated timing remain
in progress. The Box64 performance target is not yet met.

* x64: check PALIGNR features before accessing operands

Require SSSE3 for legacy XMM PALIGNR and AVX2 for its VEX.256 form in
the reference executor. Match Intel's CPUID feature assignments and the
retained independent XED templates. Reject unavailable instructions
before register mutation, memory access or retirement, including large
immediates that would otherwise produce zero.

Add fourteen feature-disabled differential cases across both guest modes,
register and unmapped-memory operands, and immediate boundaries, with
packed-shuffle feature controls. Preserve every existing audit case.

The original code reaches INT3 with SSSE3 disabled; adding only that guard
then exposes the same failure with AVX2 disabled. Both guards pass the
native differential with exact state and retirement checks. Retain these
actual red/green controls and distinguish an earlier invalid test fixture
that omitted its start PC. Full combined-path validation remains pending.

* test: reject statistics-instrumented CPU harness timings

Detect the harness's kwemu statistics output and mark the whole timing
report ineligible. Print DIAGNOSTIC instead of a median when counters are
present, while retaining the raw times, output checks and instrumentation
metadata. Track per-sample eligibility for both counters and the additional
inspector round; keep uninstrumented measured rounds eligible.

Check syntax and execute four normal and four statistics-enabled smoke
samples, all with valid physical output and no host JIT failures. The
normal report remains eligible and the statistics report rejects its
timings. Four correct instrumented CoreMark samples also reject timing
acceptance while retaining their operation counts. These runs overlap
correctness tests and provide no performance comparison.

* x64: compile word shuffles and track AVX state across calls

Compile register PSHUFLW, PSHUFHW and PALIGNR for legacy, VEX.128 and
VEX.256 encodings. Preserve independent 128-bit lanes, source aliases,
ignored W bits, legacy upper lanes, VEX clearing, flags and MXCSR. Emit
constant byte-shuffle masks, a zero source for byte offsets 16 through
31, and zero for every larger unsigned immediate. Keep memory operands
on the reference path and retain the previous PSHUFD implementation.

Qualify cached SIMD VEX specializations by XCR0 XMM/YMM availability.
A warm decoded block otherwise reaches INT3 after two retired instructions
when the reference raises UD before retirement. Track availability at the
user execution-window boundary and release cached specializations when it
changes. Mask AVX only for specialization, preserving hardware CPUID and
compiled integer BMI VEX instructions. XSETBV is privileged, so the state
is stable inside the window. Consume a private reserved byte and assert
the existing offsets and size without changing the public CPU ABI.

Add the complete immediate, alias, width, mode and W cross-product with
randomized full-state canaries and cold/warm runs. Warm and toggle XCR0
across thirteen vector register/load/store families, including unavailable
memory operands, exact exception metadata and retirement. Check that
CPUID, ANDN, RORX and SHLX remain correct and compiled with AVX state off.
The original code and separate copies omitting either invalidation or the
specialization mask all fail the directed control; the correction passes.

Append word-shuffle controls and missing alignment boundaries without
renumbering existing physical audit forms. Both modes now cover 3,175
forms and 76,200 operand cases. Normal and atomics x86 builds each pass
210 physical comparisons and 79 JIT units per host SIMD configuration.
A64 builds each pass 77 oracle comparisons and 140 JIT units with one
expected skip per configuration. The combined kernel matrix passes 79/79
and all four UP/SMP stack guards pass; API and userland checks continue.

Six valid statistics-only Python mixed-workload samples reduce the
representative generic count from 58,263,020 to 11,915,168, with zero
host warnings or JIT failures. Retain unclassified counts and exclude
instrumented timings. Record the isolated five-round CPU comparison:
integer MOV reduces i386 memory/sha costs, while interleave/MOVQ takes
CoreMark from 1576.35 to 1381.77 ms; word shuffle/align is 1382.69 ms.
Keep the broad regressions as well. Those installations predate the XCR0
tracking guard; its timing and full application acceptance remain pending.
The fastest-valid Box64 target is not yet met.

* test: record controlled application and AVX-state comparisons

Record all 330 application samples from three boots without statistics,
profiling or concurrent validation, pinned to the physical host's eight
performance cores. Select the lowest median among valid Box64 0.3.4 and
0.4.3 default/callret settings separately for first and later execution.
All 66 native samples pass; every boot has zero host warnings and JIT
failures. Retain twelve incorrect 0.3.4 Python mix results and seventy-two
incompatible Node 24 results instead of treating failures as speed wins.

Native execution leads SHA, sort, Python loop and process startup, but
CoreMark still loses to 0.3.4 callret, gzip is near parity and later Python
mix slightly loses to 0.4.3 callret. Explicitly retain these unmet targets
and the limitation that the maintainer's original input recipes are not
available. The original-kernel comparison remains in progress.

Record the separate five-round availability-guard comparison, including
small regressions and CoreMark's 1385.60 to 1389.78 ms change. Update the
normal/atomics x86 and A64 evidence, 20,000-seed fuzz and independent native
fuzz executions, 79-case kernel matrix, all four stack guards, five kernel
patch checks, 156 passing API tests with three optional skips, and all four
disposable Alpine SSH/Python configurations. No performance target is
claimed complete and no existing verification is removed or relaxed.

* x64: cache crossing decodes after checking current executable bytes

Keep a full decoded instruction in private nursery slots after each
cross-page wrapper's op and first-page raw fragment. Reuse it only after
checking every instruction byte through current executable mappings.
Check the first fragment before translating the second page so shorter
and illegal replacements preserve fetch-fault priority. Retain fresh CPU
reader decoding on misses and call the unchanged reference instruction
semantics with live task state. Keep the reference executor fresh, the
one-page block invariant, one active op per guest instruction, shared
cache capacity, public CPU size and ABI.

Count crossing dispatch attempts separately from budget tails in statistics
builds and retain mode/PC keys in the existing bounded dictionary. Four
correct diagnostic CoreMark samples identify 4,704,003 crossing dispatches,
mostly CMP and MOV, among 4,709,927 single steps. Reject diagnostic timings
and retain overflow rather than attributing those steps to unsupported ISA
families without measurement.

Add nine differential groups covering every split of representative
integer, memory, SIMD, x87, branch and trap forms; cold/hit reuse, precise
faults and retirement, live MXCSR and XM, both fragments' code stores,
permission changes, remapping, shared-first-page address spaces, prefix
priority, compat PC wrapping, partial REP, SS shadow and TF, following-code
publication and nursery churn. A separate control omitting the second-page
byte comparisons returns stale EAX and fails the directed test. Correct an
initial REPNE fixture's equal input to exercise the intended partial fault
without removing its assertions, and retain that failure separately.

Pass 210 physical comparisons per normal/atomics x86 build and 88 JIT units
per SIMD setting without compile failures or leaks. Pass both 20,000-seed
A64 configurations, 77 oracle comparisons each and 140 JIT units with one
expected skip per setting; independently verify the identical native test
image reports 197 passed, eight skips and zero failures. Pass the 79-case
kernel matrix, four complete stack guards, five kernel patch checks, 156
API tests with three optional skips and four Alpine SSH/Python regressions.

Record five-round isolated CPU timing and three-boot application results.
CoreMark harness JIT changes from 1381.16 to 1291.20 ms; all 132 application
samples pass with zero warnings or JIT failures. Retain the Python loop,
startup and i386 FP regressions instead of claiming uniform improvement.
Layout-controlled counter diagnostics explain variation in page walks but
not every timing difference. Keep the original default-ASLR results and
record the large driver expansion during Binaryen lowering for independent
build-policy investigation. The fastest-valid Box64 target remains unmet.

Also retain the separate 132-sample comparison to the original audited
kernel, including startup improvements and all reconstructed workloads.
All accepted measurements are statistics-free and isolated from validation;
long correctness jobs resume after the recorded measurement interval.

* x64: compile packed widening multiplies and reject invalid VEX prefixes

Specialize register PMULUDQ and PMADDWD in the decoded and Wasm SIMD
executors for legacy XMM, VEX.128 and AVX2 VEX.256 forms. Select unsigned
even-dword widening products or wrapping signed-word pair sums through
one vector kind's auxiliary field. Preserve aliases, independent YMM
halves, legacy upper lanes, VEX clearing, flags and MXCSR. Keep MMX and
memory operands on the reference path, retain the 16-byte op and assert
that all vector selectors fit their six-bit encoding.

Add full-state differentials for both modes, widths, aliases, ignored W
bits, edge-value cross-products, cold/warm execution, unavailable features
and precise memory faults. Extend warm XCR0 availability checks to both
families. Retain a scalar FP loop fault regression: the suspected deferred
flag defect does not reproduce because the existing unmasked MXCSR guard
hands back before arithmetic, so leave the FP implementation unchanged.

Correct the shared encoding validator after a new test exposes invalid
packed-multiply VEX prefixes executing or reading memory before UD. The
physical CPU confirms 1,536 unmapped-operand combinations must raise UD.
Append eight oracle forms without renumbering existing ones: 54,784
combinations across 107 forms, including 45,864 UD results, with no
dispatcher mismatches. The unchanged-check control fails both the new
directed differential and native-mask test. Keep reference decoding fresh
and its arithmetic semantics intact. All 194,147 XED representatives
retain zero decode, length or unclassified-UD mismatches.

Pass 210 physical comparisons per normal/atomics x86 build and 92 Wasm
JIT units per SIMD setting, without compilation failures or module leaks.
Pass both AArch64 configurations with 77 oracle comparisons, 140 Wasm
units and one expected skip per setting, and 300-seed fuzz; independently
verify the shared native image reports 197 passed, eight skips and zero
failures. Pass the 79-case kernel matrix and four complete stack guards.
The full API suite passes 156 tests with three optional skips at its
documented concurrency of four. Retain the initial host-sized-concurrency
failures and missing-image skips instead of removing assertions. Final
extended fuzz and the common-kernel Box64 acceptance remain outstanding.

Record eighteen correct statistics-only application samples with zero
warnings or JIT failures. CoreMark generic execution drops from the prior
648,312 to 1,011-1,126 operations. Reject those timings because statistics
and concurrent validation are enabled; isolated speed measurements remain
pending. Also record the 120-sample Binaryen inline-limit control: smaller
drivers do not improve every workload, so preserve the existing lowering
policy and retain all regressions. The overall performance goal is unmet.

* test: record isolated widening multiply performance and regressions

Retain the five-round CPU comparison with all 264 harness samples and
twelve CoreMark samples correct, statistics-free and isolated from builds,
validation and profiling. CoreMark JIT changes from 1289.03 to 1254.41 ms;
the generic-count reduction does not imply a comparable speedup. Record
every decoded/JIT result, including interpreter and i386 FP regressions.

Record all 132 correct application samples from three rotated boots per
kernel, with default guest ASLR and zero host warnings or JIT failures.
Retain cold CoreMark, gzip, sort, Python mix and Node startup regressions
alongside the later CoreMark and Node crypto improvements. Also record
the five passing patch/bundle checks and all four Alpine SSH/Python
configurations. The fastest-valid Box64 comparison on the eventual common
kernel remains pending, and the overall performance goal remains unmet.

* x64: compile saturating packed arithmetic and retain precise decode faults

Compile all eight signed/unsigned byte/word saturating add and subtract
families for legacy XMM, VEX.128 and AVX2 VEX.256 register forms. Reuse
the existing byte/word add/subtract kinds with auxiliary saturation modes
and preserve their wrapping forms, 16-byte ops, CPU size and ABI. Emit
standard Wasm SIMD saturation operations; retain source aliases, independent
lanes, legacy upper halves, VEX clearing, flags and MXCSR. Keep MMX and
memory forms on the reference path. Select the SIMD opcode during code
generation without adding a guest runtime mode branch.

Add full-state differentials for new and wrapping forms, both modes,
widths, ignored W bits, aliases, high registers, edge-value pairs and
cold/warm execution. Check every active lane against an independent widened
integer oracle. Exercise unavailable AVX/AVX2, invalid LOCK, memory faults
and warm XCR0 changes across every new family. Correct an initial fixture
to require the existing trap_ill handler for LOCK before VEX while retaining
all event and retirement assertions.

Reject invalid VEX prefixes before operand access through the shared
encoding validator. The physical oracle now covers 139 forms and 71,168
combinations, with 58,152 UD results plus 6,144 unmapped saturation-prefix
checks and the prior 1,536 multiply checks. Append native masks without
renumbering existing forms. The old validator misclassifies 12,288 new
combinations; the repair has zero dispatcher mismatches. Keep fresh reference
decoding and its independent arithmetic implementation.

Match cached failed-decode metadata to the fresh reference's zero value
instead of returning the first prefix byte. Keep every consumed raw byte
and invalidation dependency. Strengthen the common x86 machine comparison
to check ev.insn for all existing and new differentials, and add cold and
repeated invalid-prefix/map cases. Retain the pre-fix zero-versus-F0 failure.
No existing test or reference path is removed or weakened.

Pass 210 physical comparisons per normal/atomics x86 build and 95 Wasm
JIT units per SIMD setting without compilation failures or module leaks.
Pass both A64 configurations with 77 oracle comparisons, 140 Wasm units
and one expected skip per setting, and 300-seed fuzz. Independently verify
the native image reports 197 passed, eight skips and zero failures. Pass
the final 79-case kernel matrix, all four complete stack guards, five
patch/bundle checks and four Alpine SSH/Python configurations. The unchanged
final bundle passes 156 API tests with three optional skips on an isolated
rerun; retain both earlier snapshot failures as unresolved verification
limits. Final extended fuzz and common-kernel Box64 acceptance remain open.

Record eighteen valid statistics-only samples: gzip generic execution drops
from 2,095,196 to 6,307 at the same retirement count. Reject those timings.
Record all isolated five-round CPU results and 132 correct application
samples from three rotated boots per kernel, with zero warnings or JIT
failures. Gzip changes from 834.39/937.67 to 800.65/797.12 ms first/later;
retain later Python mix, spawn and crypto regressions and first Node startup
regression. CoreMark CPU timing is unchanged. Do not attribute every net
kernel improvement to saturating instructions or claim the overall goal met.

Publish the generated-module naming preload and explicit diagnostic timing
exclusion in both benchmark drivers. Preserve original module bytes and
hashes, add only custom names, reject a nonempty capture directory and keep
all correctness checks. Five correct normal-code diagnostic samples have
all timings ineligible and retain 43 verified original modules for profiling.

* x64: retain exact flag state after unconditional branch synchronization

Materialize full architectural state once at unconditional branch
synchronization points and retain that knowledge through region routing.
Add syncExact without changing sync, whose conditional fault and side-exit
arms must preserve lazy state on their untaken paths. Use the new operation
for non-self terminators, returns and direct or indirect transfers. Keep
self-loop handling, checked entries, instruction charges, reference execution,
CPU layout and the ISA-neutral core unchanged.

Add two full-state differential groups covering every lazy flag kind and
width, incoming carry, partial writes, all conditions and changed branch
forms, synthetic fallthrough, cold/warm execution and exact budget edges.
Require actual shared-region membership. Exercise untaken warmed-load
hand-backs followed by stack, operand, noncanonical-target and fetch faults,
including event metadata and exact retirement. Separate controls that mark
conditional state exact or omit actual flag computation fail the directed
fault test in both SIMD settings. Keep all production tests unfiltered.

Pass 210 physical comparisons per normal/atomics x86 build and 97 Wasm JIT
units per SIMD setting without compile failures or leaks. Pass both A64
configurations with 77 oracle comparisons, 140 Wasm units and one expected
skip per setting, and 300-seed fuzz. Independently run the rebuilt native
image with 197 passes, eight skips and zero failures. Pass the 79-case
kernel matrix, four complete stack guards, five patch checks, 156 isolated
API tests with three optional skips, and four Alpine SSH/Python regressions.
Retain earlier intermittent snapshot failures and final extended audit limits.

Capture 43 diagnostic modules with matching ordered checked-entry PC sets.
Their total original size falls from 417419 to 388851 bytes; one matching
sixteen-member module shrinks from 22453 to 17249 bytes and from 157 to 91
flag-local writes. Exclude every diagnostic timing. Record all 408 correct,
isolated and statistics-free CPU/application samples with zero warnings or
JIT failures. CoreMark application first/later medians change from
1308.33/1225.53 to 1221.83/1146.70 ms; later Python mix changes from 9656.55
to 9086.78 ms. Retain i386 memory, later spawn, first Node crypto and both
Node startup regressions, along with substantial boot variation. The final
common-kernel Box64 comparison remains open and the overall goal is unmet.

* test: scope JIT profiling names to generated entry modules

Identify generated modules by their sole function export f before adding
names. The SDK's TypeScript loading also constructs Wasm synchronously;
renaming that compiler module previously triggered the generated-code
function-import check before an application profile could start. Preserve
ordinary module construction and retain the strict no-function-import
check for selected JIT modules. Keep original captured bytes and hashes.

Add a child-process regression that initializes the real TypeScript loader
after installing the preload, instantiates an unrelated module with a host
function import, executes a named entry module and compares its captured
bytes and SHA256. Require the generated-entry import violation to keep
throwing, and require exactly one original module in the manifest.

Pass the regression and the preload syntax check on the physical test
host. Retain the failed diagnostic startup log and its empty manifest;
no guest sample or accepted timing was produced by that attempt.

* emu: route forward region transfers directly through checked entries

Branch from a member to a later member's existing enclosing checked-entry
label instead of setting an index and returning through the dispatcher.
Keep the same state synchronization, interrupt and generation polls,
decoded-op checks and instruction charges. Preserve earlier-member and
self-loop routes and apply the change through the ISA-neutral core.

Add x86-64/i386 and A64 component differentials for all fifteen forward
target positions in sixteen-member regions. Enter real compiled code so
the caller cannot repair a failed check before inspection. Compare full
registers and memory with fresh reference execution, and check returned
budget, stop code and last member for budget, IRQ, stale-op and generation
rejections and a positively charged target. First pass both new tests with
the original dispatcher route. A separate unchecked-body control fails
on both ISAs with and without SIMD, with no module compile failures or leaks.

Pass 210 physical comparisons per normal/atomics x86 build and 98 Wasm
units per SIMD setting. Pass both A64 builds with 77 oracle comparisons
and 141 Wasm units plus one expected skip per setting, including all four
20000-seed fuzz runs. Independently run the corresponding extended native
image with 197 passes, nine skips and zero failures; retain the listener's
misleading zero-exit failed-command output. Regenerate identical XED forms
and pass all 194147 dispatch checks and 71168 physical VEX combinations,
including the 1536 and 6144 unmapped-prefix checks.

Pass the 79-case kernel matrix, all four complete stack guards, five patch
checks and four Alpine SSH/Python regressions. Pass 156 isolated API tests
with three optional skips on the complete bundle. Retain the initial bare
SMP invocation's missing-boot-metadata failures and correct the invocation
without changing assertions or timeouts.

Record all 570 correct isolated CPU, application and nine-boot startup
samples, with zero warnings or JIT failures. CoreMark harness changes from
1238.39 to 1217.13 ms; later application CoreMark changes from 1150.00 to
1123.60 ms. Retain every regression, including cold CoreMark, SHA, Node CPU,
Python startup in the full sequence and several i386 loops. Keep the large
correct CoreMark outlier and the startup experiment's different process
history and mixed winners.

Retain ninety focused common-kernel Box64 samples, of which twelve 0.3.4
Python mix outputs are invalid despite exit zero. Native medians lead the
three focused workloads, but later Python mix leads by only 2.2 percent
and still loses to Box64's fastest single valid sample. The complete final
comparison and uniform substantial improvements remain unachieved.

Record 36 correct normal-code profile samples and verified original module
hashes with all timings excluded. A separate 18-sample statistics observer
finds substantial flag materialization and potential transfers to dead
flag heads. Retain its emission and failed-check counting limits; do not
claim the observed opportunities are speedups or weaken precise state.

* x64: preserve deferred arithmetic state across checked region transfers

Carry arithmetic kind, operands and actual result in four private Wasm
locals across region members and preserving loop heads. Recover complete
flags at consumers, faults, hand-backs, rejected checks and module exits
with the existing factored formulas. Keep ADC/SBB carry, partial producers,
narrow shifts, instruction charges and all existing entry guards exact.
Leave the reference executor, CPU layout, 16-byte ops and ABI unchanged.

Give the shared core optional transfer, helper-signature and warmup hooks
whose defaults preserve A64 execution. Warm the x86 recovery helper's
memory-free zero-mode path inside the host compilation window. Emit only
used kinds and omit unnecessary helpers for plain prefixes, nonloops and
proven dead-head loops; preserve saved flags before any faulting head.

Add full-state differentials for all lazy kinds and widths, carry inputs,
all conditions, partial writes, preserving loads and FP operations, exact
budget boundaries, memory/stack/FP faults and IRQ rejection. Exercise mode
zero and all fourteen pending kinds in one actual compiled region. Separate
wrong-result and prematurely-exact controls fail in both SIMD settings
without compilation failures. Retain inadequate fixtures and controls.

Fix a real precision gap in the preceding loop-head analysis: a vector
operation before a complete overwrite can fault on a later pass after a
generic MXCSR update. Add a case that starts with exact division, changes
MXCSR and the divisor, and requires the next pass's precise fault, complete
flags, eight retirements and exactly one compiled entry. The old executor
and a blind head-skip control fail with SIMD. Independently check both
overflow directions against physical signal frames without weakening any
existing assertion or reference semantics.

Pass 210 physical comparisons in each normal/atomics x86 build and 102
Wasm units in each SIMD setting, without compilation failures or leaks.
Pass both extended A64 builds with 77 oracle comparisons and 141 Wasm
units plus one skip per setting, including all native, SIMD and no-SIMD
20000-seed fuzz runs. Independently run the matching native image with
197 passes, nine skips and zero failures; retain the listener's misleading
failed-command line despite its successful exit.

Pass the matching 79-case kernel matrix, four complete stack guards,
five patch checks and all four Alpine SSH/Python configurations. Regenerate
identical XED representatives and pass 194147 dispatch checks and 71168
physical VEX combinations, including the existing unmapped-prefix checks.
Pass 156 isolated API tests with three optional skips on the complete
two-CPU bundle with the Alpine image.

Record all 852 correct isolated CPU, application and startup samples with
zero warnings or JIT failures. Initial deferral reduces x64 fib and
interpreter harness time by 14.10 and 17.11 percent, but application and
startup results remain mixed. Compare safe heads and helper pruning in a
separate 432-sample control. Retain every i386, cold Python, gzip, spawning
and cold Node regression, broad boot ranges and correct outliers. Select
the smaller pruned implementation without claiming a universal speedup.

Retain diagnostic profiles and original module hashes with every timing
excluded. Identity-only helpers motivate pruning; their module bytes are
not helper size or a measured runtime cost. The final complete common-kernel
Box64 comparison and uniform substantial improvements remain unachieved.

* x64: dispatch indirect region targets through a balanced PC search

Sort member indexes by their full unsigned PC during emission. Select
one candidate through balanced comparisons and route it through the
existing equality check and checked entry. Keep compatibility tags,
original member indexes, self branches and exact state on unmatched
exits. Leave direct branches and shared core routing unchanged.

Exercise five indirect forms at six region sizes in both x86 modes.
Enter compiled modules directly and check every target, nonmember
aliases, exact retirement, register and memory state, and budget, IRQ,
stale-op, generation and code-epoch rejection against the fresh reference.
Account for the entry's code epoch in the fixture. Deliberately remove
the final equality check and separately introduce a false rejection in
the prefilter control. Both changes fail the new comparison with and
without SIMD and produce no host compile failures or leaks.

Compare linear search, a common-bit prefilter and a balanced search in
432 isolated samples. Balanced search reduces i386 fib, cold Python mix
and later CoreMark medians by 8.5, 3.9 and 3.9 percent. Retain all startup
and other regressions, the prefilter's 7.3 percent i386 fib regression,
and correct outliers. Record the statistics-only observations separately
and account for their effect on emitted module size and region membership.

Validate 330 samples from the balanced kernel shared by native execution
and both Box64 releases with default and CALLRET settings. All 66 native
samples pass. Exclude 12 incorrect Python mix outputs and 72 failed Node
24 executions. Native medians lead the best Box64 configuration medians
in all comparable phases. Against the fastest individual correct Box64
sample, later Python mix still loses about 3 percent and early CoreMark
and Python mix have small leads. All 132 native before/after samples pass
and every workload's median improves relative to the original audit
kernel. Retain the requirement for a substantial lead across workloads.

Support one-kernel workload generation and summarize complete comparison
reports with both the best valid configuration median and fastest valid
individual result. Check the analysis against a prior complete report and
controls for missing, duplicate, diagnostic, wrong-output and host-failure
samples. Match 11270 non-kernel input hashes and all checked references.

Pass 210 physical comparisons in the normal and atomics builds, with
103 Wasm tests per SIMD setting and no module errors or leaks. Rebuild
UP and SMP, pass the 79-case kernel matrix and five patch checks, and
verify that the timed UP image and rebuilt UP image differ only in four
build-stamp strings.

* test: check pending flags through faulting memory arithmetic

Enter compiled regions with live incoming flags and exercise ADC and SBB
with a memory source or destination. Compare complete state with the
fresh reference across successful execution and misaligned, read-only,
unmapped and straddling accesses in both x86 modes.

An independent control overwrites the saved result before a page
crossing. Both SIMD configurations detect the incorrect fault flags with
no module compile errors. The full baseline and operand-reuse suites
pass 210 physical comparisons and 104 Wasm tests per SIMD setting.

Record the 384 eligible samples and retain the existing operand locals.
Reusing ALU locals improves several medians but slows i386 fib, both
CoreMark application phases, first Python mix and several startup
results. Retain the measured ranges and correct outliers in the raw
reports.

Record eighteen valid source-region diagnostics. Member capacity
dominates CoreMark cross-region transitions. Emission size dominates
Python mix. Keep the instrumentation outside accepted timings.

* test: compare native AArch64 and x86 application workloads

Select architecture-specific chroots through an optional engine root map
while retaining workload arguments, physical output checks and one common
kernel. Record setup output so runtime version checks remain reviewable.
Leave existing native and Box64 specifications on their original paths.

Require matching pinned Python and Node image indexes, expected ELF machine
types and equal distribution package versions. Build both CoreMark guests
from the same clean pinned source with Zig -O2 and baseline target CPUs.
Preserve each AArch64 root's libraries and compare actual Python, zlib and
Node component versions before timing. Keep all staging in disposable RAM.

Pass all 132 application executions across three rotated boots against
eleven physical references, with 21457 recorded input hashes, no host
warnings and no JIT failures. AArch64 leads every first and repeated median
in this set. Repeated x86 time is 1.19 to 4.60 times AArch64 time, with the
largest gap in Node crypto. Retain every sample and range and distinguish
complete software stacks from individual instruction costs or host CPUs.

Reject incomplete and duplicate matrices, incorrect output or status,
instrumented timings, host failures, incomplete setup and troubled boot
consoles. Pass fifteen independent corrupted-report rejection controls and
reject a wrong-architecture root before building or creating output.
Document the paired software versions, results and reproduction commands.

* docs: remove personal environment details from the x86 audit

Describe the validation host by its hardware and toolchain rather than a
personal SSH alias. Remove absolute checkout paths and machine-specific
transfer procedures from the shared audit document.

Retain the measurement date, hardware, tool versions, reproduction commands
and verification limits. Keep the audit results unchanged and refer to the
validation checkouts' audit-logs directories without prescribing a personal
workspace layout.
2026-12-03 13:05:04 +01:00
Pooya Parsa
b033dc7b50 web: add desktop themes: KDE Plasma, GNOME, iOS, Android and Windows 2000
A theme is a stylesheet under :root[data-desktop] and React parts in place of the top bar, the Dock, the launcher and a window's title bar (web/src/themes); it loads when first shown and switches without a reload. Without a choice the device picks it: iOS, Android, else KDE.

Also: the desktop's headless core (window manager, commands, apps, pins) moves to web/src/core with its tests; terminal tabs are drawn by the theme's title bar; Settings and System get a sidebar drawer in narrow windows; the first paint is a minimal splash; the console's auto-hide is removed.
2026-12-02 20:27:00 +00:00
pi0x
9772730203 js: warn once when a distro image without the account user runs programs as root (#158)
exec() and spawn() run programs as the account "user" by default, and kwtty falls back to root where /etc/passwd has no such account. On an image of your own that lacks it, programs ran as root without any sign of it.

For a kernel that boots a distro image, the first program that names no user now asks kwtty for "user" by name (not critical, so a guest from before the USER option runs it as root as before). When kwtty answers "no user user", the SDK logs one warning through createKernel's log and opens the same session with the default, so the account used does not change. Later programs send the default as before. The base shell, which has root only, gets no check and no warning.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-02 21:03:01 +01:00
pi0x
c17c6b7b34 js: give PtyError the stage and errno name of a program that cannot start (#157)
exec() and spawn() reject with PtyError EREMOTE and only the guest's
message when a program cannot start, so a caller that must map this to a
shell exit status or tell a missing program from a missing directory has to
parse the text. PtyError now has stage ("exec", "chdir" or "user") and
guestCode (the errno name, e.g. "ENOENT", "EACCES", "ENOTDIR"),
derived on the host from kwtty's fixed message formats, with the strerror
texts of musl and glibc. No protocol change: it works with every existing
image and snapshot. A message that does not match, or an unknown errno
text, leaves the fields undefined; code and message are unchanged.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-02 15:15:22 +01:00
pi0x
55b582b887 js: report the CPUs the guest runs on, and why it got fewer than asked (#159)
stats().cpus said what createKernel() was asked for, not what the guest
got: cpus above the kernel's NR_CPUS (16) left the guest on 16 while
stats().cpus and snapshots said more. A kernel without SMP, or a thread
that cannot start CPU threads, booted on one CPU with only a log line.

The host now offers the SMP kernel at most MAX_CPUS (exported), so
stats().cpus and the snapshot's count are what the guest runs on;
snapshotCpuMismatch() compares counts as the kernel takes them. When the
guest gets fewer CPUs than asked, stats().cpuLimit is { requested, reason }
("max", "module-not-smp", "kernel-not-smp", "not-isolated",
"not-worker", "unsupported"), in worker mode too. createKernel() still
boots, and the log line stays.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-02 15:12:07 +01:00
pi0x
2878879c4e js: end the idle WASI program workers when the kernel exits (#160)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-02 15:09:59 +01:00
pi0x
595d90f8a6 js: reject detachable on pipes in spawn() and exec() (#156)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-02 15:08:42 +01:00
pi0x
eb6f2a2495 test: read the region members counter from its slot in work-bench (Ax core+7, not +8) (#153)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-02 13:18:35 +01:00
Coenraad Loubser
ac0554ad68 kwsparse: Reject unrepresentable disk and block sizes (#91) 2026-12-02 13:00:38 +01:00
Coenraad Loubser
271c8af4a3 disk: Complete short transfers when reading and writing disk images (#90) 2026-12-02 12:59:36 +01:00
hELLO,tHIS'S jOSHUA
303320394b vk: skip readback for storage buffers shaders only read (#122) 2026-12-02 12:57:32 +01:00
Coenraad Loubser
a023438bba block: Preserve discards during an in-flight save (#86) 2026-12-02 12:55:52 +01:00
pi0x
b6f98d9e2b js: add an SNI/Host sniffing backend with a policy callback (#152) 2026-12-02 12:51:13 +01:00
pi0x
bdcc90c51f js: start the inlined Node workers from data: URLs (#143) 2026-12-02 09:51:17 +01:00
pi0x
903ac21686 test: make the SDK API suite pass reliably (#147)
* test: expect the JIT host's fused multiply-add, tail call and chaining caps, and export jitTail() beside jitSimd() and jitFma()

The JIT rework added caps bits 6 (fused relaxed multiply-adds), 7 (cheap
tail calls), 8 (module format v2, KW_JIT_V2=1) and 9 (chaining, unless
KW_JIT_CHAIN=0), but the JitHost test still expected bits 0-5 only, so it
failed on every run (755, not 51, on Node 24 on x86-64). The test now
derives the expected caps from the same probes and variables.

* test: expect shm views in place in worker mode with an SMP kernel

With UNKERNEL_TEST_CPUS=2 the worker shares the kernel's memory with this
thread (shm.ts, In place), so views() works there instead of failing with
EOPNOTSUPP; the shm test failed on every 2-CPU run. It now checks the
views on the shared memory there, and the EOPNOTSUPP on the UP kernel.

* test: find the forced H.264 key frame by the source's request, not by a chunk window

The camera H.264 test wanted the key frame kwcap forces after the 16th
chunk among chunks 16 to 22. The source makes it next, but the chunks it
made before reach the guest first: the host's queue and the guest's
filled buffers, as many as the guest lags behind the source's clock. With
the full suite at once the inline kernel's timer ran late, the pattern
source caught up several frames at a time, and the forced key frame came
later (or on the GOP's own key frame at 24). The test now records the
chunk the source makes after each key frame request, checks that the
guest gets that chunk as a key frame, with only the GOP's key frames
before it and the GOP counting from it, and streams 60 chunks, enough for
the queue's 32 and the guest's buffers.

* test: judge shm reads through the ring by the reads during which this thread was free

The ring's answer comes as a message to this thread, which also runs the
suite's inline kernels. The check skipped itself when this thread's timer
delay was high, but it measured that delay only after the 25 reads, so a
busy spell during the reads failed it (median 32.5 ms with a delay of
1.4 ms measured afterwards). Each read now records this thread's longest
timer delay while it runs, and the median is asserted over the reads that
saw no delay of 3 ms or more (when there are at least 3 of them).

* test: run worker-mode capture from a read() source after the concurrent suite

In worker mode the sound in and camera tests' read() sources answer on this
thread, and the worker records silence or a black frame wherever the
answer comes late. With the whole suite at once this thread runs every
inline kernel, and the source fell 200 ms or more behind at the start of a
stream: kwrec got 2357 and 2854 of its 3000 samples (worker; worker with
messages), the camera 3 of 8 pictures (worker with messages). Those four
tests now run in a suite of their own after the concurrent one, alongside
each other only, with their assertions unchanged; the inline ones and the
onRing ones (a producer on a thread of its own) stay in the concurrent
suite.

* test: read a guest's background counter again when its file is empty

The snapshot and session tests' guests count in the background with
echo $i > FILE, which truncates the file before it writes, so a cat in
between reads nothing, 0, and fails a "counts on" check (or weakens the
next one). The host now reads the counter again while its file is empty,
at most 50 times. A rename per write in the guest would also do, but at a
fork per write it loads the guest (and, inline, this thread) twice as
much.

* test: let a restored recording end before boot() returns in the snapshot capture test

A restore hides the stopped time from the guest's clock, so the restored
guest has what was left of its 3 s recording. Where the snapshot landed
late in it (a busy host), kwrec's own stop and close came before boot()
returned, and the test, which wanted nothing after the replayed open,
prepare and start, failed. It now asserts the replay first, then nothing
or the guest's stop and close, with capturing to match.

* test: derive the SMP kernel once for UNKERNEL_TEST_CPUS runs instead of at every boot

Given the bundle and more than one CPU, createKernel() derives the SMP
kernel from it on the calling thread at every boot (about 0.2 s of
patching), and in a 2-CPU run every boot() did that. The suite's boots at
once held this thread, which runs the inline kernels and the device
sources, for over 3 s: glimmer's 3 s of sound took 6.3 to 6.8 s, the PCM
ring from the worker CPU (2.97 s of that stream) overflowed and dropped
346 to 890 frames glimmer had written without an underrun, and the H.264
source made too few chunks during the guest's stall to overflow the
queue. With UNKERNEL_TEST_CPUS > 1, boot() now boots the SMP kernel that
compileTestKernel() derives once wherever it runs on more than one CPU;
sharedKernel() still boots the bundle.

---------

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-02 09:41:39 +01:00
pi0x
f06079e947 js: unwind a stopped kernel's stacks so that it can be collected (#141) 2026-12-01 23:25:57 +01:00
pi0x
8360c5d82b js: use a cached distro image without the network or a full rehash, and fall back to a temporary cache directory (#142)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-01 23:25:32 +01:00
pi0x
c742c69de7 js: make createKernel()'s signal abort the boot only, not the running kernel (#140)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-12-01 23:21:49 +01:00
pi0x
cd674065cf js: read file: URLs and paths in the Node entry's loadKernelModule() and loadBytes() (#139) 2026-12-01 23:18:09 +01:00
pi0x
07f198bd1f kwemu: JIT rework (chaining, exact code marks, fused multiply-add) (#135) 2026-12-01 21:20:37 +01:00
JeremySu0818
dba6d81349 docs: record x86 integration validation
Document the final x86-exp-isa-fixes evidence: the 79-case kernel matrix and its 20 SMP repeats, the two-CPU API suite, the amd64 Alpine SSH and Python comparisons, and the four lowered-kernel stack-audit configurations.

Clarify that CONFIG_WASM_X86 makes every task in an x86-enabled kernel use a 32 KiB shadow stack, while the audit instrumentation is test-only. Preserve the unresolved affinity, wakeup-placement, host-architecture, browser, and workload limitations; the expanded coverage is not a scheduler-resolution claim.
2026-11-30 14:57:58 +01:00
JeremySu0818
40ac1f059a x64: fix ISA conformance and x86 kernel regressions
Enforce VEX reserved-field and compatibility-width rules, correct BMI feature gating, and repair affected SIMD and x87 semantics. Serialize every locked x86 RMW path so an unaligned software update cannot race an overlapping aligned host atomic.

Make CONFIG_WASM_X86 kernels use a 32 KiB shadow stack. Deep reference-SIMD frames could exceed the former 16 KiB allocation and later surface as SLUB or page-cache corruption. Capture x86 page-fault present bits before fault handling changes the mapping, and bump the kwemu contract to ABI 6.

Add physical VEX encoding coverage, locked-atomic and mixed-ISA kernel workloads, a stack-bound instrumentation audit, and a disposable amd64 Alpine userland regression. Extend kernel matrix output to retain stdout separately from host stderr so native fault and RNG comparisons remain exact.

The audit covers x64/i386 differential execution, atomics, UP/SMP and JIT/no-JIT kernel runs, and real amd64 SSH and Python userland checks. It retains the documented limits around scheduler placement, non-x86 hosts, browser coverage, and broader workload matrices.
2026-11-30 14:57:58 +01:00
Pooya Parsa
74e1ecf806 Run x86-64 programs beside arm64 ones on one kernel
The kernel runs x86-64 ELF programs as their own tasks on kwemu's x86
front end (CONFIG_WASM_X86, on in kw_defconfig): exec picks the ISA from
e_machine, and an x86 task gets x86-64's syscall table (through the same
pt_regs wrappers, with translations where its ABI differs from arm64's:
open flags, struct stat, clone's argument order, packed epoll events,
uname, arch_prctl, MAP_32BIT, strict seccomp), signal frames, ptrace
regsets and core notes, a vDSO, the vsyscall page, AT_PLATFORM, AT_HWCAP
and /proc/cpuinfo in x86's format; kw.x86isa= masks its features. arm64
tasks are unchanged. The kernel patches are "wasm: run x86-64 user space
beside arm64" after the arch patch and three generic ones (erofs without
vmap on a flat vmalloc, eventpoll's packed events, seccomp's strict
syscalls per task); the separate x86-only series (kernel/patches/linux-x64,
KW_ARCH=x64) is gone, and so is the build switch.

base-test.cpio has x86-64 builds of kwtest and abitest beside arm64's
(kwtest-x86_64, abitest-x86_64; abitest_x64 finds itself under that name
and checks the i386 cross exec only where there is an i386 build), and
test/x64-kernel-audit.mjs runs them on the one kernel. i386 tasks are not
there yet (no CONFIG_COMPAT). The distro images still register x86_64
with binfmt_misc (box64, qemu-x86_64), which comes before the kernel's
ELF loader.

Co-authored-by: JeremySu0818 <xinghong.su0818@gmail.com>
2026-11-29 23:35:28 +00:00
Pooya Parsa
8a3d301607 x64: add SPDX and copyright headers to the x86 front end's files
GPL-2.0-or-later, MIT for the JavaScript test driver, with the author's
copyright line, as every other file has.

Co-authored-by: JeremySu0818 <xinghong.su0818@gmail.com>
2026-11-29 23:35:09 +00:00
Pooya Parsa
936c28b3bf kwemu: one library with both front ends (arm64 and x86 per task)
The x86 front end no longer replaces A64 at build time: libkwemu exports
the A64 ABI and the x86 one (kw_x64_run, kw_x64_set_isa,
kw_x64_isa_supported, kw_x64_complete_entropy, kw_x64_load_segment) on
the same struct kw_cpu, and include/kw_emu.h (ABI 5) describes both
(struct kw_x64_regs; KW_EV_FPE, KW_EV_GPF and KW_EV_ENTROPY for x86).
kw_cpu_init and kw_host_reset set up both.

x86 blocks have their own sets in the block cache (blockSetFor: the top
set bit flipped), so the blocks of the two ISAs at one pc never share a
set and switching between an arm64 and an x86 task needs no flush. The
compile-time is_x64 switches in src/emu become comptime hooks of the
tier that looks a block up (Blocks.x86): the i386 key strip, the A64
stats hooks, and the shared x86 code-page set, which only x86 decodes
mark (A64 keeps IC IVAU); a write-TLB fill reads it only once some x86
code has been marked.

zig build test runs the A64 tests as before; zig build test-x64 runs the
x86 ones (kwemu-x64-harness*, installed with the x86 guests by
install-x64). The object bundles compiler-rt (the x86 front end's
128-bit and x87 arithmetic).

Co-authored-by: JeremySu0818 <xinghong.su0818@gmail.com>
2026-11-29 23:04:44 +00:00
Pooya Parsa
8ab6a3eb06 Merge JeremySu0818's native x86-64/i386 front end (x64-main, issue #92)
Co-authored-by: JeremySu0818 <xinghong.su0818@gmail.com>
2026-11-29 22:47:38 +00:00
Pooya Parsa
61519ce4e5 test: skip the capture and camera tests on a bundle without kwrec and kwcap (a release build), and restore the 3 s recording 2026-11-29 20:11:37 +00:00
Pooya Parsa
599746c2dc test: bound the capture snapshot tests' waits for a device event, and record 10 s so the snapshot lands mid-recording on a slow host 2026-11-29 19:29:41 +00:00
Pooya Parsa
e8f60af86a web: redesign the top bar's right side as applets, each a status item with its own panel that opens on hover or click: CPU, Memory, Disk, Network (with Tailscale, a mode row and a sketch of the traffic's path), Ports, Display (the theme and the GPU), Sound and media (with a live microphone and camera indicator), Bluetooth, Serial, USB and Transfers (with the clipboard); bigger spacing, icons on a plate over the wallpaper, glassy popovers, and a Kernel log that opens at its bottom 2026-11-29 19:27:49 +00:00
JeremySu0818
e28415201a fix(x64): harden x86-64/i386 ISA semantics, kernel ABI 6, and differential audit suite
Broaden x86-64-v3 and i386 architectural conformance across the reference
interpreter, decoded tier, Wasm SIMD JIT, and Linux x64/ia32 kernel ABI
(KW_ABI_VERSION 6; AArch64 ABI unchanged):

- SIMD, AVX, MMX, and FP: implement VTESTPS/VTESTPD (including the
  reported llama.cpp c4 e2 79 0e c9 form), PHMINPOSUW, DPPS/DPPD,
  MPSADBW, CVTDQ2PD, CVTPD2DQ/CVTTPD2DQ, and MOVNTDQ; fix MMX 64-bit
  lanes, SSSE3 MMX dispatch, immediate shift saturation, INSERTPS,
  VMOVSS/VMOVSD register merging, PCMPxSTRx equal-ordered/mask rules,
  all 32 AVX comparison predicates, COMI/UCOMI NaN signaling, DAZ/FTZ
  and unmasked MXCSR preservation, FMA NaN sign/payload, ROUND,
  VCVTPS2PH, RCP/RSQRT special values, scalar/widening memory operand
  widths, and precise AVX2 gather fault restart.
- x87: fix pending-exception retirement vs WAIT/FNSTSW, memory-fault
  precedence, environment save/restore, stack faults, precision/rounding
  controls, integer/BCD conversions, constants, and 160-digit-verified
  transcendental argument reduction and status flags.
- Scalar, segmentation, control flow, and exceptions: fix zero-count
  32-bit shift zero-extension and memory write checks, read-only RMW
  flag preservation on fault, #AC scalar alignment checks with vector
  exemptions, noncanonical #GP on data/branches/FSGSBASE, overlength
  #GP, UD0 page-boundary decode, PROT_NONE fault error codes, POPF NT,
  REX.W/66 branch/stack widths, INT1/INT3 retirement, SYSCALL/SYSRET
  mode rules, BOUND/INTO, XSAVE/XRSTOR component isolation and XGETBV(1),
  i386 segment caches/limits/rights (src/x64/segment.zig) and REP
  partial progress, and fresh kernel/host entropy for RDRAND/RDSEED.
- Single-step and SS interrupt shadow: track RFLAGS.TF transitions and
  MOV/POP SS / LSS interrupt_shadow across runRef, tier/opexec, JIT
  reload/region exits, and Linux user_mode_loop (updated in
  kernel/patches/linux-x64/0003-wasm-implement-x86-64-and-ia32-user-mode-kernel-ABI.patch).
- Tests and docs: add differential audit corpora (isa-audit, fp-audit,
  integer-audit, x87-audit, x87-fp-audit, control-audit,
  descriptor-audit, fault-audit/32, rng-audit, ed25519test), offline
  Intel XED inventory tools, full-core parallelism in test/x64-test.mjs
  and vCPU-budgeted parallelism in test/x64-kernel-audit.mjs, and
  update .agents/x64.md, .agents/testing.md, and test/x64-audit.md.

Verified on desktop (24-core x86-64 host):
- x64 normal & atomics: 42/42 JIT unit tests (SIMD & nosimd), 2/2
  object-import checks, and 196/196 physical-CPU guest/runner checks.
- x64 UP/SMP kernel audit: 42/42 passed in parallel (41/42 serial,
  hitting the known intermittent kwtest-smp4 wakeup-placement check).
- AArch64 normal & atomics regressions: 138 passed / 1 expected skip /
  0 failed in JIT unit tests and 77/77 guest checks.
2026-11-30 02:53:22 +08:00
Pooya Parsa
d8e442a641 Keep the page's data disk in OPFS in worker mode: OpfsDisk (8 MiB extent files), the SDK's backend option for the data disk, a one-way migration from IndexedDB, a storage quota block and a free Disk size in Settings, and a question in a second tab instead of an in-memory copy 2026-11-29 17:37:06 +00:00
Pooya Parsa
495fe30a91 Add guest USB on WebUSB: kwusb (a USB host controller whose transfers the host serves, with usbfs and the FTDI, CP210x, CH341 and PL2303 serial drivers), the SDK's usb option and vm.usb with a fake test device, and a USB devices section in the page's Settings 2026-11-29 15:43:56 +00:00
Pooya Parsa
42b91da2a8 Add guest Bluetooth on Web Bluetooth: kwbt (an HCI transport, hci0 while a controller is attached), the SDK's bluetooth option and vm.bluetooth with an emulated LE controller, Bluetooth and Serial ports sections in the page's Settings with Terminal buttons, and the Bluetooth and Serial Monitor launcher apps 2026-11-29 15:22:20 +00:00
Pooya Parsa
ab334389af Add guest serial ports on Web Serial: kwserial (/dev/ttyACM0..3), the SDK's serial option and vm.serial, Connect in the page's Settings and from a toast, and the Thonny and GTKTerm launcher apps 2026-11-29 13:31:16 +00:00
Pooya Parsa
ed872875f2 Fetch a distro image's warm set only once the guest reads in it, and leave apt's srcpkgcache.bin out of Debian's 2026-11-29 12:29:20 +00:00
Pooya Parsa
a9c8aef517 js: add Tailscale exit nodes, and rework the page's Tailscale settings
With net.tailscale.exitNode (--tailscale-exit-node, setExitNode() at run
time) a tailnet device that offers 0.0.0.0/0 takes all the guest's other
IPv4 traffic and its DNS in place of the backend; while it is not usable
that traffic is refused. WireGuard's source check is now the longest
prefix across peers. The page lists the tailnet's devices, picks the
exit node from a select box in Settings and the top bar panel, and shows
a set-up node's status and live controls apart from the setup form. The
README gains a section on joining a tailnet.
2026-11-29 11:16:22 +00:00
Pooya Parsa
4b713a5aed Merge branch 'main' into tailscale 2026-11-29 10:24:54 +00:00
Pooya Parsa
1b229902b2 Add a guest microphone and camera: kwsnd capture, kwcam (V4L2, raw and host-encoded H.264), and camera frames named to the kwva encoder
Microphone: kwsnd gains a capture substream fed by the host (SDK option
soundIn, the page's Microphone setting and ?mic=0, the CLI's
--sound-in-wav and --sound-in).

Camera: kwcam is a V4L2 capture device (/dev/video0) fed by the host: I420,
NV12 and YUYV at 320x240 to 1280x720, and H.264 encoded by the host's
WebCodecs encoder where it has one, with bitrate, GOP and key frame
controls (SDK option camera, the page's Camera setting and ?cam=0, the
CLI's --camera). The base's rc writes the udev database entry of
/dev/video*, so programs that list cameras through libudev find it.

kwva (protocol 5): an encode whose input surface is a camera buffer's
dma-buf names the frame to the host instead of sending its pixels, and
pixels an app writes into an exported surface reach the host (put).
2026-11-29 10:23:01 +00:00
JeremySu0818
1e679ee33d fix(x64): fix packsswb/packuswb/packssdw lane indexing, vbroadcasti128, and shift saturation 2026-11-29 15:14:27 +08:00
Pooya Parsa
d382f7fa9b js: add a pure-JS Tailscale network device (work in progress)
The guest joins a tailnet from Node or the page: ts2021 control over
WebSocket, DERP relays, WireGuard and the packet filter in JS, loaded as
a separate chunk only when the option is used. SDK net option, CLI
--tailscale* flags and a page panel. Relay only; exit nodes, IPv6 and
real peer traffic are not covered yet.
2026-11-28 22:06:18 +00:00
pi0x
8c9ec09477 gl: give the guest all 12 uniform blocks on hosts that offer only 12 per stage (#74)
WebGL2 on ANGLE's D3D11 backend (Chrome on Windows) has exactly 12
uniform blocks per stage. vrend keeps one for its VirglBlock, so Mesa's
virgl driver saw 11 uniform buffers, turned uniform buffer objects off
and with them GLES 3.0: the guest got OpenGL ES 2.0.

virglrenderer patch 21 declares the system values as plain uniforms
instead when 24 blocks and bindings fit and the ordinary uniform limits
have room for them, so the guest gets all 12 blocks. test/gl/kwgl-ubo12.c
(vtest-check.sh ubo12) draws with twelve distinct buffers in each stage;
bridge-check.sh --ubo N has the page cap the limits the wasm renderer
sees, which reproduces the D3D11 host on SwiftShader (14 per stage).

Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: Niklas Olsson <niklas.olsson@hotmail.co.uk>
2026-11-28 22:21:04 +01:00
pi0x
0e4708d23c js: give a Windows host's mounted files and directories the execute bits (#70)
Node on Windows reports no execute bits (0o666, or 0o444 for a read-only
file, directories included), so the guest could not enter a directory of
a nodeFs mount (EACCES) nor run a script or binary in it, and its chmod
cannot add the bit. On win32, nodeFs now adds x where r is, as WSL's
drvfs shows them (hostMode); other hosts' bits are unchanged.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: ARNO <arnochen101@gmail.com>
2026-11-28 21:34:51 +01:00
pi0x
277618959a js: keep host file systems in worker-mode snapshots taken with commit (#62)
* js: keep host file systems in worker-mode snapshots taken with commit: the owner saves its 9p servers' state while the worker holds the kernel at its consistent point, and fails the commit (the kernel goes on) while a request is unanswered or packets it sent have not reached the kernel (the worker counts those it delivered, snapshot-held's vsockIn); a restore in worker mode serves the mounts on the owner before the boot and passes the connections to keep to the worker's device (vsock.raw.keep)

Co-authored-by: Michael Lohr <michael@lohr.dev>
Co-authored-by: Claude <noreply@anthropic.com>

* js: describe host file systems in worker-mode snapshots where the docs still said inline only: VsockSnapshot.mounts, createKernel's restore, MountTable.snapshotBlocker() and the WASI binfmt test's unmount; rewrap the docs

---------

Co-authored-by: vibepodml[bot] <319756436+vibepodml[bot]@users.noreply.github.com>
Co-authored-by: Michael Lohr <michael@lohr.dev>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-11-28 21:22:33 +01:00
pi0x
bdebd1d538 vk: free the readback staging buffer when mapAsync fails (#65)
readTexture destroyed its MAP_READ staging buffer only after a
successful map, so a rejected mapAsync (a lost device, a validation
error) leaked it. Destroy it in a finally block, and check both the
failing and the succeeding path in test/vk.test.ts.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: Niklas Olsson <niklas.olsson@hotmail.co.uk>
2026-11-28 21:13:42 +01:00
pi0x
2262e13e61 js: connect routed names on other ports through the inner backend (#66) 2026-11-28 21:12:59 +01:00
pi0x
66be47dd47 js: recognise the distros' ⇒ prompt in the console router (#68)
ConsoleRouter marks user space on a shell prompt that ends in #, $, %
or >, but the Alpine and Debian images' prompt (kw-prompt.sh) ends in
"⇒ ", so a prompt that is user space's first output went unnoticed and
the page fell back to its 300 ms timer. Match ⇒ as well, as
guest/tools/vm-run.ts already does, and test the router on both
prompts without a boot.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: João Lucas de Oliveira Lopes <jlucaso@hotmail.com>
2026-11-28 21:11:52 +01:00
JeremySu0818
7cc79e1d63 feat(x64): implement single-tier Wasm SIMD JIT and differential fuzz suite
Add the x64 single-tier Wasm SIMD JIT implementing jitcore.Jit across alu, mem, branch, vec, and emit modules, wire lazy RFLAGS, data-TLB fast paths, cross-page regions, SMP epoch polling, AES-NI/SHA-256 Wasm codegen, and KWEMU_JIT_SIMD=0 scalar fallback, and pass all native, wasm64+jit, nosimd, guest lockstep, and upstream A64 regression gates.
2026-11-29 03:51:43 +08:00
chungchihhan
6a6a0e396c Enable Docker IPv4 bridge networking in Debian guests (#59)
* Enable Docker IPv4 bridge networking in Debian guests

* kernel: leave out the netfilter and bridge defaults Docker does not use

NETFILTER_INGRESS and NETFILTER_EGRESS (hooks for nft's netdev family,
which is not built), NF_CT_PROTO_SCTP and BRIDGE_IGMP_SNOOPING come on
by default with the options the Docker bridge needs; turning them off
saves 78,289 bytes of vmlinux32.wasm (25,917 bytes gzip). Re-export the
series: 0049, 0052 and 0055 carried index lines for the old
kw_defconfig.

* kernel: fix the conntrack hash size at 1024 buckets

Built-in conntrack allocates its hash table and the NAT bysource table,
which takes the same size, at boot also without rules, sized from RAM:
512 KiB each above 1 GiB, as on the page's 2 GiB default. A new generic
patch adds NF_CONNTRACK_HASHSIZE; kw_defconfig sets it to 1024, 8 KiB
per table, with nf_conntrack_max 8192. A 2 GiB guest keeps about 940 KiB
more free after boot.

---------

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-11-28 20:04:04 +01:00