20 KiB
PEL/1-CORE — Primitive Execution Layer (Core Semantics)
Status: Approved Owner: Niklas Rydberg Version: 0.3.0 SoT: Yes Last Updated: 2025-11-16 Linked Phase Pack: N/A Tags: [execution, deterministic]
Document ID: PEL/1-CORE
Layer: L1 — Kernel execution semantics (pure value model)
Depends on (normative):
ASL/1-CORE v0.4.x— Artifact Substrate (logical value model)SUBSTRATE/STACK-OVERVIEW v0.1.x— kernel layering and invariants
Integrates with (informative):
ENC/ASL1-CORE v1— canonical encodings for Artifacts/ReferencesHASH/ASL1 v0.2.x— ASL1 hash family (identity handles)ASL/1-STORE v0.4.x— content-addressable store semanticsPEL/1-SURF(planned) — store-backed execution surfacePEL/PROGRAM-DAG/1(planned) — DAG-style program/profilePEL/TRACE-DAG/1(planned) — structured node-level execution trace
© 2025 Niklas Rydberg.
License
Except where otherwise noted, this document (text and diagrams) is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
The identifier registries and mapping tables (e.g. TypeTag IDs, HashId assignments, EdgeTypeId tables) are additionally made available under CC0 1.0 Universal (CC0) to enable unrestricted reuse in implementations and derivative specifications.
Code examples in this document are provided under the Apache License 2.0 unless explicitly stated otherwise. Test vectors, where present, are dedicated to the public domain under CC0 1.0.
0. Conventions
The key words MUST, MUST NOT, SHOULD, MAY, etc. are to be interpreted as described in RFC 2119.
PEL/1-CORE uses the ASL/1-CORE value model:
Artifact {
bytes: OctetString
type_tag: optional TypeTag
}
TypeTag {
tag_id: uint32
}
Reference {
hash_id: HashId
digest: OctetString
}
HashId = uint16
PEL/1-CORE:
- does not modify Artifact / Reference identity or equality,
- does not introduce new identity schemes,
- defines only logical value semantics — no storage layouts, protocols, or APIs.
It is independent of:
- any particular encoding profile,
- any hash-family choice,
- any store, graph, or certification system.
1. Purpose & Scope
1.1 Purpose
PEL/1-CORE defines the minimal kernel execution semantics for Amduat 2.0:
-
Execution is expressed as pure, deterministic functions over Artifacts.
-
A scheme defines how a program Artifact and input Artifacts are interpreted.
-
For a given scheme, program, inputs, and optional parameters, execution produces:
- a list of output Artifacts, and
- a scheme-level ExecutionResultValue describing the outcome.
The goal is a timeless, deterministic, storage- and graph-neutral execution substrate that:
- can be implemented as “metal-fast” engines (compiled, no dynamic dependency web), and
- can be wired into stores, provenance, and certification without entangling with them on the hot path.
1.2 Non-Goals
PEL/1-CORE explicitly does not define:
- Store semantics (
put/get, authority, replication, GC). - Graph/provenance edges (
TGK/1and its profiles). - Certification, signatures, or trust semantics (
CIL/1,FER/1,FCT/1). - Scheduling, work queues, or distributed orchestration.
- Authentication, authorization, or access control.
- Real-world time, randomness, or I/O APIs.
- Structure of program Artifacts (DAG vs non-DAG) — those are defined by scheme profiles.
All of these concerns live above or around PEL/1-CORE.
2. Core Concepts
2.1 SchemeRef
A scheme defines a particular execution semantics (language, calling convention, program structure, etc.).
At the core level, a scheme is identified by a SchemeRef:
SchemeRef = Reference // ASL/1-CORE Reference
SchemeRefrefers to a scheme descriptor Artifact.PEL/1-COREdoes not prescribe the content orTypeTagof that descriptor; those are defined by scheme-specific profiles (PEL/SCHEME/...).- Distinct scheme descriptors MUST have distinct
SchemeRefvalues (different content ⇒ different digest under ASL/1-CORE).
2.2 Logical Execution Call
At the value level, an execution is modeled as an ExecutionCall:
ExecutionCall {
scheme_ref : SchemeRef
program : Artifact
inputs : list<Artifact>
params : optional Artifact
}
Where:
scheme_refselects which scheme’s semantics apply.programis the program Artifact.inputsis an ordered list of input Artifacts.paramsis an optional parameters Artifact.
PEL/1-CORE does not constrain the internal structure of program, inputs, or params; that is scheme-level.
For a scheme s identified by scheme_ref, there exists a total pure function:
Exec_s :
(program: Artifact, inputs: list<Artifact>, params: optional Artifact)
-> (outputs: list<Artifact>, result: ExecutionResultValue)
PEL/TOTALITY/1 For every scheme that an environment claims to support,
Exec_sMUST be total over all possible(program, inputs, params)triples: it MUST always return a well-formed(outputs, ExecutionResultValue)pair, never “fall off the edge” (crash, panic) in-model. Invalid combinations must be mapped to appropriate error statuses, not to undefined behavior.
Totality at this level excludes environment failures (see §4.4).
2.3 ExecutionStatus and ExecutionErrorKind
PEL/1-CORE defines a shared classification of execution outcomes.
ExecutionStatus = uint8
ExecutionErrorKind = uint8
ExecutionStatus codes:
ExecutionStatus {
OK = 0
SCHEME_UNSUPPORTED = 1
INVALID_PROGRAM = 2
INVALID_INPUTS = 3
RUNTIME_FAILED = 4
}
OK— execution completed successfully under the scheme semantics.SCHEME_UNSUPPORTED— the environment does not implement the scheme identified byscheme_ref.INVALID_PROGRAM— the program Artifact cannot be interpreted as a valid program under the scheme.INVALID_INPUTS— inputs or parameters are invalid for the scheme.RUNTIME_FAILED— the scheme executed but signaled a deterministic failure (e.g., explicit error, assertion failure).
ExecutionErrorKind refines the source:
ExecutionErrorKind {
NONE = 0
SCHEME = 1 // scheme support/descriptor issues
PROGRAM = 2 // invalid program under scheme
INPUTS = 3 // invalid inputs/params under scheme
RUNTIME = 4 // runtime failure under scheme
}
Future values MAY be defined, but MUST maintain compatibility with existing meanings.
2.4 ExecutionErrorSummary
ExecutionErrorSummary gives a compact, deterministic classification:
ExecutionErrorSummary {
kind : ExecutionErrorKind
status_code : uint32 // 0 for success; non-zero for error
}
Semantics:
-
If
status = OK:kindMUST beNONE.status_codeMUST be0.
-
If
status = SCHEME_UNSUPPORTED:kindMUST beSCHEME.status_codeSHOULD be the canonical core code1.
-
If
status = INVALID_PROGRAM:kindMUST bePROGRAM.status_codeSHOULD be the canonical core code2.
-
If
status = INVALID_INPUTS:kindMUST beINPUTS.status_codeSHOULD be the canonical core code3.
-
If
status = RUNTIME_FAILED:kindMUST beRUNTIME.status_codeMUST be non-zero.- The concrete
status_codeis scheme-defined, but MUST be deterministic.
Scheme profiles MAY define sub-ranges of status_code for category grouping but MUST respect these invariants.
2.5 DiagnosticEntry
Schemes MAY provide additional deterministic diagnostics via DiagnosticEntry:
DiagnosticEntry {
code : uint32 // scheme-defined code
message : OctetString // scheme-defined bytes (SHOULD be UTF-8 text)
}
Requirements:
-
For a given execution, the list of
DiagnosticEntryvalues MUST be fully deterministic. -
Diagnostics MUST NOT include:
- wall-clock timestamps,
- random identifiers,
- host IDs, PIDs, or environment-dependent details.
Diagnostics are optional; their interpretation is scheme- or profile-specific.
2.6 ExecutionResultValue (logical)
ExecutionResultValue is the scheme-level result produced by Exec_s:
ExecutionResultValue {
pel1_version : uint16
status : ExecutionStatus
scheme_ref : SchemeRef
summary : ExecutionErrorSummary
diagnostics : list<DiagnosticEntry>
}
Semantics:
-
pel1_version:- MUST be set to
1for this version ofPEL/1-CORE. - Future versions MAY introduce new result formats under different encodings or TypeTags but MUST NOT change the meaning of
pel1_version = 1values.
- MUST be set to
-
statusandscheme_ref:statusreflects the outcome as in §2.3.scheme_refMUST equal the scheme identifier used for the call.
-
summary:- MUST obey §2.4 for the chosen
status.
- MUST obey §2.4 for the chosen
-
diagnostics:- MAY be empty.
- MUST be deterministic and scheme-defined.
ExecutionResultValue is a logical value; its encoding as an Artifact is defined by a separate profile (e.g., ENC/PEL1-RESULT/1), not by PEL/1-CORE.
3. Execution Schemes
3.1 Scheme definition
A scheme is the combination of:
- a
SchemeRef(descriptor Artifact), and - a concrete semantics
Exec_s.
For a given scheme_ref, a scheme definition MUST specify:
-
Program representation
- How
program : Artifactis interpreted. - Which
TypeTagvalues (if any) indicate valid program Artifacts. - Structural validity rules (DAG, bytecode, WASM module, etc.).
- How
-
Input and parameter representation
- How
inputs : list<Artifact>are decoded and mapped into the scheme’s runtime model (arguments, input buffers, configs, etc.). - How
params : optional Artifactis interpreted, if used.
- How
-
Output representation
- How produced values are encoded as output
Artifacts. - Any constraints on
TypeTagfor outputs.
- How produced values are encoded as output
-
Failure semantics
-
Conditions under which
statusbecomes:INVALID_PROGRAM,INVALID_INPUTS,RUNTIME_FAILED.
-
How
status_codeis chosen forRUNTIME_FAILED. -
Whether and how outputs are produced in each non-
OKcase.
PEL/FAIL-OUTPUT/REC/1 (RECOMMENDED) For
SCHEME_UNSUPPORTED,INVALID_PROGRAM, andINVALID_INPUTS, schemes SHOULD produce an emptyoutputslist. ForRUNTIME_FAILED, schemes MAY produce partial outputs, but MUST define that behavior clearly and deterministically. -
-
Deterministic diagnostics
- Rules for populating
diagnosticsas deterministic functions of(program, inputs, params)and the scheme’s semantics.
- Rules for populating
Formally, the scheme MUST define a total function:
Exec_s :
(program: Artifact, inputs: list<Artifact>, params: optional Artifact)
-> (outputs: list<Artifact>, result: ExecutionResultValue)
that is pure and deterministic (see §4), and always yields:
pel1_version = 1,scheme_refequal to the scheme’sSchemeRef,- a
statusandsummaryconsistent with §2.3–§2.4.
3.2 Scheme support in an environment
At the core level, an environment either:
-
Supports a scheme identified by
scheme_ref, in which case it implementsExec_s, or -
Does not support it, in which case any attempt to execute that scheme MUST yield an
ExecutionResultValuewith:status = SCHEME_UNSUPPORTED,scheme_ref = scheme_ref,summary.kind = SCHEME,summary.status_code = 1(canonical).
How scheme support is discovered (registries, configuration) is outside PEL/1-CORE.
3.3 Scheme profiles
Scheme definitions are typically captured in separate documents (e.g., PEL/SCHEME/WASM-1, PEL/PROGRAM-DAG/1) that:
-
Normatively reference
PEL/1-CORE. -
Provide:
- concrete program/data models,
- concrete error/status mappings,
- conformance vectors for
Exec_s.
PEL/1-CORE itself remains scheme-agnostic.
4. Determinism and Purity
4.1 Determinism contract
For a given scheme:
Exec_s(program, inputs, params) -> (outputs, result)
PEL/DET/1 — Determinism Invariant For any two PEL/1-CORE–conformant implementations
I1andI2of that scheme, and for anyprogram : Artifact,inputs : list<Artifact>,params : optional Artifact:Exec_s_I1(program, inputs, params) == Exec_s_I2(program, inputs, params)where:
outputslists are the same length and pairwise equal as Artifacts (ASL/1-CORE equality), andExecutionResultValuefields are equal (pel1_version,status,scheme_ref,summary, and the sequence ofDiagnosticEntrys).
Determinism MUST hold across:
- platforms,
- architectures,
- implementation languages,
- runtime environments,
given the same scheme definition and the same Artifacts.
4.2 Purity requirement
PEL/PURITY/1 — Purity Invariant
Exec_sMUST be a pure function of(scheme_ref, program, inputs, params)and the scheme definition:
-
No reads from external mutable state:
- No direct filesystem, network, environment variables, OS state, or external databases.
- Any required data MUST be supplied via Artifacts.
-
No writes to external state that influence other executions:
- Execution MUST NOT have side effects visible outside its outputs and
ExecutionResultValue. - Logging, metrics, or debugging output MUST NOT affect later runs.
- Execution MUST NOT have side effects visible outside its outputs and
-
No dependence on:
- wall-clock time,
- random sources (unless seeds are passed as inputs),
- process IDs, memory addresses, or other non-deterministic identifiers.
If a scheme requires time or randomness, these MUST be expressed as input Artifacts.
4.3 No graph, certification, or policy dependencies
PEL/HOT-PATH-ISOLATION/1 PEL/1-CORE execution semantics MUST NOT require:
- any graph backend (
TGK/1) or provenance structure to compute outputs, - any certification or trust system (
CIL/1,FER/1,FCT/1), - any governance or policy engine.
Such concerns may be applied around Exec_s (e.g., to authorize execution, or to interpret the result), but:
Exec_sMUST be definable and implementable purely over ASL/1 Artifacts and scheme semantics, and- no calls into TGK/1, CIL/1, or similar layers are required on the execution hot path.
4.4 Environment failures (out of model)
PEL/1-CORE does not define semantics for environment failures such as:
- out-of-memory,
- OS-level crashes or kills,
- implementation bugs or panics in the host environment.
If such failures occur:
- No
(outputs, ExecutionResultValue)pair is produced at the PEL/1-CORE level. - The run is considered out-of-model.
Higher layers (orchestration, SRE policy) MAY define:
- logging,
- retries,
- escalation or incident handling,
but such failures are not represented as valid ExecutionResultValue values under this spec.
5. Relationship to Stores and Surfaces (Informative)
5.1 Store-backed realizations
PEL/1-CORE is storage-neutral, but a typical realization over ASL/1-STORE looks like:
-
An engine receives:
scheme_ref : SchemeRef,program_ref : Reference,input_refs : list<Reference>,params_ref : optional Reference.
-
It uses
ASL/1-STOREgetto resolve:program_reftoprogram : Artifact,input_refstoinputs : list<Artifact>,params_ref(if present) toparams : Artifact.
-
It calls
Exec_s(program, inputs, params)perPEL/1-CORE. -
It uses
ASL/1-STOREputto:- persist
outputs : list<Artifact>and obtain theirReferences, - encode
ExecutionResultValueas anArtifactand persist it, obtaining a resultReference.
- persist
A surface specification (e.g., PEL/1-SURF) can normatively define:
- the store-backed API (e.g.,
run(store, scheme_ref, program_ref, input_refs, params_ref)), - mapping of store errors into higher-level envelopes,
- encoding of
ExecutionResultValueas an Artifact (TypeTag, bytes).
PEL/1-CORE does not prescribe these surfaces; it only constrains the pure mapping implemented in step 3.
5.2 Mapping errors in surfaces
PEL/1-CORE is unaware of store errors like ERR_NOT_FOUND, ERR_INTEGRITY, or ERR_UNSUPPORTED.
Surface profiles (e.g., PEL/1-SURF) MAY:
-
introduce additional wrapper structures that capture:
- store-level failures,
- missing inputs/programs,
- multi-store scenarios.
-
map such failures into rich surface-level results (not
ExecutionResultValues), potentially with:- failing
References, - store error codes,
- retry hints.
- failing
Within PEL/1-CORE itself, the only “unavailability” status is SCHEME_UNSUPPORTED, strictly about scheme support, not store availability.
6. Conformance
An implementation is PEL/1-CORE–conformant if and only if it satisfies all of:
-
Correct use of ASL/1-CORE types
- Treats
Artifact,TypeTag, andReferenceexactly as inASL/1-CORE v0.4.x. - Does not redefine Artifact or Reference identity or equality.
- Treats
-
Implements at least one scheme
-
For each supported
scheme_ref, implements a total function:Exec_s(program, inputs, params) -> (outputs, result)as described in §3 and §4.
-
For unsupported schemes, attempts to execute them yield an
ExecutionResultValuewith:status = SCHEME_UNSUPPORTED,scheme_refequal to the requested scheme,summary.kind = SCHEME,summary.status_code = 1.
-
-
Satisfies determinism
- For each supported scheme, satisfies PEL/DET/1 across all PEL/1-CORE–conformant implementations.
-
Satisfies purity
- For each supported scheme, satisfies PEL/PURITY/1.
- Any time or randomness must be supplied as input Artifacts.
-
Produces valid ExecutionResultValue
-
For every in-model execution, produces an
ExecutionResultValuewith:pel1_version = 1,scheme_refset correctly,statusset according to scheme semantics (§2.3),summaryconsistent withstatus(§2.4),diagnosticsdeterministic (if present).
-
-
Stays independent of higher layers on the hot path
- Does not require TGK/1, CIL/1, FER/1, FCT/1, or OI/1 to compute
Exec_s. - Any provenance edges, receipts, or facts are constructed after execution using Artifacts and
ExecutionResultValue, not during the core mapping.
- Does not require TGK/1, CIL/1, FER/1, FCT/1, or OI/1 to compute
-
Treats environment failures as out-of-model
-
Does not attempt to represent OS/hardware/environment failures as valid
ExecutionResultValuevalues. -
Clearly distinguishes:
- valid executions (producing
(outputs, ExecutionResultValue)), vs - environment failures (producing neither, handled outside
PEL/1-CORE).
- valid executions (producing
-
All other aspects — concrete APIs, store wiring, encoding, hash usage, scheduling, sandboxing, resource limits — belong to surfaces and higher-layer profiles, not to PEL/1-CORE, provided they do not contradict the requirements above.
7. Evolution (Informative)
PEL/1-CORE is intended to evolve additively:
- New
ExecutionStatusvalues MAY be added, but existing codes MUST retain their meaning. - New
ExecutionErrorKindvariants MAY be added, but existing variants MUST retain their meaning and relationships. - New result formats MAY be introduced under new
pel1_versionvalues, butpel1_version = 1semantics MUST remain stable.
Any change that would:
- alter the meaning of an existing
ExecutionStatus, or - alter the interpretation of an existing
pel1_version = 1field,
MUST be treated as a new major kernel surface (e.g., PEL/2-CORE), not an evolution of PEL/1-CORE.
This aligns with the broader Amduat principle:
Evolve by addition and explicit versioning; never rewrite identity or history.
Document History
- 0.3.0 (2025-11-16): Registered as Tier-1 spec and aligned to the Amduat 2.0 substrate baseline.