Hmbown/CodeWhale · error · PersistenceBacklogError

unsupported RSS fields must be null

Error message

unsupported RSS fields must be null

What it means

validate_receipt requires that when rss_supported is false (non-macOS lanes), all RSS sample and delta fields (rss_before_bytes, rss_during_bytes, rss_after_bytes, rss_during_delta_bytes, rss_after_delta_bytes) are null. If any is non-null, the receipt claims unsupported platform memory data and the script rejects it. This keeps receipts from fabricating RSS measurements on platforms where sampling is not implemented.

Solutions

  1. Set all five RSS fields to null in receipts where rss_supported is false
  2. Re-measure on the correct platform so the receipt is generated with matching rss_supported and RSS fields
  3. Check the measurement script's rss_supported logic if a platform unexpectedly reports non-null RSS values

Example fix

// before
"rss_supported": false, "rss_before_bytes": 4096
// after
"rss_supported": false, "rss_before_bytes": null
Defensive patterns

Strategy: validation

Validate before calling

rss_fields = ("rss_before_bytes","rss_during_bytes","rss_after_bytes","rss_during_delta_bytes","rss_after_delta_bytes")
assert not receipt["rss_supported"] or all(receipt[f] is None for f in rss_fields), "non-macOS receipts must null all RSS fields"

Type guard

def rss_fields_ok(r):
    fields = ("rss_before_bytes","rss_during_bytes","rss_after_bytes","rss_during_delta_bytes","rss_after_delta_bytes")
    return r["rss_supported"] or all(r[f] is None for f in fields)

Try / catch

try:
    validate_receipt(receipt)
except PersistenceBacklogError as e:
    if "unsupported RSS fields must be null" in str(e):
        for f in ("rss_before_bytes","rss_during_bytes","rss_after_bytes","rss_during_delta_bytes","rss_after_delta_bytes"):
            receipt[f] = None
    raise

Prevention

When it happens

Trigger: validate_receipt (via validate_baseline_receipt or compare) reads a receipt with rss_supported=false but any of the five RSS fields set to a number or other non-null value.

Common situations: Copying a macOS receipt and flipping rss_supported to false without nulling the RSS fields; an older schema receipt migrated without clearing unsupported fields; hand-editing platform while keeping RSS numbers.

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/39011d787d22a556. Report an issue: GitHub.

Appendix: source

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

    if receipt["rss_supported"] != (platform == "macos"):
        raise PersistenceBacklogError(
            "rss_supported must be true exactly on the macOS measurement lane"
        )
    rss_fields = RSS_SAMPLE_FIELDS + RSS_DELTA_FIELDS
    if receipt["rss_supported"]:
        for field in rss_fields:
            non_negative_integer(receipt[field], field)
        before = receipt["rss_before_bytes"]
        if receipt["rss_during_delta_bytes"] != max(
            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")

View on GitHub (pinned to 433685b202)