test(vlasov1d,vlasov2d): guard the Hou-Li velocity-space rejection - #333
Open
joglekara wants to merge 1 commit into
Open
test(vlasov1d,vlasov2d): guard the Hou-Li velocity-space rejection#333joglekara wants to merge 1 commit into
joglekara wants to merge 1 commit into
Conversation
PR #305 removed velocity-space Hou-Li filtering: the filter is FFT-based, hence periodic in whichever axis it filters, and v is a bounded domain (f -> 0 at +/-vmax), so filtering in v wraps the forward tail onto the -v edge and corrupts f(v). x (and x/y in 2d) are periodic, so filtering there is correct and unchanged. What keeps that from being reintroduced from a deck is the HouLiFilterConfig `dimensions` validator, and nothing tested it. The kernel precompute for v is gone, so a re-added velocity dimension would not fail loudly at construction — it would fall back to whatever the config path happened to accept. Adds the missing coverage on both solvers: - velocity dimensions are rejected (v in 1d; vx/vy, and mixed spatial+velocity lists, in 2d) - configuration-space dimensions still validate - the default stays configuration-space only, so an unspecified deck cannot filter in velocity Both tests fail against the pre-#305 datamodel, which accepted dimensions=["v"] and defaulted to ["x", "v"]. Found while auditing a downstream repo that had picked the filter as a grid-scale sink in v before #305 landed. Co-Authored-By: Claude Opus 5 <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.
PR #305 removed velocity-space Hou-Li filtering. The filter is FFT-based, hence periodic in whichever axis it filters, and
vis a bounded domain (f -> 0at±vmax) — so filtering invwraps the forward tail onto the-vedge and corruptsf(v).x(andx/yin 2d) are periodic, so filtering there is correct and is unchanged.What prevents that from being reintroduced from a deck is the
HouLiFilterConfig.dimensionsvalidator — and nothing tested it. Since #305 also deleted the velocity kernel precompute, a re-added velocity dimension would not fail loudly at construction; it would depend entirely on the validator still being there.What this adds
Test-only. No source changes.
tests/test_vlasov1d/test_config_validation.py— velocity dimensions rejected (["v"],["x","v"],["v","x"]);["x"]still validates; default stays["x"].tests/test_vlasov2d/test_hou_li_filter_config.py(new) —vx/vyand mixed spatial+velocity lists rejected;["x"]/["y"]/["x","y"]still validate; default stays["x","y"].The tests assert on the pydantic
ValidationErrormessage, so they pin the diagnostic a user actually sees, not just the failure.Verification
tests/test_vlasov1d/test_config_validation.py+ the new 2d file).57b0bce)HouLiFilterConfig(is_on=True, dimensions=["v"])constructs successfully and the default is["x","v"], so both tests fail there.ruff check/ruff format --checkclean.How this surfaced
Auditing a downstream repo that had selected the Hou-Li filter as a grid-scale sink in v for a large-box two-stream run, before #305 landed. Upstream had already reached the same conclusion and removed it; the downstream configs then failed validation on a compute node. The removal is right — this just makes sure it stays removed.
🤖 Generated with Claude Code