RevisionLab
PyTorch-native delayed-feedback memory contracts, controls, and diagnostics.
RevisionLab records a prediction when it is issued, waits for its outcome to mature, and applies a residual-state update to the memory that owned the prediction. It provides a small substrate for testing delayed correction: immutable tickets, explicit memory interfaces, replay, negative controls, and resumable state.
v0.1 focuses on fixed-capacity residual memory and RLS correction. It does not implement Cosmos v14 state splitting or the v10 learned-refinement toy. It makes no claim to support every neural architecture. archcredit remains a separate architecture/credit benchmark library; RevisionLab does not depend on it.
Install and check
From a checkout with Python 3.10 or newer:
python -m pip install -e ".[dev]"
revisionlab-check
The check runs a small synthetic delayed-feedback example. It does not download weather data or replay the historical experiment.
Minimal API
import numpy as np
from revisionlab import ResidualMemory
from revisionlab.replay import DelayedReplay
runner = DelayedReplay(ResidualMemory(2, rate=0.1), horizon=2)
ticket = runner.issue(0, 1.0, np.array([1.0, 0.0]))
error = runner.release(ticket.ticket_id, target=2.0, now_hour=2)
assert ticket.prediction == 1.0
assert error == 1.0
assert runner.memory.read(np.array([1.0, 0.0])) == 0.1
See examples/delayed_forecast.py for a complete replay example. revisionlab.serialization.save_checkpoint(path, runner) and load_checkpoint(path) preserve delayed-feedback runners using the four native built-in correctors. Custom correctors and the NumPy reference are not supported by these checkpoint helpers in v0.1.
Contracts
| Boundary | Purpose |
|---|---|
| Prediction ticket | Keeps prediction-time key, baseline, actual forecast, maturity, and owner identity. |
| Released evidence | Rejects targets that have not matured and invalid timestamp/target fields. |
Memory read/write/snapshot |
Reads a correction, applies valid delayed evidence, and copies state. |
DelayedReplay |
Owns tickets, evaluates the issued forecast, and settles feedback exactly once. |
| Checkpoint | Preserves memory, replay owner, pending tickets, and settled identities for resume. |
| Local alignment | Compares a correction update with a local residual-loss reference direction. |
The NumPy reference and PyTorch-native implementations use fixed-capacity state. Negative controls are explicitly named; shuffled writes corrupt write addressing rather than demonstrating a new learning rule. A no-write control must preserve zero correction and perform no learning.
ResidualMemory(slots, rate) is the native normalized-delta corrector. revisionlab.baselines provides RLS_Corrector(slots, forget), NoWrite(slots), and ShuffledWrite(slots, rate, seed=...). See the method manifest for equations and clipping. Low-level memory write applies each valid call; exactly-once settlement is a DelayedReplay guarantee, not a guarantee of direct memory writes. Tickets retain prediction-time keys and forecasts, and the runner rejects duplicate/foreign settlement.
Memory values have fixed capacity. Replay retains settled ticket identities for lifetime deduplication, so its total audit ledger grows with settled forecasts; report that overhead alongside pending tickets. Do not call the entire runner constant-memory.
What the evidence means
Recovered v13 artifacts report the following historical mean joint MSE:
| Historical policy | Mean joint MSE |
|---|---|
| Frozen baseline | 2.122014 |
| Native live residual | 2.092176 |
| Live RLS | 2.070044 |
These are prior-run receipts for one site and the first half of 2026, across five weight seeds. The residual method improved on the frozen baseline in that recorded setting, while RLS had the lower mean MSE. This release has not rerun the full weather experiment, established superiority over RLS, or demonstrated generalization to other climates. See provenance and historical evidence.
The original shuffled-write policy used a fixed cyclic permutation. The release's seeded ShuffledWrite control is a distinct policy and does not reproduce that historical control automatically.
Local residual alignment rho is not full-model BPTT alignment. The delta primitive is differentiable, but that alone does not prove correct global credit assignment or causal memory capacity. Zero-norm directions have undefined alignment.
Development and contribution
python -m ruff check .
python -m ruff format --check .
python -m mypy src/revisionlab
python -m pytest
python -m build
python -m twine check dist/*
CONTRIBUTING.md explains the five-minute corrector recipe. CI covers Python 3.10/3.11/3.12, lint/format, types, tests, aot_eager compile/serialization/gradcheck, and wheel installation outside the checkout. A CI definition is not a claim that hosted jobs have already passed; current receipts belong in STATE.md.
See release steps for TestPyPI/PyPI handoff and the source audit for adversarial regression requirements. No PyPI upload automation is configured. Licensed under MIT; participation follows the Code of Conduct.
Local v0.1.0 validation: 95 tests passed, 1 CUDA hardware skip; lint/format, strict package types, and separate reviews passed. See verification evidence and release notes. Hosted and publication receipts are recorded separately.
Metadata
Release files for revisionlab 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| revisionlab-0.1.0.tar.gz | 40.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| revisionlab-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.4 kB
Release files / revisionlab-0.1.0.tar.gz
| Download URL | revisionlab-0.1.0.tar.gz |
|---|---|
| Size | 40.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8529a4c07ae9cb3672fe96168bb7ab71bdd205ddb428289285b1e54690d121f
|
|
BLAKE2b-256 checksum How to use checksums |
01fb6a707fa9987199fdfd51020041956ed64a96829899996b687440af885972
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / revisionlab-0.1.0-py3-none-any.whl
| Download URL | revisionlab-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd9500032333fd2cdb1a990e39f9c1d4c5e8b7556036eb79f167277dc73704e8
|
|
BLAKE2b-256 checksum How to use checksums |
70da650d93f9af665d1a424b148123d48ef76cbf6c8cca680cba39b6bd748616
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logSecurity for revisionlab 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for revisionlab-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.