feat(hlscm): static Compute() overload with hierarchy tuning#97
Merged
Conversation
Add `HierarchicalLSCM::Compute(mesh, PinMap, levelRatio, minCoarseVerts)` so callers can use the static convenience API without constructing an instance just to set non-default hierarchy parameters. Validates `levelRatio >= 2` and `minCoarseVerts >= 3` to mirror the instance setters. The original GH issue (#68) also proposed an auto-pin variant `Compute(mesh, levelRatio, minCoarseVerts)`. That signature collides with the still-present `[[deprecated]] Compute(mesh, pin0Idx, pin1Idx)` overload, so it is blocked on #96 (deprecated-function cleanup). Tests cover static-vs-instance parity on a multi-level hierarchy and the new parameter validation paths. Closes track A10. Partially addresses #68 (blocked by #96). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address review feedback on PR #97: - Reorder validation in the new static Compute() overload so ValidatePins runs before the levelRatio/minCoarseVerts checks, matching the existing Compute(mesh, PinMap) behavior. - HLSCM.StaticTuning_MatchesInstance now probes BuildHierarchy with the test's chosen tuning and asserts >=2 levels before the static- vs-instance comparison, so a regression to single-level fallback surfaces explicitly rather than passing trivially. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
HierarchicalLSCM::Compute(mesh, PinMap, levelRatio, minCoarseVerts)— the static counterpart to configuringset_level_ratio()andset_min_coarse_vertices()on an instance. Validates the same constraints as the instance setters (levelRatio >= 2,minCoarseVerts >= 3) and forwards toComputeImpl.Compute(mesh, levelRatio, minCoarseVerts). That signature collides with the still-present[[deprecated]] Compute(mesh, pin0Idx, pin1Idx)overload, so it is blocked on Remove 3.0-deprecated LSCM/HLSCM functions #96 (deprecated-function cleanup). Auto-pin users who need custom tuning continue to use the instance API.PinMapinterface introduced in PR feat(lscm): multi-pin UV constraints on ABLSCM and HLSCM #93 —Compute(mesh, pin0, pin1, levelRatio, minCoarseVerts)from the original issue becameCompute(mesh, const PinMap&, levelRatio, minCoarseVerts).Implementation notes
Compute(mesh, const PinMap&)and the deprecated 2-pin overload inHierarchicalLSCM.hpp.single_include/OpenABF/OpenABF.hppre-amalgamated.conductor/tracks/A10/plan.mdupdated to record the PinMap adaptation and the Remove 3.0-deprecated LSCM/HLSCM functions #96 block on the auto-pin variant.Test plan
OpenABF_TestParameterization— all 28 HLSCM tests pass, including two new tests:HLSCM.StaticTuning_MatchesInstance— static overload output is bit-exact equal to instance-API output on a wavy 20×20 grid (forces multi-level hierarchy); pins land at their requested UVs.HLSCM.StaticTuning_RejectsBadParameters—levelRatio < 2,minCoarseVerts < 3, andPinMapvalidation all throwstd::invalid_argument.ctestsuite passes (6/6).clang-formatclean.Closes track A10. Partially addresses #68 (blocked by #96).
🤖 Generated with Claude Code