Skip to content

Implement packaging and VM. - #5

Open
tmzt wants to merge 8 commits into
mainfrom
main-packaging
Open

Implement packaging and VM.#5
tmzt wants to merge 8 commits into
mainfrom
main-packaging

Conversation

@tmzt

@tmzt tmzt commented Mar 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

tmzt and others added 8 commits March 2, 2026 00:05
…V, AR archives, SCL, RPN VM, Keyless

Implements the six major MTSM-VM subsystems on top of the existing 4-tier
register-mapped UI ISA. All 100 tests pass, zero new dependencies.

New modules: fqa, ova, aslr, addressing, arena, dmove, tkv, archive, scl,
keyless, rpn. Extended Op enum with ResolveFqa, Sync, ExecRpn, Dmove,
LoadArchiveMember. MatterStream gains arenas, resolver, rpn_vm, keyless fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…cle limit

Stress tests (48): exhaustive boundary tests for OVA bit-packing, arena
fill/sync/free cycles, ASLR 1000-entry tables, TKV deeply nested tables,
archive roundtrip with 50 members, RPN arithmetic chains and map stress.

Fuzz tests (28): randomized input fuzzing for TKV decoder (1000 seeds),
AR parser, ASLR deserializer, RPN VM (2000 seeds), SCL validator, and
Keyless classifier. All tests verify no panics on adversarial input.

Bugs found and fixed by fuzzing:
- TKV Table decoder: Vec::with_capacity(count) with untrusted count could
  attempt 191GB allocation. Fixed with cap to remaining data length.
- ASLR from_bytes: count*8 could overflow usize. Fixed with checked_mul.
- RPN VM: Call to random addresses could create infinite loops. Added
  max_cycles (default 1M) with CycleLimitExceeded error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dering

Extend the RPN VM with 9 zero-payload UI draw opcodes for 2D rendering:
UiSetColor, UiBox, UiSlab, UiCircle, UiText, UiPushState, UiPopState,
UiSetOffset, UiLine. Includes draw state management, alpha blending,
CPU rasterizers, gas metering (cost_ui=5), and MatterStream integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…igration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert root Cargo.toml from single-package to workspace manifest with
8 member crates. Cherry-pick 4 battle-tested subsystem crates from
main-packaging (vm-addressing, vm-arena, packaging, vm-scl). Create
matterstream-core from src/ ISA modules with refactored cross-crate
imports. Wire up matterstream-vm and matterstream-vm-asm with workspace
deps. Create matterstream facade crate re-exporting all subsystems.

All 376 tests pass across all crates. Examples build successfully.

Workspace structure:
- matterstream-vm-addressing: FQA/OVA addressing, ASLR tables
- matterstream-vm-arena: Triple-arena memory, DMOVE engine
- matterstream-packaging: TKV metadata, AR archives
- matterstream-vm-scl: SCL entropy guard, Keyless enforcement
- matterstream-core: ISA ops, registers, tiers, stream executor, RPN VM
- matterstream-vm: Enhanced RPN VM with events, hooks, GPU pipeline
- matterstream-vm-asm: Bytecode assembler with labels and helpers
- matterstream: Facade crate with full API surface

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rites

Add 15 new VM opcodes (float arithmetic, ZeroPage i32, component-aware bank
access), assembler helpers, WGSL compute+render shaders for the GPU SDF
pipeline, and rewrite all 3 game examples to use assembler-generated bytecode
instead of Rust loops. 412 tests pass (36 new).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tmzt
tmzt force-pushed the main-packaging branch from 91b6e3d to a0f10ff Compare March 2, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant