Validate cellular trace length shapes
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (ecs) (push) Successful in 1m57s
Foundation / checks (checks) (push) Failing after 3m54s
Foundation / checks (client) (push) Failing after 4m26s
Foundation / checks (tsan) (push) Failing after 33s
Foundation / checks (network) (push) Failing after 3m4s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 1m34s

This commit is contained in:
dingo
2026-10-11 02:54:13 -04:00
parent 127c8e795a
commit b8a1288ee9
3 changed files with 37 additions and 11 deletions
+20 -8
View File
@@ -94,20 +94,32 @@ bool structural(const CheckpointManifest& m) noexcept {
if (m.manifest_version == 1)
return link && no_batch;
const auto ticks = m.end_tick - m.begin_tick;
const auto cellular_min = server::cellular_batch_header_bytes + ticks * 4;
const auto cellular_max = server::cellular_batch_header_bytes +
ticks * (server::cellular_batch_tick_header_bytes +
biology::max_cellular_tick_lives *
(server::cellular_batch_intent_bytes +
server::cellular_batch_birth_bytes));
const auto cellular_legacy_min =
server::cellular_batch_header_bytes + ticks * sizeof(std::uint32_t);
const auto cellular_current_min =
server::cellular_batch_header_bytes + ticks * server::cellular_batch_tick_header_bytes;
const auto cellular_max =
server::cellular_batch_header_bytes +
ticks * (server::cellular_batch_tick_header_bytes +
biology::max_cellular_tick_lives *
(server::cellular_batch_intent_bytes + server::cellular_batch_birth_bytes));
const auto cellular_legacy_max =
server::cellular_batch_header_bytes +
ticks * (sizeof(std::uint32_t) +
biology::max_cellular_tick_lives * server::cellular_batch_intent_bytes);
const bool cellular_current_trace =
b.trace_bytes >= cellular_current_min && b.trace_bytes <= cellular_max &&
(b.trace_bytes - cellular_current_min) % sizeof(std::uint64_t) == 0;
const bool cellular_legacy_trace =
b.trace_bytes >= cellular_legacy_min && b.trace_bytes <= cellular_legacy_max &&
(b.trace_bytes - cellular_legacy_min) % server::cellular_batch_intent_bytes == 0;
const bool trace_shape = primitive
? b.trace_bytes >= server::primitive_batch_header_bytes &&
b.trace_bytes <= server::max_primitive_batch_bytes &&
(b.trace_bytes - server::primitive_batch_header_bytes) %
server::primitive_birth_bytes ==
0
: cellular ? b.trace_bytes >= cellular_min &&
b.trace_bytes <= cellular_max
: cellular ? (cellular_current_trace || cellular_legacy_trace)
: b.trace_bytes == trace_bytes_for(ticks);
return link && trace_shape && !zero(b.trace_sha256) &&
b.decision_count <= max_batch_decisions &&