Hmbown/CodeWhale · error · PersistenceBacklogError

receipt platform is unsupported

Error message

receipt platform is unsupported

What it means

The receipt's `platform` field must be a string in `SUPPORTED_PLATFORMS = {"linux", "macos", "windows"}`. The persistence backlog fixture is only certified on these three lanes; any other platform name (or a non-string value) means the measurement's RSS and queueing semantics were never validated there, so the checker refuses the receipt.

Solutions

  1. Set `platform` to exactly one of "linux", "macos", or "windows" (lowercase)
  2. Normalize the producer: map `platform.system()` ("Darwin"→"macos", "Windows"→"windows", "Linux"→"linux") before writing the receipt
  3. Regenerate the receipt on a supported platform; extend SUPPORTED_PLATFORMS in the script only if the platform is genuinely certified

Example fix

// before (producer)
"platform": platform.system()          # "Darwin"
// after
"platform": {"Darwin": "macos", "Linux": "linux", "Windows": "windows"}[platform.system()]
Defensive patterns

Strategy: type-guard

Validate before calling

SUPPORTED = {"linux", "macos", "windows"}
assert isinstance(receipt.get("platform"), str) and receipt["platform"] in SUPPORTED, receipt.get("platform")

Type guard

def is_supported_platform(v):
    return isinstance(v, str) and v in {"linux", "macos", "windows"}

Try / catch

try:
    validate_receipt(receipt)
except PersistenceBacklogError as e:
    if "platform is unsupported" in str(e):
        normalize_platform_field(receipt)  # Darwin->macos etc. or re-measure on supported OS

Prevention

When it happens

Trigger: A receipt records `platform: "freebsd"`, `"mac"` (not "macos"), `"darwin"`, `"linux-gnu"`, or the field is missing/None; a producer derives the platform from `platform.system()` yielding `"Darwin"` with original casing.

Common situations: Generating receipts on an unsupported OS or a nonstandard platform string; hand-written receipts using informal OS names; running the measurement on a BSD or embedded target and committing the result.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


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

Appendix: source

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

    validate_frozen_field("sample_count", receipt["sample_count"], 1)
    if expected_source is not None:
        for field in (
            "source_sha",
            "source_dirty",
            "rustc_version",
            "cargo_version",
            "build_profile",
            "sample_count",
        ):
            if receipt[field] != expected_source[field]:
                raise PersistenceBacklogError(
                    f"receipt {field} does not match the checked source"
                )
    if require_clean_source and receipt["source_dirty"]:
        raise PersistenceBacklogError("persistence measurement source tree is dirty")
    platform = receipt["platform"]
    if not isinstance(platform, str) or platform not in SUPPORTED_PLATFORMS:
        raise PersistenceBacklogError("receipt platform is unsupported")

    attempted = non_negative_integer(receipt["requests_attempted"], "requests_attempted")
    accepted = non_negative_integer(receipt["accepted_requests"], "accepted_requests")
    if accepted != attempted:
        raise PersistenceBacklogError(
            "accepted_requests must equal requests_attempted; sender rejection is not backlog improvement"
        )
    retained = non_negative_integer(
        receipt["retained_queued_requests"], "retained_queued_requests"
    )
    if retained > accepted:
        raise PersistenceBacklogError("retained_queued_requests exceeds accepted_requests")
    for field in ("estimated_retained_payload_bytes", "enqueue_elapsed_ns"):
        non_negative_integer(receipt[field], field)
    if retained == 0 or receipt["estimated_retained_payload_bytes"] == 0:
        raise PersistenceBacklogError(
            "the paused channel must retain the newest request and its payload"
        )

View on GitHub (pinned to 433685b202)