Skip to content

SPEC-039 Phase-2: runtime bridge + FR-PKV10 contiguous KVCache (#887) - #889

Closed
Augustas11 wants to merge 1 commit into
mainfrom
fix/spec039-phase2-fr-pkv10-bridge
Closed

SPEC-039 Phase-2: runtime bridge + FR-PKV10 contiguous KVCache (#887)#889
Augustas11 wants to merge 1 commit into
mainfrom
fix/spec039-phase2-fr-pkv10-bridge

Conversation

@Augustas11

Copy link
Copy Markdown
Owner

SPEC-039 Phase-2 runtime bridge + FR-PKV10 (#887) — DRAFT, under independent audit

Implements the deferred runtime bridge that is allowed to activate the merged-but-inert paged engine (#814) and continuous-batching scheduler (#888).

Safety posture (verified): production never constructs a runtime observation, so resolveDecisionAndBridge fails closed and schedulerBackendAvailable/engineBridgeAvailable stay false — the feature is runtime-inert. Attach requires an observed-identity match against a trusted descriptor; admits() rejects empty/partial identity on all four fields (hardware/metallib/kernel/parity) + exact poolEpoch. No speculative-activation path.

Scope: Increment 1 (request-level attach + shared [B,1] forward adapter) + Increment 2 (FR-PKV10 contiguous KVCache extraction / reinjection / retain-reattach / mid-block trim).

Status: opened for CI + independent 3-lane codex audit. Real enable proof deferred to a >32GB Mac.

SPEC-GOVERNANCE-DECLARATION-BEGIN
{
"schema_version": "spec-pr-governance-v1",
"behavior_change": "yes",
"contract_change": "none",
"specs": ["SPEC-039"],
"requirements": ["SPEC-039-R010"],
"authority_domains": ["paged-kv-attention"],
"arbitration": ["CODE_BUG"],
"tests": ["swift test --filter PagedKVRuntimeBridgeTests", "swift test --filter PagedKVEngineTests"],
"journeys": ["not-required"]
}
SPEC-GOVERNANCE-DECLARATION-END

Increment 1 + 2 of the deferred SPEC-039 runtime bridge:
- PagedKVRuntimeBridge: request-scoped attach gated on observed-identity match vs
  a trusted descriptor (admits() rejects empty/partial identity on all four fields);
  live FR-PKV10 contiguous KVCache extraction, reinjection, retain/reattach, and
  mid-block trim; shared [B,1] forward backend adapter.
- ModelRuntime: schedulerBackendAvailable/requestedTuple exposed ONLY when the
  bridge is genuinely attached; production observation stays nil -> inert.
- Bridge + parity tests.

Default-off / runtime-inert: production never measures an observation, so attach
never fires. Real enable proof deferred to a >32GB Mac per the enable gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Augustas11

Copy link
Copy Markdown
Owner Author

Superseded by #894 (rebased revision). See #894 for the current state.

@Augustas11 Augustas11 closed this Aug 4, 2026
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