Skip to main content

PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY

PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY

ASL pseudocode

The complete ASL owner is shown directly below.

// PTO-UNIT: {"id":"PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY","surface":"arch","classification":["profile","trap-context-recovery"],"depends_on":["PTO-ARCH-PROFILE-REFERENCE-PROFILE"]}implementation func TrapContextRecoverable(target: AccessControlRing)    => booleanbegin    let control = PTOv0ReadContextRegister(target, 0x0f40);    let ecstate = PTOv0ReadContextRegister(target, 0x0f00);    let recovered_bpc = PTOv0ReadContextRegister(target, 0x0f41);    let recovered_tpc = PTOv0ReadContextRegister(target, 0x0f43);    return _TrapContexts[[target]].valid &&           control[4] == '1' &&           PTOv0EBARGControlLegal(control) &&           control[3:0] == ecstate[3:0] &&           recovered_bpc[0] == '0' &&           recovered_tpc[0] == '0';end;
implementation func RecoverTrapContext(target: AccessControlRing) => booleanbegin    if !TrapContextRecoverable(target) then        return FALSE;    end;    var control = PTOv0ReadContextRegister(target, 0x0f40);    let ecstate = PTOv0ReadContextRegister(target, 0x0f00);    let recovered_bpc = PTOv0ReadContextRegister(target, 0x0f41);    let recovered_tpc = PTOv0ReadContextRegister(target, 0x0f43);    WriteTPC(recovered_tpc);    WriteBPC(recovered_bpc);    _SystemRegisters.core_state = ecstate;    _BundleArgument = _TrapContexts[[target]].bundle_argument;    _CommitArgument = _TrapContexts[[target]].commit_argument;    _BundleActive = control[5] == '1';    _BundleBodyActive = control[6] == '1';    _BundleCommitTargetSet =        _TrapContexts[[target]].bundle_commit_target_set;    _BundleConditionSet =        _TrapContexts[[target]].bundle_condition_set;    _SystemBlockTerminalPending =        _TrapContexts[[target]].system_block_terminal_pending;    _BARG.block_type = PTOv0BundleKindOf(control[10:7]);    _BARG.transfer_type = PTOv0BundleTransferOf(control[13:11]);    _BARG.taken = control[14] == '1';    _BARG.bpcn = PTOv0ReadContextRegister(target, 0x0f42);    _FrameStackReturnTarget =        _TrapContexts[[target]].frame_stack_return_target;    _ReturnAddress = PTOv0ReadContextRegister(target, 0x0f44);    _BundleArgumentKind = _TrapContexts[[target]].bundle_argument_kind;    _BundleSequentialPC = _TrapContexts[[target]].bundle_sequential_pc;    _BundleOperation = _TrapContexts[[target]].bundle_operation;    _BundleDimensions = _TrapContexts[[target]].bundle_dimensions;    _BundleDimensionPresent =        _TrapContexts[[target]].bundle_dimension_present;    _BundleScalarBindings = _TrapContexts[[target]].bundle_scalar_bindings;    _BundleTileBindings = _TrapContexts[[target]].bundle_tile_bindings;    _BundleSharedBindings = _TrapContexts[[target]].bundle_shared_bindings;    _BundleRangeGroup = _TrapContexts[[target]].bundle_range_group;    _BundleZeroParticipationSeen =        _TrapContexts[[target]].bundle_zero_participation_seen;    _BundleControlAttributes =        _TrapContexts[[target]].bundle_control_attributes;    _BundleDataAttributes = _TrapContexts[[target]].bundle_data_attributes;    _BundleDataAttributesPresent =        _TrapContexts[[target]].bundle_data_attributes_present;    _BundleHint = _TrapContexts[[target]].bundle_hint;    _BundleFixedPointAttributes =        _TrapContexts[[target]].bundle_fixed_point_attributes;    _LocalGenerations = _TrapContexts[[target]].local_generations;    _SharedGenerations = _TrapContexts[[target]].shared_generations;    _BundleExecutionDomainToken =        _TrapContexts[[target]].bundle_execution_domain_token;    _MemoryCopyTemplate = _TrapContexts[[target]].memory_copy_template;    _FrameTemplate = _TrapContexts[[target]].frame_template;    for index = 0 to PTO_TEMPORARY_QUEUE_DEPTH - 1 do        _TQueue[[index]] = PTOv0ReadContextRegister(target, 0x0f45 + index);        _UQueue[[index]] = PTOv0ReadContextRegister(target, 0x0f49 + index);    end;    _TQueueValid = _TrapContexts[[target]].t_queue_valid;    _UQueueValid = _TrapContexts[[target]].u_queue_valid;    _PredicateRegisters = _TrapContexts[[target]].predicates;    _CurrentACR = UInt(ecstate[3:0]) as AccessControlRing;    control[4] = '0';    PTOv0WriteContextRegister(target, 0x0f40, control);    _TrapContexts[[target]].valid = FALSE;    return TRUE;end;

Architecture behavior

purpose scope

Purpose and scope

This unit implements PTO v0 validation and restoration of a saved trap context. Recovery is a checked, one-use state transition: an invalid envelope returns false without restoring execution state.

concepts state

Recoverability checks

TrapContextRecoverable requires a valid saved context, control bit 4 set, legal EBARG control, matching low 4 ACR bits in control and ECSTATE, and even recovered BPC and TPC values. It reads context registers 0x0f40, 0x0f00, 0x0f41, and 0x0f43.

rules interactions

Restoration sequence

RecoverTrapContext first repeats the recoverability check. On success it restores TPC, BPC, core state, bundle arguments and activity, bundle descriptors and bindings, generation state, templates, queues, predicates, return address, and the current ACR from the saved context and context registers.

boundaries

One-use and failure boundaries

Failed validation returns false before restoration. Successful recovery clears control bit 4, writes the updated control register, invalidates the saved context, and returns true. A second recovery attempt therefore requires a newly saved valid context.

example usage

illustrative recovery walkthrough

Use this example block only as a reading aid: apply the rules above, then confirm the result in the normative ASL owner. It does not add an architectural contract.

Related owners

  • Reference profile defines the PTO v0 context-register encoding helpers used here.
  • Fault precision and trap-context state own entry and saved-state creation that precede recovery.

NDF clauses

Bodies come from owning ASL. Dragging or buttons change only this page-session view order.

No NDF clause is attached to this unit.

Evidence index

8 matching entries

Executable evidence1
  • PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY compiles as an independent normative unit
    1. surfaceARCH
    2. ownerPTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY-STATIC-001
    Path
    tests/asl/arch/profile/trap-context-recovery/arch-static-trap-context-recovery-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    11dd4c20522e3d9795355802c04340394d768c55cb872bdfc12dbad8956550be
    Open exact source ↗ for PTO-AVS-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY-STATIC-001
Commit-scoped evidence5
  • spec/evidence/release-traceability-readiness.json · closedPTO-EVIDENCE-RELEASE-TRACEABILITY
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-TRACEABILITY
    Path
    spec/evidence/release-traceability-readiness.json
    Kind / role
    ASL/NDF/documentation/AVS traceability
    SHA-256
    c7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3e
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-TRACEABILITY
  • spec/evidence/instruction-contract-closure.json · closedPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Path
    spec/evidence/instruction-contract-closure.json
    Kind / role
    mnemonic and encoding contract closure
    SHA-256
    3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106a
    Open exact source ↗ for PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
  • spec/evidence/architecture-readiness.json · openPTO-EVIDENCE-ARCHITECTURE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-ARCHITECTURE-READINESS
    Path
    spec/evidence/architecture-readiness.json
    Kind / role
    architecture maturity and blockers
    SHA-256
    4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
    Open exact source ↗ for PTO-EVIDENCE-ARCHITECTURE-READINESS
  • spec/evidence/release-gate-readiness.json · ready-for-exact-head-verificationPTO-EVIDENCE-RELEASE-GATE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-GATE-READINESS
    Path
    spec/evidence/release-gate-readiness.json
    Kind / role
    exact-head gate readiness
    SHA-256
    a0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-GATE-READINESS
  • spec/release-manifest.json · draftPTO-EVIDENCE-RELEASE-MANIFEST
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-MANIFEST
    Path
    spec/release-manifest.json
    Kind / role
    release content and encoding fingerprints
    SHA-256
    1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-MANIFEST
Decision history2
  • PTO v0 concrete reference profile · accepted
    1. decision recordADR
    2. case0005

    Decision record

    Loading ADR-0005…

    Sources and references
    Complete stable ID
    ADR-0005
    Path
    docs/status/decisions/0005-pto-v0-concrete-reference-profile.md
    Affected units
    PTO-ARCH-PROFILE-APPLICABILITY, PTO-ARCH-PROFILE-E8M0-CONVERSION, PTO-ARCH-PROFILE-EXTENSION-FIRST-USE, PTO-ARCH-PROFILE-MATRIX-POSTPROCESS, PTO-ARCH-PROFILE-MATRIX-QUANTIZATION, PTO-ARCH-PROFILE-REFERENCE-PROFILE, PTO-ARCH-PROFILE-REFERENCE-QUANTIZATION, PTO-ARCH-PROFILE-RESET, PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY
    Affected NDF
    PTO-ARCH-EXTENSION-FIRST-USE-PROFILE-001, PTO-MATRIX-POSTPROCESS-BITEXACT-001, PTO-MATRIX-QUANT-BITEXACT-001, PTO-TCVT-E8M0-PROFILE-001
    SHA-256
    a83528c2fc744cc120c2a0a32c82410059638ea88936fa65ac0eb36a0274d87c
    Open exact decision source ↗ for ADR-0005
  • B.SUBVIEW and B.ASSEMBLE range-modifier association · accepted
    1. decision recordADR
    2. case0098

    Decision record

    Loading ADR-0098…

    Sources and references
    Complete stable ID
    ADR-0098
    Path
    docs/status/decisions/0098-b-range-modifiers.md
    Affected units
    PTO-ARCH-PROFILE-RESET, PTO-BLOCK-B-IOT, PTO-BLOCK-B-IOS, PTO-BLOCK-B-SUBVIEW, PTO-BLOCK-B-ASSEMBLE, PTO-BLOCK-MODEL-DISPATCH-COMMANDS, PTO-BLOCK-MODEL-OPERANDS-RANGE-MODIFIERS, PTO-BLOCK-MODEL-OPERANDS-SHARED-BINDINGS, PTO-BLOCK-MODEL-OPERANDS-TILE-BINDINGS, PTO-BLOCK-MODEL-STATE-CONTROL-STATE, PTO-BLOCK-MODEL-STATE-DESCRIPTOR-STATE, PTO-BLOCK-MODEL-STATE-TYPES, PTO-ARCH-DATA-TYPES-TRAP-CONTEXT, PTO-ARCH-PROFILE-REFERENCE-PROFILE, PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY, PTO-ARCH-STATE-TRAP-CONTEXT, PTO-BLOCK-MODEL-DISPATCH-TILE-EXECUTION, PTO-BLOCK-MODEL-DISPATCH-TILE-SCHEMA, PTO-BLOCK-MODEL-FAULTS-ROLLBACK, PTO-BLOCK-MODEL-LIFECYCLE-RESET, PTO-BLOCK-MODEL-OPERANDS-LOCAL-GENERATION, PTO-BLOCK-MODEL-OPERANDS-SHARED-GENERATION, PTO-BLOCK-MODEL-OPERANDS-PORTABLE-CARRIERS, PTO-BLOCK-MODEL-OPERANDS-SUBVIEW-DESCRIPTOR, PTO-BLOCK-MODEL-STATE-SHARED-GENERATION, PTO-TILE-MODEL-LEGALITY-MATRIX-POSTPROCESS
    Affected NDF
    PTO-B-IOT-STREAM-001, PTO-B-IOS-SHARED-STATE-001, PTO-B-SUBVIEW-RANGE-001, PTO-B-ASSEMBLE-RANGE-001, PTO-B-SUBVIEW-DESCRIPTOR-001, PTO-BLOCK-TILE-OPERATION-APPLICABILITY-001, PTO-B-ASSEMBLE-LOCAL-GENERATION-001, PTO-B-ASSEMBLE-SHARED-GENERATION-001, PTO-B-ASSEMBLE-SHARED-STANDALONE-001, PTO-B-ASSEMBLE-CONSUMER-READINESS-001, PTO-B-ASSEMBLE-SPECULATION-001, PTO-B-ASSEMBLE-PRODUCER-EFFECT-ELIGIBILITY-001
    SHA-256
    e194ccc6b6922fd4b65066b533f5e4b0eba094e099970059bca8e25b4e466fba
    Open exact decision source ↗ for ADR-0098

Unit metadata

Open 4 generated metadata fields
id
PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY
surface
arch
classification
[
  "profile",
  "trap-context-recovery"
]
depends_on
[
  "PTO-ARCH-PROFILE-REFERENCE-PROFILE"
]
Open generated traceability record
{
  "classification": [
    "profile",
    "trap-context-recovery"
  ],
  "documentation": "docs/arch/profile/trap-context-recovery.md",
  "id": "PTO-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY",
  "mnemonic": null,
  "readiness_subjects": [
    "ADR-0005",
    "ADR-0098"
  ],
  "semantic_tests": [],
  "source": "asl/arch/profile/trap-context-recovery.asl",
  "surface": "arch",
  "tests": [
    "PTO-AVS-ARCH-PROFILE-TRAP-CONTEXT-RECOVERY-STATIC-001"
  ]
}

Sources and release identity

Show commit, paths, hashes, version, and canonical owners
Release
0.58.5 · Release candidate
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
6c87ee4d53ed316f6ad72768ac84f67bcdf19c3af52dd96f3eb97eddc07c1357
Generated documentation
docs/arch/profile/trap-context-recovery.md · embedded in this page
Documentation SHA-256
8ba8fe4b76085c3c6ca002c57bab6f964c524e936f0b73e755fa3bf0acc33af7

Exact owners