Skip to content

feat: unify hosted ABI with reusable ASL runtime - #4

Merged
zhoubot merged 1 commit into
PTO-ISA:mainfrom
jiale-wangOwO:codex/merge-local-runtime
Sep 2, 2026
Merged

zhoubot merged 1 commit into
PTO-ISA:mainfrom
jiale-wangOwO:codex/merge-local-runtime

Conversation

@jiale-wangOwO

@jiale-wangOwO jiale-wangOwO commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR is stacked on #2 at its current head 0fcb5c6. It
keeps #2 as the single hosted entry and preserves its verified ELF sidecars,
versioned C ABI, lock/identity checks, manifest, result handling, and
ExecuteNextPTOInstruction runner.

It adds the reusable runtime layer that was missing from #2:

  • neutral ELF ProgramImage/segment contracts and checked loader integration;
  • sparse guest memory with permissions, BSS, stack banks, host-memory bridge,
    and atomic instruction transactions;
  • versioned architectural state, execution results, snapshots, deterministic
    serialization and hashes;
  • process and persistent ASLRef sessions with reset/snapshot lifecycle;
  • ASL-owned ELF stepping and a PE-aware runner with explicit completion and
    control-flow policies;
  • backend seams for the future native C++ implementation and differential
    comparison;
  • package path/bootstrap helpers, runtime documentation, tests, tools, and the
    checked smoke ELF fixture.

These modules do not implement a second PTO decoder or instruction handler.
The ASLRef backend remains the only semantic implementation; ASL continues to
define instruction legality, state changes, faults, and fetch/step behavior.
The existing pto_model_run_elf() ABI from #2 remains the consumer-facing C
entry.

Dependencies

  • Must be reviewed after and on top of #2.
  • The ASL-owned next-step implementation is aligned with
    PTO-ISA/pto-spec#188; this
    PR does not modify pto-spec.
  • Downstream gfrun integration should consume the merged model entry and must
    not restore a separate PTO semantic implementation.

Validation

  • Python unit/integration suite: 69 tests run, 61 passed, 8 optional
    external-environment tests skipped
  • CMake Release build with -Wall -Wextra -Werror: passed
  • CTest: 3/3 passed
  • python3 -m compileall: passed
  • git diff --check: passed

The branch was rebased onto #2 head 0fcb5c6; no pto-spec files are changed.

@jiale-wangOwO

Copy link
Copy Markdown
Collaborator Author

Update after exact-head integration check:

  • Added commit 02b2bdb to accept current PTO-SPEC#188 artifacts without requiring the temporary PTO_MODEL_* config family.
  • Added commit 08d9159 to fix the ASL length subtype in the worker wrapper.
  • The merged package keeps pto_model_run_elf() as the only hosted entry and uses ExecuteNextPTOInstruction for current artifacts.
  • CMake/CTest and the Python suite pass on the stacked branch.

The current PR188 reference profile still intentionally bounds the reference byte array. High-address/external physical-memory execution is isolated in PTO-SPEC#190; the model does not silently bypass that architectural profile. Full corpus/sidecar scaling remains issue #3.

@jiale-wangOwO

Copy link
Copy Markdown
Collaborator Author

Additional follow-up commits on the stacked branch:

  • 08d9159 fixes the ASL length subtype in the worker wrapper.
  • 7c68fa5 fixes standalone package/tool path names after the package rename.

Validation after these commits:

  • Python suite: 63 tests collected, 55 passed and 8 environment-dependent tests skipped in the clean contribution worktree.
  • CMake Release build and CTest: 3/3 passed.
  • compileall and git diff --check: passed.

A test against the clean PTO-SPEC#188 artifact also confirmed that the old profile config family is no longer required. The default reference profile intentionally retains its configured memory bound; external/high-address execution remains the separate #190/#3 scope.

@jiale-wangOwO

Copy link
Copy Markdown
Collaborator Author

This is the migration of the standalone prototype currently published at https://github.com/jiale-wangOwO/asl-model. It is intentionally based on #2 instead of replacing #2: the public C ABI and runner remain stable, while the richer runtime is folded into the same package. The personal prototype should not be treated as a second implementation after this stacked PR is reviewed.

@jiale-wangOwO

Copy link
Copy Markdown
Collaborator Author

Cross-repository decisions and merge order are now tracked in Issue #7. This PR remains the runtime extension stacked on #2 and must be reviewed after the base interface is accepted.

@zhoubot
zhoubot force-pushed the codex/merge-local-runtime branch 2 times, most recently from e785044 to 6814c9e Compare September 1, 2026 20:47
@zhoubot
zhoubot force-pushed the codex/aslref-reference-backend branch from c4c5f83 to 9a98f2a Compare September 2, 2026 04:33
@zhoubot
zhoubot force-pushed the codex/merge-local-runtime branch from 6814c9e to 0395ce7 Compare September 2, 2026 04:38
@zhoubot
zhoubot changed the base branch from codex/aslref-reference-backend to main September 2, 2026 04:38
@zhoubot
zhoubot marked this pull request as ready for review September 2, 2026 04:38
@zhoubot
zhoubot merged commit 0395ce7 into PTO-ISA:main Sep 2, 2026
1 check passed
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.

2 participants