amos 2f32624d3b Batch 18 (20261026-C-hwe-codegen-18): add 100 calibrated HWE code-gen tasks; pause production for rollout
100 tasks from the HWE arm-linux code-gen pool (outside the lk/man/pth
range given to batch 22), each with at least one independent
contract-edge defect and plain public docs. Claude reviewed 100/100
USABLE against current digests; no ID or source overlap with main or
batch 22. Difficulty is unmeasured.

progress.md records the wrap-up: all Codex sessions and Qwen schedulers
stopped for the user's rollout, Qwen results so far (57 HARD of 373),
and what is left on each batch branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:52:13 +08:00

97 lines
1.8 KiB
C++

#ifndef DEFERRED_HPP
#define DEFERRED_HPP
#include <cstdint>
namespace deferred {
using Number = std::int64_t;
enum Status {
OK = 0,
BAD_ID = 1,
BAD_VALUE = 2,
EXISTS = 3,
MISSING = 4,
DEAD_SLOT = 5,
LIMIT = 6,
UNBALANCED = 7,
BUSY = 8,
NO_EVENT = 9
};
enum Life {
VACANT = 0,
LIVE = 1,
DEAD = 2
};
enum StepKind {
START = 10,
FINISH = 11,
IDLE = 12
};
struct Action {
Number kind;
Number id;
Number generation;
Number count;
Number sum;
Number value;
};
struct View {
Number life;
Number generation;
Number priority;
Number quota;
Number cookie;
Number depth;
Number pending_count;
Number pending_sum;
Number pending_ticket;
Number active_count;
Number active_sum;
Number active_ticket;
Number completed_batches;
Number delivered_count;
Number delivered_sum;
Number delivered_value;
};
struct Summary {
Number installs;
Number live;
Number queued;
Number running;
Number starts;
Number finishes;
Number kills;
Number errors;
Number next_ticket;
Number events;
};
struct Event {
Number kind;
Number id;
Number generation;
Number count;
Number sum;
Number value;
Number serial;
};
class Engine {
public:
Engine();
~Engine();
Engine(const Engine&) = delete;
Engine& operator=(const Engine&) = delete;
int install(int id, int priority, int quota, Number cookie);
int post(int id, Number value);
int disable(int id);
int disable_nosync(int id);
int enable(int id);
int kill(int id);
Action step();
int view(int id, View& out) const;
Summary summary() const;
int event(int index, Event& out) const;
private:
struct Impl;
Impl* state_;
};
}
#endif