Repository navigation
Conversation
Extract the existing working fork feature for first maintainer feedback. Preserve carried code and tests; limit validation to lightweight structural checks. See the linked mechanism reference for actual API/call and failure paths.
Qubitium
force-pushed
the
upstream/35-v41-durable-frontiers-20261108
branch
from
November 9, 2026 10:00
f8b4aa7 to
72824f7
Compare
Qubitium
reviewed
Nov 9, 2026
Qubitium
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed against current main.
The durable-frontier format is atomic and authenticated end to end:
_save_statesnapshots tensors to owned contiguous CPU storage, encodes the state into a JSON manifest stored in safetensors metadata, writes to amkstempsibling,fsyncs, thenos.replaces andfsyncs the directory. The returned SHA-256 is computed over the published bytes, and the caller is expected to journal it only after save returns.- Provenance is mandatory and must round-trip through
json.dumps/json.loadsunchanged, which rejects tuples, integer keys, and NaN before they can be silently normalized. _load_stateverifies the journal digest first, then keeps the same inode open through/proc/self/fdso an atomic replacement cannot swap the file between checksum and mapping. It enforces manifest version, kind (with old snapshots defaulting toreplay), exact provenance, and rejects aliased or unreferenced tensors.save_frontier/load_frontierandsave_routed_batch/load_routed_batchtype-check the batch, validate geometry, and never treat a frontier as a completed block commit.
Validation: no in-tree tests for this layer, so I exercised it directly — save/load round-trip for a V41ReplayBatch and a V41RoutedBatch, plus checksum-mismatch and provenance-mismatch rejection all behaved as intended. Module imports cleanly; cleanup was import ordering and one dict(...) literal.
No blocking issues found.
Qubitium
marked this pull request as ready for review
November 9, 2026 10:00
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.
Summary
Carry atomic content-bound V4.1 frontier and routed-batch storage, typed tree encoding, exact provenance validation, and nested quantizer metric preservation.
This is layer 35/36, extracted from an already-used fork for initial maintainer feedback. It depends on #3614. Review only this feature; the cross-fork Files changed view is cumulative because the PR targets upstream
main.Incremental change: 3 files, +197/−0 lines, including carried tests and the mechanism reference. No merge is automatic. Review value and API shape first; substantial rework can follow that feedback.
Flow and existing-code boundary
flowchart TD S0["save_frontier"] S1["load_frontier"] S2["save_routed_batch"] S3["load_routed_batch"] E["ValueError"] S0 -->|"raises on rejected input/state"| E S1 -->|"raises on rejected input/state"| E S2 -->|"raises on rejected input/state"| E style E fill:#fee,stroke:#b22gptqmodel/utils/v41_checkpoint.py:131:save_frontiergptqmodel/utils/v41_checkpoint.py:138:load_frontiergptqmodel/utils/v41_checkpoint.py:152:save_routed_batchgptqmodel/utils/v41_checkpoint.py:161:load_routed_batchCommitted reference: docs/v41-durable-frontiers.md, linked from README. Class entry points/calls and rejected-state paths describe code present in this branch, rather than planned integrations.
Validation
Carried test files: No standalone test file existed in the fork for this helper; retained original implementation and documented the structural checks.
This packaging pass checked Python parsing, whitespace, dependency order and balanced Mermaid blocks. The author reports successful prior use of these features. Per the requested resource limit and feedback-first scope, existing model quantization, GPU/ROCm tests, heavyweight CPU workloads and full model benchmarks were not rerun; no new performance or model-accuracy claim is made. Tests accompanying earlier stack layers retain their previously reported results.
V4.1 remains an explicit native calibration/replay API and is not added to MODEL_MAP. The source requires its native/reference implementation; upstream inventory documentation alone does not provide that runtime.