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>
4 lines
4.4 KiB
JSON
4 lines
4.4 KiB
JSON
{
|
|
"stream_observe.cpp": "#include \"stream.hpp\"\n#include <array>\n#include <iostream>\n#include <sstream>\n#include <string>\nusing captured::Bytes;\nnamespace {\nBytes unhex(const std::string& word) {\n if (word == \"-\") { return {}; }\n Bytes result;\n for (std::size_t i = 0; i < word.size(); i += 2) {\n result.push_back(static_cast<std::uint8_t>(std::stoul(word.substr(i, 2), nullptr, 16)));\n }\n return result;\n}\nstd::string hex(const Bytes& data) {\n if (data.empty()) { return \"-\"; }\n const char* digits = \"0123456789abcdef\";\n std::string result;\n for (std::uint8_t byte : data) {\n result.push_back(digits[byte >> 4]);\n result.push_back(digits[byte & 15]);\n }\n return result;\n}\n}\nint main() {\n std::array<captured::Device, 2> devices;\n unsigned selected = 0;\n std::string line;\n while (std::getline(std::cin, line)) {\n std::istringstream input(line);\n std::string operation;\n input >> operation;\n auto& device = devices[selected];\n std::uint64_t a = 0, b = 0;\n std::int64_t mode = 0;\n std::string word;\n std::cout << operation;\n if (operation == \"U\") {\n input >> selected;\n std::cout << ' ' << selected;\n } else if (operation == \"Z\") {\n input >> a;\n std::cout << ' ' << device.reset(a);\n } else if (operation == \"M\") {\n input >> mode;\n std::cout << ' ' << device.set_mode(mode);\n } else if (operation == \"G\") {\n std::cout << ' ' << device.get_mode();\n } else if (operation == \"C\") {\n std::cout << ' ' << device.capacity();\n } else if (operation == \"B\") {\n input >> a >> b;\n std::cout << ' ' << device.begin(a, b);\n } else if (operation == \"A\") {\n input >> a >> b >> word;\n const Bytes data = unhex(word);\n const auto result = device.append(a, data, b);\n std::cout << ' ' << result.status << ' ' << result.count << ' ' << hex(result.data) << ' ' << hex(data);\n } else if (operation == \"F\") {\n input >> a;\n std::cout << ' ' << device.finish(a);\n } else if (operation == \"X\") {\n input >> a;\n std::cout << ' ' << device.cancel(a);\n } else if (operation == \"R\" || operation == \"P\") {\n input >> a;\n const auto result = operation == \"R\" ? device.read(a) : device.peek(a);\n std::cout << ' ' << result.status << ' ' << result.count << ' ' << hex(result.data);\n } else if (operation == \"S\") {\n const auto stats = device.stats();\n std::cout << ' ' << stats.accepted << ' ' << stats.consumed << ' ' << stats.completed\n << ' ' << stats.canceled << ' ' << stats.buffered << ' ' << stats.active;\n } else if (operation == \"I\") {\n input >> a;\n const auto snapshot = device.inspect(a);\n std::cout << ' ' << snapshot.status << ' ' << snapshot.id << ' ' << snapshot.total\n << ' ' << snapshot.accepted << ' ' << snapshot.remaining << ' ' << snapshot.captured_mode;\n } else if (operation == \"L\") {\n const auto ids = device.active_ids();\n std::cout << ' ' << ids.size();\n for (auto id : ids) { std::cout << ' ' << id; }\n } else if (operation == \"T\") {\n input >> mode >> word;\n const Bytes data = unhex(word);\n const auto result = captured::transform(data, mode);\n std::cout << ' ' << hex(result) << ' ' << hex(data);\n } else if (operation == \"H\") {\n input >> word;\n const Bytes data = unhex(word);\n const auto result = captured::parse_mode(data);\n std::cout << ' ' << result << ' ' << hex(data);\n } else if (operation == \"N\") {\n input >> mode;\n const auto result = captured::mode_name(mode);\n std::cout << ' ' << result;\n } else if (operation == \"W\") {\n input >> word;\n const Bytes request = unhex(word);\n const auto result = device.packet(request);\n std::cout << ' ' << result.status << ' ' << hex(result.payload) << ' ' << hex(request);\n }\n std::cout << '\\n';\n }\n return 0;\n}\n"
|
|
}
|