Hmbown/CodeWhale · error · PersistenceBacklogError

budget fixture no longer matches the frozen workload

Error message

budget fixture no longer matches the frozen workload

What it means

validate_budget checks that budget.fixture is a dict with exactly the same key set as the script's frozen FIXTURE workload (fixture_id, request_variant, payload_estimator, paused_consumer, requests_attempted, content_bytes_per_request, single_session_id, expected_applied_version). If the key set differs — extra or missing keys, or fixture is not an object — the budget no longer describes the same frozen benchmark and the checker aborts.

Solutions

  1. Restore the fixture object to exactly the 8 frozen keys with the frozen values defined in FIXTURE in the script
  2. Regenerate the budget from the current script version
  3. If the workload legitimately changed, change FIXTURE in the script and regenerate the budget/ceilings together, never the budget alone

Example fix

// before
{ "fixture": { "fixture_id": "x", "requests_attempted": 64 } }
// after
{ "fixture": { "fixture_id": "paused-production-channel-session-snapshot-v1", "request_variant": "session_snapshot", "payload_estimator": "retained-saved-session-json-bytes-v1", "paused_consumer": true, "requests_attempted": 128, "content_bytes_per_request": 65536, "single_session_id": true, "expected_applied_version": 127 } }
Defensive patterns

Strategy: validation

Validate before calling

from check_persistence_backlog_budget import FIXTURE
budget = json.load(open("scripts/persistence-backlog-budget.json"))
assert isinstance(budget.get("fixture"), dict) and set(budget["fixture"]) == set(FIXTURE), "fixture keys must exactly match the frozen FIXTURE"

Type guard

def has_frozen_fixture_keys(doc):
    return isinstance(doc, dict) and isinstance(doc.get("fixture"), dict) and set(doc["fixture"]) == set(FIXTURE)

Try / catch

try:
    validate_budget(budget)
except PersistenceBacklogError as e:
    if "frozen workload" in str(e):
        print("fixture key set changed; restore the exact FIXTURE keys")
    raise

Prevention

When it happens

Trigger: compare calls validate_budget and the budget's fixture object has keys that do not exactly equal set(FIXTURE): someone added a key, removed one, renamed one, or fixture is missing/null.

Common situations: Hand-editing the fixture to change workload size (e.g. requests_attempted) without understanding it is frozen; an older budget from before a fixture field was added; copying a different project's budget file.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/505ad04fda5c528c. Report an issue: GitHub.

Appendix: source

Thrown at scripts/check-persistence-backlog-budget.py:249

            0, receipt["rss_during_bytes"] - before
        ):
            raise PersistenceBacklogError("rss_during_delta_bytes is inconsistent")
        if receipt["rss_after_delta_bytes"] != max(
            0, receipt["rss_after_bytes"] - before
        ):
            raise PersistenceBacklogError("rss_after_delta_bytes is inconsistent")
    elif any(receipt[field] is not None for field in rss_fields):
        raise PersistenceBacklogError("unsupported RSS fields must be null")


def validate_budget(budget: dict[str, Any]) -> None:
    if budget.get("document_kind") != BUDGET_KIND:
        raise PersistenceBacklogError(f"budget document_kind must be {BUDGET_KIND}")
    if budget.get("schema_version") != SCHEMA_VERSION:
        raise PersistenceBacklogError("budget schema_version changed")
    fixture = budget.get("fixture")
    if not isinstance(fixture, dict) or set(fixture) != set(FIXTURE):
        raise PersistenceBacklogError("budget fixture no longer matches the frozen workload")
    for field, expected in FIXTURE.items():
        if type(fixture[field]) is not type(expected) or fixture[field] != expected:
            raise PersistenceBacklogError(
                f"budget fixture.{field} must remain {expected!r}"
            )
    if budget.get("baseline_receipt") != BASELINE_RECEIPT_REFERENCE:
        raise PersistenceBacklogError("budget baseline_receipt path changed")
    ceilings = budget.get("ceilings")
    baseline = budget.get("baseline_observation")
    if not isinstance(ceilings, dict) or not isinstance(baseline, dict):
        raise PersistenceBacklogError("budget needs ceilings and baseline_observation objects")
    for field in CEILING_FIELDS:
        ceiling = non_negative_integer(ceilings.get(field), f"ceilings.{field}")
        observed = non_negative_integer(
            baseline.get(field), f"baseline_observation.{field}"
        )
        if observed > ceiling:
            raise PersistenceBacklogError(

View on GitHub (pinned to 433685b202)