feat(material): Support stable keys for surface material assignments - #6109
Draft
paulgessinger wants to merge 2 commits into
Draft
paulgessinger wants to merge 2 commits into
paulgessinger wants to merge 2 commits into
Conversation
Contributor
Public API surface diff+27 added, 1 breaking.
|
Contributor
paulgessinger
force-pushed
the
codex/stable-material-keys
branch
from
September 18, 2026 08:20
33ad18b to
109ed99
Compare
noemina
self-requested a review
September 18, 2026 14:31
paulgessinger
force-pushed
the
codex/stable-material-keys
branch
from
September 18, 2026 14:40
ac9ccdc to
9ec1a69
Compare
|
andiwand
pushed a commit
to andiwand/acts
that referenced
this pull request
Sep 19, 2026
… fields (acts-project#6123) `TrackingGeometryMaterial` is currently a `std::pair`, so callers depend on positional members and tuple decomposition. Replace it with a dedicated struct containing `surfaceMaterials` and `volumeMaterials`, and migrate the existing mapper, JSON/ROOT I/O, and tests to named member access. This is the standalone API prerequisite for acts-project#6109. It contains no stable keys, application methods, validation changes, or material-map format changes. The two existing maps and their behavior are unchanged. Breaking change and migration: - Replace `.first` with `.surfaceMaterials` and `.second` with `.volumeMaterials`. - Replace pair-specific operations (`std::get`, pair conversions, and tuple-style access) with named member access. Avoid structured bindings so later fields can be added without changing callers. - Existing two-map brace initialization remains valid. Validation: built and passed MaterialMapper, MaterialMapJsonConverter, MaterialJsonDocumentation, and RootMaterialMapIo against this commit independently of acts-project#6109. JSON examples and ROOT round trips remain unchanged.
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.



Depends on #6123, which extracts the breaking
TrackingGeometryMaterialpair-to-struct migration into a standalone API-only PR. This branch contains that base commit followed by the stable-key implementation; merge #6123 first. All callers use named map members, so the stable-key extension is additive relative to that API base.Material maps currently bind assignments to geometry IDs, so rebuilding an equivalent geometry with different IDs can attach material to the wrong surfaces. Add optional stable string keys to the proto-material
configureFaceoverloads and carry those identities through mapping, serialization, and loading. Existing calls without keys keep ID-based assignment.SurfaceandISurfaceMaterialunchanged.detail.TrackingGeometryMaterial::applyin Core. Resolve surface assignments before updating them. Reject keyed maps on Gen1 geometry, including the JSON decorator construction path.KeyedSurfacesarray without a nested version header or duplicated ID-map entries. Each entry contains its key, diagnostic geometry ID, and material payload.Loading replaces the placeholder and consumes its key. Rebuild the designators before applying another keyed map; retain
TrackingGeometryMaterialto re-export keyed assignments. ROOT writers reject keyed assignments; JSON/CBOR preserve them.Validation: the API-only base passed MaterialMapper, MaterialMapJsonConverter, MaterialJsonDocumentation, and RootMaterialMapIo independently. The restacked implementation passed TrackingGeometryMaterial, MaterialMapper, MaterialMapJsonConverter, and RootMaterialMapIo. Earlier feature validation also passed Portal, SurfaceMaterialJsonConverter, and the optional-key Python integration test; the history split changes only named-member access at existing call sites.