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

88 lines
3.1 KiB
C++

#include "runtime.hpp"
#include <iostream>
#include <sstream>
#include <string>
using namespace notify;
int main()
{
Runtime instances[2];
std::string line;
while (std::getline(std::cin, line)) {
std::istringstream input(line);
int instance;
char operation;
input >> instance >> operation;
Runtime& runtime = instances[instance];
const Runtime& observed = runtime;
int q = 0, a = 0, b = 0;
std::cout << instance << ' ' << operation;
switch (operation) {
case 'C':
input >> q >> a;
std::cout << ' ' << int(runtime.create(q, a));
break;
case 'X':
input >> q;
std::cout << ' ' << int(runtime.close(q));
break;
case 'A':
input >> q >> a >> b;
std::cout << ' ' << int(runtime.arm(q, a, b));
break;
case 'K':
input >> q >> a;
std::cout << ' ' << int(runtime.cancel(q, a));
break;
case 'S':
input >> q >> a >> b;
std::cout << ' ' << int(runtime.send(q, a, b));
break;
case 'R': case 'F': case 'M': {
input >> q;
Result<Message> result;
if (operation == 'R') result = runtime.receive(q);
if (operation == 'F') result = observed.front(q);
if (operation == 'M') { input >> a; result = observed.at(q, a); }
std::cout << ' ' << int(result.code) << ' ' << result.value.id << ' ' << result.value.value;
break;
}
case 'D': {
input >> q >> a;
auto result = runtime.drain(q, a);
std::cout << ' ' << int(result.code) << ' ' << result.value.size();
for (const auto& message : result.value) {
std::cout << ' ' << message.id << ' ' << message.value;
}
break;
}
case 'V': {
input >> q;
auto result = observed.snapshot(q);
auto v = result.value;
std::cout << ' ' << int(result.code) << ' ' << v.epoch << ' ' << v.capacity << ' ' << v.size << ' ' << v.owner << ' ' << v.cookie;
break;
}
case 'E': case 'I': {
input >> a;
auto result = operation == 'E' ? runtime.claim(a) : observed.inspect(a);
auto event = result.value;
std::cout << ' ' << int(result.code) << ' ' << event.serial << ' ' << event.queue << ' ' << event.owner << ' ' << event.cookie;
break;
}
case 'N': {
input >> a;
auto result = observed.pending(a);
std::cout << ' ' << int(result.code) << ' ' << result.value;
break;
}
case 'G': {
auto s = observed.stats();
std::cout << ' ' << s.created << ' ' << s.closed << ' ' << s.sent << ' ' << s.received << ' ' << s.discarded << ' ' << s.armed << ' ' << s.canceled << ' ' << s.notified << ' ' << s.claimed;
break;
}
}
std::cout << '\n';
}
return 0;
}