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

58 lines
2.5 KiB
C++

#include "interest.hpp"
#include <iostream>
#include <cstdint>
using namespace interest;
static void print_view(const View& v) {
std::cout << ' ' << v.status << ' ' << v.live << ' ' << v.generation
<< ' ' << v.raw << ' ' << v.registered << ' ' << v.mask
<< ' ' << v.mode << ' ' << v.cookie << ' ' << v.armed
<< ' ' << v.pending << ' ' << v.queued;
}
static void print_batch(const Batch& b) {
std::cout << "B " << b.status << ' ' << b.events.size();
for (const auto& e : b.events) {
std::cout << ' ' << e.fd << ' ' << e.generation << ' ' << e.events << ' ' << e.cookie;
}
std::cout << '\n';
}
int main() {
Reactor reactors[2];
char command;
int instance;
std::int64_t a,b,c,d;
while (std::cin >> command >> instance) {
Reactor& r = reactors[instance];
switch (command) {
case 'O': std::cin >> a; std::cout << "R " << r.open(a) << '\n'; break;
case 'C': std::cin >> a; std::cout << "R " << r.close(a) << '\n'; break;
case 'D': std::cin >> a; std::cout << "R " << r.remove(a) << '\n'; break;
case 'A': std::cin >> a >> b >> c >> d; std::cout << "R " << r.add(a,b,c,d) << '\n'; break;
case 'M': std::cin >> a >> b >> c >> d; std::cout << "R " << r.modify(a,b,c,d) << '\n'; break;
case 'S': std::cin >> a >> b; std::cout << "R " << r.set_ready(a,b) << '\n'; break;
case 'K': std::cin >> a >> b; std::cout << "R " << r.clear_ready(a,b) << '\n'; break;
case 'W': std::cin >> a; print_batch(r.wait(a)); break;
case 'P': std::cin >> a; print_batch(r.peek(a)); break;
case 'I': std::cin >> a; std::cout << 'I'; print_view(r.inspect(a)); std::cout << '\n'; break;
case 'T': {
auto s=r.stats();
std::cout << "T " << s.opened << ' ' << s.registered << ' ' << s.queued
<< ' ' << s.armed << ' ' << s.effective << ' ' << s.waits << ' ' << s.emitted
<< ' ' << s.input_ready << ' ' << s.output_ready << ' ' << s.error_ready << ' ' << s.hangup_ready << '\n';
break;
}
case 'L': {
std::cin >> a >> b;
auto page=r.list(a,b);
std::cout << "L " << page.status << ' ' << page.next << ' ' << page.entries.size();
for (const auto& entry:page.entries) {
std::cout << ' ' << entry.fd;
print_view(entry.view);
}
std::cout << '\n';
break;
}
}
}
return 0;
}