{"record":{"id":"39011d787d22a556","repo":"Hmbown/CodeWhale","slug":"unsupported-rss-fields-must-be-null","errorCode":null,"errorMessage":"unsupported RSS fields must be null","messagePattern":"unsupported RSS fields must be null","errorType":"console","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":239,"sourceCode":"    if receipt[\"rss_supported\"] != (platform == \"macos\"):\n        raise PersistenceBacklogError(\n            \"rss_supported must be true exactly on the macOS measurement lane\"\n        )\n    rss_fields = RSS_SAMPLE_FIELDS + RSS_DELTA_FIELDS\n    if receipt[\"rss_supported\"]:\n        for field in rss_fields:\n            non_negative_integer(receipt[field], field)\n        before = receipt[\"rss_before_bytes\"]\n        if receipt[\"rss_during_delta_bytes\"] != max(\n            0, receipt[\"rss_during_bytes\"] - before\n        ):\n            raise PersistenceBacklogError(\"rss_during_delta_bytes is inconsistent\")\n        if receipt[\"rss_after_delta_bytes\"] != max(\n            0, receipt[\"rss_after_bytes\"] - before\n        ):\n            raise PersistenceBacklogError(\"rss_after_delta_bytes is inconsistent\")\n    elif any(receipt[field] is not None for field in rss_fields):\n        raise PersistenceBacklogError(\"unsupported RSS fields must be null\")\n\n\ndef validate_budget(budget: dict[str, Any]) -> None:\n    if budget.get(\"document_kind\") != BUDGET_KIND:\n        raise PersistenceBacklogError(f\"budget document_kind must be {BUDGET_KIND}\")\n    if budget.get(\"schema_version\") != SCHEMA_VERSION:\n        raise PersistenceBacklogError(\"budget schema_version changed\")\n    fixture = budget.get(\"fixture\")\n    if not isinstance(fixture, dict) or set(fixture) != set(FIXTURE):\n        raise PersistenceBacklogError(\"budget fixture no longer matches the frozen workload\")\n    for field, expected in FIXTURE.items():\n        if type(fixture[field]) is not type(expected) or fixture[field] != expected:\n            raise PersistenceBacklogError(\n                f\"budget fixture.{field} must remain {expected!r}\"\n            )\n    if budget.get(\"baseline_receipt\") != BASELINE_RECEIPT_REFERENCE:\n        raise PersistenceBacklogError(\"budget baseline_receipt path changed\")\n    ceilings = budget.get(\"ceilings\")","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L221-L257","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set all five RSS fields to null in receipts where rss_supported is false","Re-measure on the correct platform so the receipt is generated with matching rss_supported and RSS fields","Check the measurement script's rss_supported logic if a platform unexpectedly reports non-null RSS values"],"exampleFix":"// before\n\"rss_supported\": false, \"rss_before_bytes\": 4096\n// after\n\"rss_supported\": false, \"rss_before_bytes\": null","handlingStrategy":"validation","validationCode":"rss_fields = (\"rss_before_bytes\",\"rss_during_bytes\",\"rss_after_bytes\",\"rss_during_delta_bytes\",\"rss_after_delta_bytes\")\nassert not receipt[\"rss_supported\"] or all(receipt[f] is None for f in rss_fields), \"non-macOS receipts must null all RSS fields\"","typeGuard":"def rss_fields_ok(r):\n    fields = (\"rss_before_bytes\",\"rss_during_bytes\",\"rss_after_bytes\",\"rss_during_delta_bytes\",\"rss_after_delta_bytes\")\n    return r[\"rss_supported\"] or all(r[f] is None for f in fields)","tryCatchPattern":"try:\n    validate_receipt(receipt)\nexcept PersistenceBacklogError as e:\n    if \"unsupported RSS fields must be null\" in str(e):\n        for f in (\"rss_before_bytes\",\"rss_during_bytes\",\"rss_after_bytes\",\"rss_during_delta_bytes\",\"rss_after_delta_bytes\"):\n            receipt[f] = None\n    raise","preventionTips":["When changing platform or rss_supported, null all five RSS fields at the same time","Run validate_receipt on any receipt before committing it","Never copy RSS numbers from a macOS receipt onto a non-macOS receipt"],"tags":["validation","receipt","rss","nullability"],"backgroundTag":"schema-validation-failed","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}