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

67 lines
2.8 KiB
C++

#include "ledger.hpp"
#include <iostream>
#include <string>
using namespace instance;
int main() {
Ledger ledger;
std::string op;
while (std::cin >> op) {
Integer a = 0, b = 0, c = 0, d = 0, e = 0;
if (op == "I") {
std::cin >> a >> b;
Reply r = ledger.init(a, b);
std::cout << "I " << int(r.code) << ' ' << r.value << '\n';
} else if (op == "V") {
std::cin >> a;
Resource r = ledger.inspect(a);
std::cout << "V " << int(r.code) << ' ' << int(r.active) << ' '
<< r.epoch << ' ' << r.token << ' ' << r.owner << ' '
<< r.value << ' ' << r.waiters.size();
for (Integer p : r.waiters) std::cout << ' ' << p;
std::cout << '\n';
} else if (op == "P") {
std::cin >> a;
Participant r = ledger.actor(a);
std::cout << "P " << int(r.code) << ' ' << r.kind << ' ' << r.slot << ' ' << r.epoch << '\n';
} else if (op == "S") {
Summary r = ledger.summary();
std::cout << "S " << r.active << ' ' << r.owners << ' ' << r.waiting << '\n';
} else {
std::cin >> a >> b >> c;
Handle h{a, b, c};
if (op == "D") {
std::cout << "D " << int(ledger.destroy(h)) << '\n';
} else if (op == "R") {
Reply r = ledger.read(h);
std::cout << "R " << int(r.code) << ' ' << r.value << '\n';
} else if (op == "Z") {
Reply r = ledger.cancel_all(h);
std::cout << "Z " << int(r.code) << ' ' << r.value << '\n';
} else if (op == "T") {
std::cin >> d;
std::cout << "T " << int(ledger.retag(h,d)) << '\n';
} else {
std::cin >> d;
if (op == "L") std::cout << "L " << int(ledger.lock(h,d)) << '\n';
if (op == "N") std::cout << "N " << int(ledger.try_lock(h,d)) << '\n';
if (op == "U") std::cout << "U " << int(ledger.unlock(h,d)) << '\n';
if (op == "C") std::cout << "C " << int(ledger.claim(h,d)) << '\n';
if (op == "X") std::cout << "X " << int(ledger.cancel(h,d)) << '\n';
if (op == "Q") {
Reply r = ledger.position(h,d);
std::cout << "Q " << int(r.code) << ' ' << r.value << '\n';
}
if (op == "A") {
std::cin >> e;
std::cout << "A " << int(ledger.add(h,d,e)) << '\n';
}
if (op == "H") {
std::cin >> e;
std::cout << "H " << int(ledger.handoff(h,d,e)) << '\n';
}
}
}
}
return 0;
}