Repository navigation
bugfix(baker): physicallybased fetcher emits available_tiers=['scalar'] (closes #331) - #338
Merged
Merged
Conversation
…'] (closes #331) bernhard mat-vis#311 + #313 cascade root cause: `sources/physicallybased.py:197` hardcoded `available_tiers=[]`, so `client.materials('physicallybased', 'scalar')` returned empty for every dispatcher (`tier in []` matches nothing). 86 catalog entries existed but were unfilterable. Fix: emit `['scalar']` so the manifest's already-declared `tiers.scalar.complete=True` and the catalog's `available_tiers` agree. One-line change at the fetcher. Removes the strict-xfail marker on `test_fetch_populates_available_tiers_with_scalar_sentinel` (forced by the strict=True the marker was set to in #334) — now a regular green regression test pinning the contract for the future. Note: this is the DATA-LAYER fix only. The API-layer concern that `tier="scalar"` is leaky DX (Bernhard's #281 quote: 'some materials expect tier=None. Need to find out how to work with this') is a separate UX issue — filed alongside this PR. After merge: re-dispatch physicallybased bake on tst (current v2026.04.3 substrate has 86 entries with `available_tiers=[]` from the pre-fix bake earlier today). Production cuts will pick up the right shape from the next baseline. Forward-verify: with this fix on tst, `client.materials('physicallybased', 'scalar')` returns 86 ids; combined with mat#222 (pymat-side scalar-source detection) Bernhard's #313 repro succeeds end-to-end. Refs #331, #313 (cascade), mat#222 (pymat side).
6 tasks
gerchowl
added a commit
that referenced
this pull request
May 7, 2026
…entinel (closes #339) (#341) bernhard's #281 reply ("some materials expect tier=None. Need to find out how to work with this") + #311 cascade: typing `tier="scalar"` forces the user to know an internal sentinel. After #338 landed the data-layer fix (catalog now declares `available_tiers=["scalar"]`), the client API is the next layer to clean up. Change: `MatVisClient.materials(source, tier: str | None = None)`. When `tier` is omitted, returns every material in the source that advertises ≥1 tier — deduped across tiers. Explicit tier still wins (backwards-compat). End-to-end after #338 + this: client.materials("physicallybased") # → 86 ids (no "scalar" needed) client.materials("gpuopen") # → 454 ids (deduped across tiers) client.materials("ambientcg", "1k") # → 1948 ids (explicit, unchanged) Excludes inert pre-#331 records with `available_tiers=[]` from the no-tier path — they're not fetchable anywhere, surfacing them would mislead consumers. Mirror in `mat_vis_client_standalone.py` keeps signature parity for single-file users. 5 new tests cover: no-tier returns all with ≥1 tier, dedup, explicit tier still filters, inert entries excluded. Existing 354-test client suite still green. Forward-verify (mat-vis-client + tst v2026.04.3 substrate): client.materials("physicallybased") → 86 ids ✓ (verified locally) Bernhard's #313 cascade now needs only mat#222 (pymat-side `Vis("physicallybased", "Aluminum")` defaults `tier="1k"`) to fully resolve at his entry point. Refs #339 (closed), #281 (the original cue), #338 (data-layer), #313 (cascade), mat#222 (pymat half).
gerchowl
added a commit
that referenced
this pull request
May 10, 2026
…lar"] (closes #369) Pre-fix: 18 of 454 gpuopen catalog entries (Chrome, Aluminum, Gold, Brass, Frosted Glass, Cobalt, Red Wine, White Plastic, …) had `available_tiers` absent — `index_builder.py` omitted the key when the record's list was empty, so consumers saw `None` from `dict.get()`. Diverged silently from physicallybased's `["scalar"]` convention (#338). Fix: - `gpuopen.py` `_fetch_one`: emit `["scalar"]` (not `[]`) when no textures shipped — symmetric with physicallybased. - `index_builder.py`: always emit `available_tiers` on every entry. The empty-list shape is no longer reachable from any source path. - Client `_is_scalar_only_entry`: accept all four catalog shapes — new `["scalar"]` (post-#369), legacy `[]` and `None` (pre-#369), and key- absent — via `all(t == "scalar" for t in tiers)`. Standalone mirrored. Tests: - `test_index_builder.py`: pin always-present contract; pin `["scalar"]` passthrough. - `test_gpuopen_baker.py`: extend mtlx-only path to assert `available_tiers == ["scalar"]`; new test pins `["1k"]` for textured entries (regression guard against the fallback leaking). - `test_scalar_only_lookup.py`: parametrised over the four shapes (`["scalar"]`, `[]`, `None`, missing-key) + an end-to-end test that `asset(...).textures` returns `{}` without calling `fetch_all_textures`.
gerchowl
added a commit
that referenced
this pull request
May 10, 2026
…lar"] (closes #369) (#379) Pre-fix: 18 of 454 gpuopen catalog entries (Chrome, Aluminum, Gold, Brass, Frosted Glass, Cobalt, Red Wine, White Plastic, …) had `available_tiers` absent — `index_builder.py` omitted the key when the record's list was empty, so consumers saw `None` from `dict.get()`. Diverged silently from physicallybased's `["scalar"]` convention (#338). Fix: - `gpuopen.py` `_fetch_one`: emit `["scalar"]` (not `[]`) when no textures shipped — symmetric with physicallybased. - `index_builder.py`: always emit `available_tiers` on every entry. The empty-list shape is no longer reachable from any source path. - Client `_is_scalar_only_entry`: accept all four catalog shapes — new `["scalar"]` (post-#369), legacy `[]` and `None` (pre-#369), and key- absent — via `all(t == "scalar" for t in tiers)`. Standalone mirrored. Tests: - `test_index_builder.py`: pin always-present contract; pin `["scalar"]` passthrough. - `test_gpuopen_baker.py`: extend mtlx-only path to assert `available_tiers == ["scalar"]`; new test pins `["1k"]` for textured entries (regression guard against the fallback leaking). - `test_scalar_only_lookup.py`: parametrised over the four shapes (`["scalar"]`, `[]`, `None`, missing-key) + an end-to-end test that `asset(...).textures` returns `{}` without calling `fetch_all_textures`.
gerchowl
added a commit
that referenced
this pull request
May 15, 2026
…'] (closes #331) (#338) bernhard mat-vis#311 + #313 cascade root cause: `sources/physicallybased.py:197` hardcoded `available_tiers=[]`, so `client.materials('physicallybased', 'scalar')` returned empty for every dispatcher (`tier in []` matches nothing). 86 catalog entries existed but were unfilterable. Fix: emit `['scalar']` so the manifest's already-declared `tiers.scalar.complete=True` and the catalog's `available_tiers` agree. One-line change at the fetcher. Removes the strict-xfail marker on `test_fetch_populates_available_tiers_with_scalar_sentinel` (forced by the strict=True the marker was set to in #334) — now a regular green regression test pinning the contract for the future. Note: this is the DATA-LAYER fix only. The API-layer concern that `tier="scalar"` is leaky DX (Bernhard's #281 quote: 'some materials expect tier=None. Need to find out how to work with this') is a separate UX issue — filed alongside this PR. After merge: re-dispatch physicallybased bake on tst (current v2026.04.3 substrate has 86 entries with `available_tiers=[]` from the pre-fix bake earlier today). Production cuts will pick up the right shape from the next baseline. Forward-verify: with this fix on tst, `client.materials('physicallybased', 'scalar')` returns 86 ids; combined with mat#222 (pymat-side scalar-source detection) Bernhard's #313 repro succeeds end-to-end. Refs #331, #313 (cascade), mat#222 (pymat side).
gerchowl
added a commit
that referenced
this pull request
May 15, 2026
…entinel (closes #339) (#341) bernhard's #281 reply ("some materials expect tier=None. Need to find out how to work with this") + #311 cascade: typing `tier="scalar"` forces the user to know an internal sentinel. After #338 landed the data-layer fix (catalog now declares `available_tiers=["scalar"]`), the client API is the next layer to clean up. Change: `MatVisClient.materials(source, tier: str | None = None)`. When `tier` is omitted, returns every material in the source that advertises ≥1 tier — deduped across tiers. Explicit tier still wins (backwards-compat). End-to-end after #338 + this: client.materials("physicallybased") # → 86 ids (no "scalar" needed) client.materials("gpuopen") # → 454 ids (deduped across tiers) client.materials("ambientcg", "1k") # → 1948 ids (explicit, unchanged) Excludes inert pre-#331 records with `available_tiers=[]` from the no-tier path — they're not fetchable anywhere, surfacing them would mislead consumers. Mirror in `mat_vis_client_standalone.py` keeps signature parity for single-file users. 5 new tests cover: no-tier returns all with ≥1 tier, dedup, explicit tier still filters, inert entries excluded. Existing 354-test client suite still green. Forward-verify (mat-vis-client + tst v2026.04.3 substrate): client.materials("physicallybased") → 86 ids ✓ (verified locally) Bernhard's #313 cascade now needs only mat#222 (pymat-side `Vis("physicallybased", "Aluminum")` defaults `tier="1k"`) to fully resolve at his entry point. Refs #339 (closed), #281 (the original cue), #338 (data-layer), #313 (cascade), mat#222 (pymat half).
gerchowl
added a commit
that referenced
this pull request
May 15, 2026
…lar"] (closes #369) (#379) Pre-fix: 18 of 454 gpuopen catalog entries (Chrome, Aluminum, Gold, Brass, Frosted Glass, Cobalt, Red Wine, White Plastic, …) had `available_tiers` absent — `index_builder.py` omitted the key when the record's list was empty, so consumers saw `None` from `dict.get()`. Diverged silently from physicallybased's `["scalar"]` convention (#338). Fix: - `gpuopen.py` `_fetch_one`: emit `["scalar"]` (not `[]`) when no textures shipped — symmetric with physicallybased. - `index_builder.py`: always emit `available_tiers` on every entry. The empty-list shape is no longer reachable from any source path. - Client `_is_scalar_only_entry`: accept all four catalog shapes — new `["scalar"]` (post-#369), legacy `[]` and `None` (pre-#369), and key- absent — via `all(t == "scalar" for t in tiers)`. Standalone mirrored. Tests: - `test_index_builder.py`: pin always-present contract; pin `["scalar"]` passthrough. - `test_gpuopen_baker.py`: extend mtlx-only path to assert `available_tiers == ["scalar"]`; new test pins `["1k"]` for textured entries (regression guard against the fallback leaking). - `test_scalar_only_lookup.py`: parametrised over the four shapes (`["scalar"]`, `[]`, `None`, missing-key) + an end-to-end test that `asset(...).textures` returns `{}` without calling `fetch_all_textures`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #331 (data-layer half of bernhard's #313 cascade). One-line fetcher fix at `sources/physicallybased.py:197`:
```diff
```
The catalog's 86 entries were all advertising `available_tiers=[]`, so `client.materials("physicallybased", "scalar")` filtered them all out (`tier in []` matches nothing). The manifest already declared `tiers.scalar.complete=True` for physicallybased — the fetcher was just emitting an empty literal that contradicted it.
Tests
Removes the strict-xfail marker on `test_fetch_populates_available_tiers_with_scalar_sentinel` (committed in #334 as a forcing function); it's now a regular green regression test.
Out of scope
The API-layer DX concern — `tier="scalar"` is a leaky sentinel and the user shouldn't have to know it (Bernhard's #281 quote: "some materials expect `tier=None`. Need to find out how to work with this") — is filed separately as a new issue. This PR is data-layer only; the new issue tracks making `tier` optional for scalar-only sources at the client API.
The pymat-side default-tier mismatch (mat#222) is the other half of the cascade.
Forward-verify after merge
References