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

88 lines
1.8 KiB
C

#ifndef WORKER_BUNDLE_H
#define WORKER_BUNDLE_H
#include <stddef.h>
#include <stdint.h>
#define WB_MAX_JOBS 32
#define WB_MAX_SAMPLES 24
#define WB_MAX_WIDTH 8
#define WB_RT_BLOCKS 256
#define WB_RT_THREADS 32
#define WB_NOTRUN 0
#define WB_OK 1
#define WB_NOMEM 2
#define WB_BADRESULT 3
#define WB_START_ERROR 4
#define WB_INVALID 5
struct wb_job {
int seed;
int samples;
int scale;
int offset;
int threshold;
};
struct wb_request {
int count;
int width;
int fail_start;
int fail_alloc;
struct wb_job jobs[WB_MAX_JOBS];
};
struct wb_row {
int status;
int samples;
int minimum;
int maximum;
int below;
int equal;
int above;
int64_t sum;
int64_t energy;
uint32_t fingerprint;
};
struct wb_report {
int status;
int completed;
int failed;
int total_samples;
int winning_job;
int64_t sum;
int64_t energy;
uint32_t fingerprint;
struct wb_row rows[WB_MAX_JOBS];
};
struct wb_block {
void *pointer;
size_t size;
};
struct wb_thread {
int used;
int joined;
int token;
void *result;
};
struct wb_runtime {
struct wb_block blocks[WB_RT_BLOCKS];
struct wb_thread threads[WB_RT_THREADS];
int next_token;
int fail_start;
int fail_alloc;
int starts;
int launched;
int joined;
int active;
int attempts;
int failure_hit;
int live;
int bytes;
int errors;
};
typedef void *(*wb_worker_fn)(void *);
void wb_runtime_init(struct wb_runtime *, int, int);
void wb_runtime_reset(struct wb_runtime *);
void *wb_alloc(struct wb_runtime *, size_t);
void wb_free(struct wb_runtime *, void *);
int wb_start(struct wb_runtime *, wb_worker_fn, void *, int *);
int wb_join(struct wb_runtime *, int, void **);
int wb_execute(struct wb_runtime *, const struct wb_request *, struct wb_report *);
#endif