Repository navigation
D1A 0.5.0
D1A learns from its outcomes on its own: a settings file for the self-learning loop, replay of every earlier outcome onto a new model, a scheduled gate, and learned flags served beside the answer. The 0.3 module paths are gone, and the model server no longer aborts when photo, voice or video requests overlap other work on Apple Silicon.
What's new
- Self-learning you can configure.
D1A_LEARNING=<file>holds the loop's settings (python -m d1a.learning.feedback config init|show|set|validate);feedback tickreplays earlier outcomes onto the served model, fail-closed on anything it trained on, and runs the promotion gate after N new outcomes or at a daily time. See docs/CONFIGURATION.md, "Self-learning". - Learned flags in answers. A flag fitted offline with
python -m d1a.learning.flagsand listed in the settings file is served inside its question's answer (flags.<name>), without changing the answer. None is configured by default. - A stable server on Apple Silicon. Overlapping media and text requests no longer crash the server (#244): a 45-minute stress run of 756 media and 2,136 text requests ended with no abort, where 0.4.0 aborted within seconds.
- A smaller package surface. The 27 flat module paths of 0.3 are removed, and new runs are saved without
head.pt.
Added
recipes/swe-verifier: OpenHands runs (nebius/SWE-rebench-openhands-trajectories, CC-BY-4.0) can be scored, throughfrom_openhands.pyandzero_shot.py/self_improve.py --source openhands(#248). Also new:--keep-issue-md(keep the harness's issue.md diff, to measure that shortcut),--exclude(a sample disjoint from an earlier draw) and--issues. The default source, the SWE-agent runs, gives the same rows as before.- The server serves learned flags (#237, part 2): a flag in the
D1A_LEARNINGfile'sflags, fitted for the served run, is added inside its question's answer (flags.<name>:on,p,t,space), computed on the model's own probabilities before the outcome calibrator, and kept in the decision log's meta. The answer never changes, and the file is re-read when it changes, so a flag is served or withdrawn without a restart. - Self-learning v2 (#233, #240):
- Settings file.
D1A_LEARNING=<file>holds the loop's settings, validated, with a last-valid fallback and an audit log.python -m d1a.learning.feedback config init|show|set|validatemanages it. Unset, everything behaves as before. - Replay.
feedback replayandfeedback tickre-score an earlier model's decisions that have outcomes through the live server (headerx-d1a-replay-of), so a new model starts with every earlier outcome. It is fail-closed: no replay without the served model's complete trained manifest (feedback trained), and none for a decision whose PR or state is in that model's training, or that has no PR id. For E4B v0.6, v0.2 run 1's mix is lost, so its subsets are covered by the whole partitions they came from (night2 dates and unknowable, the hard, devtools and documents train partitions): the exclusion is a superset by partition. - The tick runs the gate after N new outcomes or at a daily time. Each gate report gives
mde, the smallest log-loss gain its held-out set can detect, and the gate's interval level is a setting. d1a/core/settings.pylists everyD1A_*setting with its default and reader, every module reads them through it, andpython -m d1a.serving.serve --show-configprints them (secrets masked).
- Settings file.
Changed
- A new run is saved without
head.pt(d1a_config.jsonandhead.safetensorsonly), as 0.4 announced. A run from before 0.4 keeps itshead.pt, rewritten with the new metadata (a recalibration, say), so its two copies never disagree; readinghead.ptstays.
Removed
- The flat module paths of D1A 0.3 (
d1a.serve,d1a.feedback,d1a.train, and the 24 others;python -m d1a.<old>), shims since 0.4: import and rund1a.serving.serve,d1a.learning.feedback,d1a.training.train, ... instead.d1a/_layout.pykeeps the old-to-new map for the provenance scripts. No caller of ours used an old path.
Fixed
- The model server could abort on Apple Silicon ("commit an already committed command buffer") when photo, voice or video requests overlapped other work (#244): torch's MPS stream is not thread-safe, yet an MLX model's thread synced it on every batch while the media encoder used it from a request thread. With an MLX model the model thread no longer touches torch's MPS stream (MLX waits for its own work), and the encoder copies its result to the CPU under its lock. Text and media still run side by side.
Models tested with this release
| Checkpoint | Hugging Face tag |
|---|---|
| D1A-E4B v0.6, PyTorch | JohnP1/d1a-e4b@v0.6 |
| D1A-E4B v0.6, MLX 8-bit (with photo, voice and video encoders) | JohnP1/d1a-e4b-mlx-q8@v0.6 |
| D1A-E4B v0.6, Core ML (text, ≤ 512 tokens) | JohnP1/d1a-e4b-coreml@v0.6 |
| D1A-E2B v0.6, PyTorch | JohnP1/d1a-e2b@v0.6 |
| D1A-E2B v0.6, MLX 8-bit (with photo, voice and video encoders) | JohnP1/d1a-e2b-mlx-q8@v0.6 |
| D1A-E2B v0.6, Core ML (text, ≤ 512 tokens) | JohnP1/d1a-e2b-coreml@v0.6 |
The Mac mini serves JohnP1/d1a-e4b-mlx-q8@v0.6 with this code (demo smoke test 145/145), and the quality gate on real weights finds no changed answer between 0.4.0 and 0.5.0. Package 0.5.0 serves every model tag from v0.1 to v0.6.
Upgrade notes (from 0.4.0)
- The 0.3 module paths (
d1a.serve,d1a.feedback,d1a.train, ...) are removed: used1a.serving.serve,d1a.learning.feedback,d1a.training.train, ... (d1a/_layout.pylists every old-to-new name). - New runs have no
head.pt, so D1A 0.3 cannot load them; 0.4 and later can. Runs that have ahead.ptstill load. - New settings:
D1A_LEARNING(the self-learning settings file). With it unset, nothing changes. - An answer may carry a
flagsfield when a flag is configured; clients that read answers strictly should allow it.