wai-quantum: an optimisation stops and goes on to the same bytes #608
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/quantum-optimize-resume-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces #597: the same commit (same patch id), on main at
2bef11f71. Main had moved by 15 commits, among them #603, which runs each workflow's gate onlinuxrather than behind the arm64 work it gates; a pull request runs its own head's workflows, so #597 would have run the old ones.A long optimisation ran to its end in one process or not at all, and one killed partway lost every step. The optimiser now stops between any two steps and goes on later, to the same bytes.
What changes
wai-quantum (
engine::variational)optimize_resumable(request, from, each)runs from a checkpoint (from) or from the start. After every step but the last,eachgets the run as it stands (Paused), and returns whether to go on.call_optimizeis the same withcall's checks and stamp.optimizeisoptimize_resumablewith nothing stopping it, so its answers are unchanged.wai.quantum.optimize-checkpoint/1, fromPaused::checkpoint) holds:startand the request's digest;J052.verify, becauseverifyruns the request again.wai-quantum-cli:
optimize --checkpoint FILEkeeps the state in FILE as the run goes, at most once a second and whenever it stops. Each write goes toFILE.partialand is renamed, so a kill mid-write leaves the last whole state. The command goes on from FILE when FILE is there, and removes FILE once the run ends.--slice Ntakes at most N steps, then stops with the state kept and exits 2 (astask statusdoes while a task is active). The Chinese summary ofoptimizeis translated from its new English.The docs (
docs/variational.md, the CLI README) and the CLI's agent docs are updated.Tests
SIGKILLonce it has kept a state, then started again, says it is going on, and prints exactly the uninterrupted run's bytes.Checked
On the build host: the engine's variational, algorithm, schema and refusal tests;
cargo checkwith-D warningsfor the engine's feature sets; and the command line's tests (the new ones among them) and clippy, with and without default features. The public-name check is clean.🤖 Generated with Claude Code