One user-space repair task per eligible HWE debug-diag / compile-deploy base ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content filter. Each ships a public spec with a check-to-basis table, at least two defects with single-fix fixtures, a symptom-masking fixture and an alternative correct implementation. Claude re-checked all 320: structure, the HWE quality items and trace6 Docker calibration receipts against current digests (320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120 ad-hoc family names; the next batch maps them to the canonical list. The batch's 1,256-line progress log stays in its factory report and the 36-local branch batch15-hwe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
1.6 KiB
C
65 lines
1.6 KiB
C
#ifndef RR_H
|
|
#define RR_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
/* All sizes are byte counts. An open handle belongs to exactly one round. */
|
|
enum rr_status {
|
|
RR_OK = 0,
|
|
RR_BAD_PLAN = 1,
|
|
RR_OPEN_ERROR = 2,
|
|
RR_READ_ERROR = 3,
|
|
RR_CLOSE_ERROR = 4
|
|
};
|
|
|
|
struct rr_plan {
|
|
unsigned rounds;
|
|
unsigned read_hint;
|
|
};
|
|
|
|
struct rr_port {
|
|
int (*open_round)(void *context, unsigned round);
|
|
long (*read_bytes)(void *context, int handle, unsigned char *dst, size_t capacity);
|
|
int (*close_round)(void *context, int handle);
|
|
};
|
|
|
|
struct rr_round {
|
|
uint64_t bytes;
|
|
uint64_t digest;
|
|
uint64_t even_bytes;
|
|
uint64_t high_bytes;
|
|
uint64_t rising_pairs;
|
|
uint64_t first_byte;
|
|
uint64_t last_byte;
|
|
uint64_t range;
|
|
unsigned has_data;
|
|
};
|
|
|
|
struct rr_result {
|
|
enum rr_status status;
|
|
unsigned rounds_done;
|
|
uint64_t bytes;
|
|
uint64_t even_bytes;
|
|
uint64_t high_bytes;
|
|
uint64_t rising_pairs;
|
|
uint64_t checksum;
|
|
uint64_t digest_xor;
|
|
uint64_t longest;
|
|
uint64_t empty_rounds;
|
|
uint64_t range_sum;
|
|
};
|
|
|
|
int rr_plan_valid(const struct rr_plan *plan, const struct rr_port *port,
|
|
const struct rr_result *result);
|
|
size_t rr_read_size(const struct rr_plan *plan);
|
|
void rr_result_reset(struct rr_result *result);
|
|
void rr_round_reset(struct rr_round *round);
|
|
void rr_round_accept(struct rr_round *round, unsigned char byte);
|
|
void rr_result_commit(struct rr_result *result, unsigned round_index,
|
|
const struct rr_round *round);
|
|
enum rr_status rr_run(const struct rr_plan *plan, const struct rr_port *port,
|
|
void *context, struct rr_result *result);
|
|
|
|
#endif
|