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>
73 lines
1.7 KiB
C++
73 lines
1.7 KiB
C++
#ifndef ENGINE_INTERNAL_HPP
|
|
#define ENGINE_INTERNAL_HPP
|
|
#include "deferred.hpp"
|
|
#include <array>
|
|
#include <cstddef>
|
|
namespace deferred {
|
|
struct Batch {
|
|
Number count = 0;
|
|
Number sum = 0;
|
|
Number ticket = 0;
|
|
bool empty() const;
|
|
void clear();
|
|
void append(Number value, Number first_ticket);
|
|
Number transformed(Number cookie) const;
|
|
};
|
|
struct Ledger {
|
|
Number batches = 0;
|
|
Number count = 0;
|
|
Number sum = 0;
|
|
Number value = 0;
|
|
void account(const Batch& batch, Number cookie);
|
|
void clear();
|
|
};
|
|
struct Node {
|
|
Life life = VACANT;
|
|
Number generation = 0;
|
|
int priority = 0;
|
|
int quota = 0;
|
|
Number cookie = 0;
|
|
int depth = 0;
|
|
Batch pending;
|
|
Batch active;
|
|
Ledger ledger;
|
|
void install(int new_priority, int new_quota, Number new_cookie);
|
|
void retire();
|
|
bool eligible() const;
|
|
void export_view(View& out) const;
|
|
};
|
|
struct EventRing {
|
|
std::array<Event, 16> storage{};
|
|
std::size_t first = 0;
|
|
std::size_t used = 0;
|
|
Number sequence = 0;
|
|
void push(Event value);
|
|
int get(int index, Event& out) const;
|
|
Number size() const;
|
|
};
|
|
struct Engine::Impl {
|
|
std::array<Node, 16> nodes;
|
|
EventRing history;
|
|
int active_id = -1;
|
|
Number ticket = 1;
|
|
Number installs = 0;
|
|
Number starts = 0;
|
|
Number finishes = 0;
|
|
Number kills = 0;
|
|
Number errors = 0;
|
|
static bool valid_id(int id);
|
|
static bool valid_payload(Number value);
|
|
int reject(int status);
|
|
int lifecycle(int id) const;
|
|
int require_live(int id);
|
|
int acquire_gate(int id, bool synchronize);
|
|
void record(int kind, int id, const Batch& batch);
|
|
int select() const;
|
|
Action begin(int id);
|
|
Action complete(int id);
|
|
Action idle() const;
|
|
Summary totals() const;
|
|
};
|
|
}
|
|
#endif
|