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

74 lines
2.4 KiB
C

#ifndef PROTOCOL_FIELDS_H
#define PROTOCOL_FIELDS_H
#include <stddef.h>
#include <stdint.h>
#define PF_CAPACITY 8u
enum pf_status {
PF_OK = 0,
PF_BAD_ID = 1,
PF_BAD_LAYOUT = 2,
PF_OVERLAP = 3,
PF_NOT_FOUND = 4,
PF_RANGE = 5,
PF_BAD_WORD = 6,
PF_FULL = 7
};
struct pf_field {
uint32_t id;
uint32_t width;
uint32_t offset;
uint32_t scale;
uint32_t bias;
uint32_t value;
};
struct pf_bank {
struct pf_field fields[PF_CAPACITY];
uint32_t count;
uint32_t word;
uint32_t epoch;
uint32_t writes;
uint32_t imports;
uint32_t rejects;
};
struct pf_info {
uint32_t present;
uint32_t width;
uint32_t offset;
uint32_t scale;
uint32_t bias;
uint32_t value;
uint32_t limit;
uint32_t token;
};
void pf_init(struct pf_bank *bank);
uint32_t pf_mask(uint32_t width);
uint32_t pf_limit(const struct pf_field *field);
uint32_t pf_bits(const struct pf_field *field);
int pf_shape(const struct pf_field *field);
int pf_find(const struct pf_bank *bank, uint32_t id);
int pf_layout(const struct pf_bank *bank);
uint32_t pf_occupied(const struct pf_bank *bank);
int pf_token(const struct pf_field *field, uint32_t value, uint32_t *token);
int pf_untoken(const struct pf_field *field, uint32_t token, uint32_t *value);
int pf_encode(const struct pf_bank *bank, uint32_t *word);
int pf_decode(const struct pf_bank *bank, uint32_t word, uint32_t *values);
int pf_add(struct pf_bank *bank, uint32_t id, uint32_t width,
uint32_t offset, uint32_t scale, uint32_t bias);
int pf_replace(struct pf_bank *bank, uint32_t id, uint32_t width,
uint32_t offset, uint32_t scale, uint32_t bias);
int pf_drop(struct pf_bank *bank, uint32_t id);
int pf_write(struct pf_bank *bank, uint32_t id, uint32_t value);
int pf_import(struct pf_bank *bank, uint32_t word);
int pf_zero(struct pf_bank *bank);
int pf_clear(struct pf_bank *bank);
int pf_read(const struct pf_bank *bank, uint32_t id, uint32_t *value);
void pf_info(const struct pf_bank *bank, uint32_t id, struct pf_info *info);
uint32_t pf_fingerprint(const struct pf_bank *bank);
uint32_t pf_minimum_word(const struct pf_bank *bank);
uint32_t pf_maximum_word(const struct pf_bank *bank);
uint32_t pf_value_sum(const struct pf_bank *bank);
uint32_t pf_value_weight(const struct pf_bank *bank);
uint32_t pf_layout_span(const struct pf_bank *bank);
uint32_t pf_free_bits(const struct pf_bank *bank);
#endif