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

76 lines
2.1 KiB
C

#ifndef PROFILE_H
#define PROFILE_H
#include <stddef.h>
#include <stdint.h>
#include "layout.h"
#define BANK_CAPACITY 8
#define BANK_SNAPSHOTS 2
#define PATCH_X 1u
#define PATCH_Y 2u
#define PATCH_GAIN 4u
#define PATCH_BIAS 8u
#define PATCH_LIMIT 16u
#define PATCH_ALL 31u
#define BANK_LINE_LIMIT 16384u
enum BankResult {
BANK_OK = 0,
BANK_RANGE = -1,
BANK_MISSING = -2,
BANK_EMPTY_SNAPSHOT = -3,
BANK_SYNTAX = -4
};
typedef struct {
int present;
uint64_t revision;
Profile profile;
} Slot;
typedef struct {
int valid;
Slot slots[BANK_CAPACITY];
} Snapshot;
typedef struct {
uint64_t epoch;
Slot slots[BANK_CAPACITY];
Snapshot snapshots[BANK_SNAPSHOTS];
} Bank;
typedef struct {
int64_t raw;
int64_t value;
int64_t distance;
int clipped;
} Measurement;
typedef struct {
size_t count;
int64_t x_total;
int64_t y_total;
int64_t limit_total;
size_t negative_gains;
size_t zero_limits;
uint64_t digest;
} Summary;
typedef struct {
int rc;
Measurement measurement;
} CommandResult;
void bank_init(Bank *bank);
int bank_put(Bank *bank, int64_t id, int64_t x, int64_t y,
int64_t gain, int64_t bias, int64_t limit);
int bank_patch(Bank *bank, int64_t id, int64_t mask, int64_t x,
int64_t y, int64_t gain, int64_t bias, int64_t limit);
int bank_delete(Bank *bank, int64_t id);
int bank_clone(Bank *bank, int64_t source, int64_t destination);
int bank_swap(Bank *bank, int64_t left, int64_t right);
int bank_save(Bank *bank, int64_t snapshot);
int bank_restore(Bank *bank, int64_t snapshot);
int bank_get(const Bank *bank, int64_t id, Profile *profile,
uint64_t *revision);
int bank_measure(const Bank *bank, int64_t id, int64_t x,
int64_t y, Measurement *measurement);
void bank_summary(const Bank *bank, Summary *summary);
void bank_command(Bank *bank, const char *line, CommandResult *result);
int profile_valid(const Profile *profile);
int bank_valid_id(int64_t id);
void profile_values(const Profile *profile, int64_t values[5]);
void measurement_clear(Measurement *measurement);
#endif