Skip to content

bake: physicallybased catalog ships available_tiers=[] — client.materials() returns empty #331

Closed

Description

@gerchowl

Source

Bernhard's #311 + #313.

Bug persists on current dev. Repro: curl .../v2026.04.2/physicallybased.json | jq '.[0:3] | .[] | "\(.id): \(.available_tiers)"' returns available_tiers=[] for every entry; root cause at src/mat_vis_baker/sources/physicallybased.py:197.

Problem

mat_vis_client.materials("physicallybased", "scalar") returns [] even though the catalog has 86 entries. The filter if tier in entry["available_tiers"] matches none because every physicallybased catalog entry ships with available_tiers=[].

client.materials("physicallybased", "scalar")
# []

End user (via pymat — see mat#222 cascade) gets either an empty list or a MaterialNotStagedError, depending on the call path.

Root cause

src/mat_vis_baker/sources/physicallybased.py:197:

available_tiers=[],   # ← should be ["scalar"]
maps=[],

The fetcher hardcodes [] for scalar-only sources because the original v3 schema's available_tiers was conceived for textured tiers ("1k", "2k", etc.) and physicallybased had no analog. We've since adopted "scalar" as the sentinel tier (the manifest already declares tiers.scalar.complete=True for physicallybased), so the catalog should match.

Fix

available_tiers=["scalar"],
maps=[],

One-line diff at the fetcher. Plus a re-bake of physicallybased to push the corrected catalog. The catalog merge-on-write logic from #301 handles the rest correctly.

Acceptance

Cascade

  • mat#222 (pymat-side: Vis defaults tier="1k"; needs scalar-source detection — both fixes required for bernhard's repro)
  • mat-vis#313 (the user-visible bug; resolves once both sides land + substrate cut)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bakerbugpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions