Repository navigation
Moving Hermite basis 4/5: remap triggers with hysteresis, frozen replay - #59
Open
rogeriojorge wants to merge 2 commits into
Open
rogeriojorge wants to merge 2 commits into
rogeriojorge wants to merge 2 commits into
Conversation
remap_trigger compares the capped moment target with the basis per species and fires on |U - u|/a > 0.3 or |a'/a - 1| > 0.05 (optionally on a doubled tail fraction with a non-trivial move). A remap resets the measures to round-off, so an unchanged state never fires twice. Tests: manufactured shifted/heated Maxwellians, no chattering under slow drift, and a live segment run whose recorded schedule replays bitwise and differentiates (grad vs central FD).
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.
Adds
remap_trigger, which decides a remap per species from the measured moments.When it fires:
|U - u|/a > 0.3;|a'/a - 1| > 0.05(a' capped);tail_on, has doubled since the last event, and the move is non-trivial.A remap resets the moment measures to round-off, so firing again needs the same growth (hysteresis). Species that do not fire keep their basis. For gradients, record the events and replay them as a frozen schedule with
remap.Tested SHA 045abc1. Command:
python -m pytest -q -n 2 tests. Result: 179 passed.New tests:
jax.gradthrough the replay matches central finite differences to 1e-6 relative.Stack: base
adaptive/base=integration/dark-baseline9d0982d (main ab87385 + #48, #46, #13, #12, #9, #55, #50, #44, #18, #51). This lands on main after those foundation PRs and the earlier PRs of this stack (#56 first). Local results only (macOS, Python 3.12, JAX 0.11.2, x64); GitHub CI on this branch has not been checked yet.