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>
68 lines
1.6 KiB
C++
68 lines
1.6 KiB
C++
#ifndef ENGINE_INTERNAL_HPP
|
|
#define ENGINE_INTERNAL_HPP
|
|
#include "deferred.hpp"
|
|
#include <algorithm>
|
|
#include <map>
|
|
#include <set>
|
|
#include <tuple>
|
|
#include <vector>
|
|
namespace deferred {
|
|
struct Operation {
|
|
char code;
|
|
int id = 0;
|
|
int priority = 0;
|
|
int quota = 0;
|
|
Number value = 0;
|
|
};
|
|
struct Request {
|
|
int id;
|
|
Number generation;
|
|
Number value;
|
|
Number ticket;
|
|
int phase;
|
|
};
|
|
struct Registration {
|
|
int life = VACANT;
|
|
Number generation = 0;
|
|
int priority = 0;
|
|
int quota = 0;
|
|
Number cookie = 0;
|
|
std::vector<Number> gates;
|
|
Number batches = 0;
|
|
};
|
|
struct TransitionResult {
|
|
int status = OK;
|
|
Action action{IDLE, -1, 0, 0, 0, 0};
|
|
};
|
|
struct RequestState {
|
|
std::map<int, Registration> registrations;
|
|
std::vector<Request> requests;
|
|
std::vector<Event> retained;
|
|
Number next_ticket = 1;
|
|
Number serial = 0;
|
|
Number installs = 0;
|
|
Number starts = 0;
|
|
Number finishes = 0;
|
|
Number kills = 0;
|
|
Number errors = 0;
|
|
Number gate_serial = 0;
|
|
static bool valid_id(int id);
|
|
static bool payload(Number value);
|
|
int lifecycle(int id) const;
|
|
std::vector<std::size_t> group(int id, int phase) const;
|
|
Action batch(int kind, int id, const std::vector<std::size_t>& members) const;
|
|
void emit(int kind, const Action& action);
|
|
Action finish(int id);
|
|
Action tick();
|
|
TransitionResult apply(const Operation& operation);
|
|
int inspect(int id, View& out) const;
|
|
Summary totals() const;
|
|
};
|
|
struct Engine::Impl {
|
|
RequestState model;
|
|
RequestState snapshot() const;
|
|
TransitionResult commit(Operation operation);
|
|
};
|
|
}
|
|
#endif
|