amos 2f32624d3b Batch 18 (20261026-C-hwe-codegen-18): add 100 calibrated HWE code-gen tasks; pause production for rollout
100 tasks from the HWE arm-linux code-gen pool (outside the lk/man/pth
range given to batch 22), each with at least one independent
contract-edge defect and plain public docs. Claude reviewed 100/100
USABLE against current digests; no ID or source overlap with main or
batch 22. Difficulty is unmeasured.

progress.md records the wrap-up: all Codex sessions and Qwen schedulers
stopped for the user's rollout, Qwen results so far (57 HARD of 373),
and what is left on each batch branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:52:13 +08:00

77 lines
2.0 KiB
C

#include "timer_internal.h"
static uint64_t visible_ticket(const tl_timer *timer)
{
switch (timer->phase) {
case TL_READY:
case TL_RUNNING:
case TL_DRAINING:
return timer->live.ticket;
default:
return 0;
}
}
int tl_view(tl_bank *bank, uint32_t id, tl_timer_view *out)
{
const tl_timer *timer = tl_lookup(bank, id);
tl_timer_view value;
if (timer == NULL) {
return TL_ID;
}
value.phase = timer->phase;
value.cancel_state = timer->cancel.state;
value.generation = timer->plan.generation;
value.deadline = timer->plan.deadline;
value.period = timer->plan.period;
value.tag = timer->plan.tag;
value.ticket = visible_ticket(timer);
value.cancel_generation = timer->cancel.generation;
value.cancel_serial = timer->cancel.serial;
value.arms = timer->counts.arms;
value.begins = timer->counts.begins;
value.ends = timer->counts.ends;
value.rearms = timer->counts.rearms;
value.cancelled_armed = timer->counts.cancelled_armed;
value.cancelled_ready = timer->counts.cancelled_ready;
*out = value;
return TL_OK;
}
int tl_bank_snapshot(tl_bank *bank, tl_bank_view *out)
{
tl_bank_view value;
uint32_t index;
value.now = bank->now;
value.slots = bank->slots;
value.phase_count[TL_IDLE] = 0;
value.phase_count[TL_ARMED] = 0;
value.phase_count[TL_READY] = 0;
value.phase_count[TL_RUNNING] = 0;
value.phase_count[TL_DRAINING] = 0;
for (index = 0; index < bank->slots; ++index) {
switch (bank->timers[index].phase) {
case TL_IDLE:
value.phase_count[TL_IDLE] += 1;
break;
case TL_ARMED:
value.phase_count[TL_ARMED] += 1;
break;
case TL_READY:
value.phase_count[TL_READY] += 1;
break;
case TL_RUNNING:
value.phase_count[TL_RUNNING] += 1;
break;
case TL_DRAINING:
value.phase_count[TL_DRAINING] += 1;
break;
}
}
*out = value;
return TL_OK;
}