Repository navigation
ADR-0010: device binding interface, schemas and conformance kit - #76
Draft
gspark-etri wants to merge 2 commits into
Draft
gspark-etri wants to merge 2 commits into
gspark-etri wants to merge 2 commits into
Conversation
onggi diff --ranges --json now carries schema onggi.rangeplan.v1, the base and target manifest digests, and per file a range plan that covers the file with same / elsewhere / new runs; elsewhere runs name a base file and offset holding the same bytes. Existing fields are unchanged. ADR-0010 (proposed) defines the plan as the only interface to a runtime's device binding and the binding's obligations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expands ADR-0010 from the range schema to the public interface a runtime implements: describe / resident / plan / apply / rollback as JSON in and out, levels B0-B2 and what onggi does at each, binding obligations. The diff schema is now onggi.switchplan.v1. JSON Schemas with examples under docs/schemas/; conformance/binding/ holds golden switch plans (kept equal to onggi diff by a Go test), a stdlib-only reference fake binding and conformance.py, run in CI at B1 and B2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks
Contributor
Author
|
Real-data check of
The decode switch is the expected binding case: two |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
For onggi to work with any accelerator, the runtime side needs one public, versioned interface. In the design only
two parts are vendor-specific: the publisher-declared variant coordinate and the runtime's device binding, which
maps byte ranges to device memory.
onggi diff --ranges --jsonwas already what runtime experiments read (#46,rngd-pd resident delta), but it had no schema or version, did not say which runs the base holds elsewhere or where,
and no document said what a runtime may assume or must guarantee.
Changes
docs/adr/0010-device-binding-contract.md(status proposed), "Device binding interface":BINDING <op>, stdin/stdout):describe(artifact) -> onggi.profile.v1,resident() -> onggi.resident.v1,plan(switchplan) -> updateplan | reload(pure),apply(updateplan, target) -> verification(staged, drained boundary, per-unit digests),rollback();verify, roll back, public vendor APIs only, ADR-0009);
B2 (all five: resident row-level updates) and what onggi does at each.
docs/schemas/: JSON Schema 2020-12 foronggi.switchplan.v1,onggi.updateplan.v1,onggi.verification.v1,onggi.resident.v1, with examples (onggi.profile.v1is feat: select and prepare artifacts by exact compatibility profile #71/Integrate verified delta comparison and compatible artifact preparation #72'sstore.Profile).pkg/store/diff.go: the diff JSON carriesschema: "onggi.switchplan.v1",base_manifest,manifest; with--rangeseach file gainsranges[]={offset, length, kind: same|elsewhere|new, source_file, source_offset}covering the file in order. All earlier fields unchanged.
conformance/binding/(Python 3.6+, stdlib, Apache-2.0): golden switch plans for four synthetic switches(identical, in place, shifted by 17,952 B, rearranged), their byte generator, a reference fake binding on a
simulated device of 4 KiB rows, and
conformance.py(plan purity, refusal for a non-resident base, coverage ofevery changed byte, apply digests = target, identity after apply, rollback digests = base, B1 always reloads).
Verification
TestRangePlan: runs cover each file in order, sums equalsame/moved/new, everysamerun equals the base atthat offset, every
elsewhererun equals the base bytes at its source; without--rangesthe plan is absent.TestGoldenSwitchPlans:onggi diff --ranges --jsonoutput equals the checked-in golden plans (manifest digestsaside, which carry creation times).
python3 conformance/binding/conformance.py(B2) and--level B1: 0 failed locally.jsonschema2020-12, command in docs/schemas/README.md).go test -race ./...,go vet ./...,gofmt -l .clean locally (Go 1.24.13 in golang:1.24-bookworm).Compatibility and limits
changedand all summary fields keep their meaning; text output unchanged. The currentrngd-pd consumer keeps working; it can move to
schema+files[].ranges(Codex owns rngd-pd).pkg/store/diff.go(reuse of the target plan aroundne/nodes); mechanical. Integrate verified delta comparison and compatible artifact preparation #72 definesonggi.profile.v1, which this ADR references unchanged.resident/plan/applyis follow-up work.Related Issue
Closes #75
🤖 Generated with Claude Code