Add diagnostic scan cross-check of the Hermes counters -- FABRIC-3.6.md task 2.8
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
2a2bf6eb35
commit
feace42397
@@ -88,6 +88,24 @@ uint64_t sk_hermes_audit_failure_count(void) {
|
||||
return sk_hermes_audit_failures;
|
||||
}
|
||||
|
||||
uint64_t sk_hermes_scan_held(size_t *live_count) {
|
||||
uint64_t sum = 0;
|
||||
size_t n = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SK_HERMES_MSG_MAX; i++) {
|
||||
if (!sk_hermes_msgs[i].in_use || sk_hermes_msgs[i].stadium_cell < 0) continue;
|
||||
sum += stadium_cells()[sk_hermes_msgs[i].stadium_cell].header.heat;
|
||||
n++;
|
||||
}
|
||||
if (live_count) *live_count = n;
|
||||
return sum;
|
||||
}
|
||||
|
||||
int sk_hermes_scan_check(void) {
|
||||
return sk_hermes_scan_held((size_t *)0) == sk_hermes_held;
|
||||
}
|
||||
|
||||
static int sk_hermes_find_free_slot(void) {
|
||||
int i;
|
||||
for (i = 0; i < SK_HERMES_MSG_MAX; i++) {
|
||||
|
||||
Reference in New Issue
Block a user