amos 9d633e9e67 Batch 15 (20261023-C-hwe-scale-15): 320 HWE-derived repair tasks
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>
2026-10-27 01:55:56 +08:00

54 lines
2.0 KiB
C

#ifndef SEGMENT_H
#define SEGMENT_H
#include <stddef.h>
#include <stdint.h>
#define ST_MAX_ROWS 32u
#define ST_MAX_WIDTH 64u
#define ST_VALUE_LIMIT 1000000
typedef enum {
ST_OK = 0,
ST_INVALID = -1,
ST_NOMEM = -2,
ST_RANGE = -3,
ST_EMPTY = -4
} StResult;
typedef struct {
void *context;
void *(*allocate)(void *context, size_t bytes);
void (*release)(void *context, void *pointer);
} StAllocator;
typedef struct StTable StTable;
typedef struct {
size_t cells;
int64_t sum;
int minimum;
int maximum;
} StStats;
typedef struct {
size_t row;
size_t column;
uint64_t revision;
} StCursor;
StResult st_create(StAllocator allocator, StTable **output);
void st_destroy(StTable **table);
StResult st_clear(StTable *table);
StResult st_append(StTable *table, unsigned label, const int *values, size_t width);
StResult st_replace(StTable *table, size_t row, unsigned label, const int *values, size_t width);
StResult st_erase(StTable *table, size_t first, size_t count);
StResult st_get(const StTable *table, size_t row, size_t column, int *output);
StResult st_set(StTable *table, size_t row, size_t column, int value);
StResult st_shape(const StTable *table, size_t row, unsigned *label, size_t *width);
StResult st_stats(const StTable *table, size_t first, size_t count, StStats *output);
StResult st_select(const StTable *table, size_t first, size_t count, int64_t threshold, size_t *output);
StResult st_rebuild(const StTable *table, size_t first, size_t count, int reverse, StTable **output);
StResult st_flatten(const StTable *table, int *values, size_t capacity, size_t *needed);
StResult st_cursor_begin(const StTable *table, StCursor *cursor);
StResult st_cursor_next(const StTable *table, StCursor *cursor, size_t *row, size_t *column, int *value);
StResult st_equal(const StTable *left, const StTable *right, int *output);
StResult st_check(const StTable *table);
size_t st_rows(const StTable *table);
size_t st_cells(const StTable *table);
uint64_t st_revision(const StTable *table);
#endif