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

64 lines
1.7 KiB
C++

#include "stream.hpp"
namespace captured {
namespace {
bool equals_ascii(const Bytes& input, const char* expected, std::size_t length) {
if (input.size() != length) {
return false;
}
for (std::size_t index = 0; index < length; ++index) {
const auto byte = static_cast<std::uint8_t>(expected[index]);
if (input[index] != byte) {
return false;
}
}
return true;
}
std::uint8_t uppercase(std::uint8_t byte) {
if (byte >= static_cast<std::uint8_t>('a') && byte <= static_cast<std::uint8_t>('z')) {
return static_cast<std::uint8_t>(byte - ('a' - 'A'));
}
return byte;
}
std::uint8_t lowercase(std::uint8_t byte) {
if (byte >= static_cast<std::uint8_t>('A') && byte <= static_cast<std::uint8_t>('Z')) {
return static_cast<std::uint8_t>(byte + ('a' - 'A'));
}
return byte;
}
}
int parse_mode(const Bytes& text) {
if (equals_ascii(text, "pass", 4)) {
return 0;
}
if (equals_ascii(text, "upper", 5)) {
return 1;
}
if (equals_ascii(text, "lower", 5)) {
return 2;
}
return -22;
}
std::string mode_name(std::int64_t mode) {
switch (mode) {
case 0:
return "pass";
case 1:
return "upper";
case 2:
return "lower";
default:
return "invalid";
}
}
Bytes transform(const Bytes& input, std::int64_t mode) {
Bytes output = input;
for (auto& byte : output) {
const unsigned folded = static_cast<unsigned>(byte | 32);
if (folded < 97 || folded > 122) { continue; }
if (mode == 1) { byte = static_cast<std::uint8_t>(byte & 223); }
if (mode == 2) { byte = static_cast<std::uint8_t>(byte | 32); }
}
return output;
}
}