Hmbown/CodeWhale · error · PersistenceBacklogError

rss_supported must be true exactly on the macOS measurement

Error message

rss_supported must be true exactly on the macOS measurement lane

What it means

Raised in validate_receipt (scripts/check-persistence-backlog-budget.py:221-224) when rss_supported != (platform == "macos"). RSS memory samples are only defined on the macOS measurement lane, so a Linux/Windows receipt claiming RSS support — or a macOS receipt disclaiming it — breaks the measurement contract.

Source

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

        )
    applied = non_negative_integer(
        receipt["applied_version"], "applied_version"
    )
    if applied != FIXTURE["expected_applied_version"]:
        raise PersistenceBacklogError("applied_version is not the final sent version")
    if receipt["final_version_applied"] is not True:
        raise PersistenceBacklogError("final_version_applied must be true")

    limitations = receipt["limitations"]
    if not isinstance(limitations, list) or not limitations or not all(
        isinstance(item, str) and item for item in limitations
    ):
        raise PersistenceBacklogError("limitations must be a non-empty string array")

    if not isinstance(receipt["rss_supported"], bool):
        raise PersistenceBacklogError("rss_supported must be boolean")
    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")

View on GitHub (pinned to 8880682c63)

Solutions

  1. Derive rss_supported from the same platform constant written to the platform field: `rss_supported = platform == "macos"`.
  2. On macOS, make RSS sampling failures fail the measurement loudly instead of flipping the flag to false.
  3. On Linux/Windows, emit rss_supported=false and null RSS fields, then regenerate the receipt.

Example fix

// receipt (before, linux run)
"platform": "linux", "rss_supported": true
// receipt (after)
"platform": "linux", "rss_supported": false, "rss_before_bytes": null, /* ... */
Defensive patterns

Strategy: validation

Validate before calling

if receipt["rss_supported"] != (receipt["platform"] == "macos"):
    sys.exit("RSS support flag disagrees with the lane; derive it from the same platform constant")

Try / catch

try:
    validate_receipt(receipt)
except PersistenceBacklogError as e:
    if "macOS measurement lane" in str(e):
        raise RuntimeError("RSS flag/platform mismatch; set rss_supported = (platform == 'macos')") from e
    raise

Prevention

When it happens

Trigger: A Linux or Windows run emitting rss_supported=true (e.g. the flag hardcoded to true regardless of platform); a macOS run where RSS sampling failed and defaulted the flag to false; platform detection and the RSS flag computed from two different sources.

Common situations: Porting the measurement to a new OS while keeping the RSS branch enabled; macOS sandbox/permission issues silently disabling sampling; refactoring that decoupled the flag from the platform check.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/b9576092b2d99a07. Report an issue: GitHub.