Make multilevel-atom test independent of FP contraction (#1426) - #3319
Open
yorickreum wants to merge 1 commit into
Open
yorickreum wants to merge 1 commit into
yorickreum wants to merge 1 commit into
Conversation
At resolution 40 the optical period spans only ~13 time steps and the laser spikes chaotically instead of settling. Between spikes the field collapses to ~1e-18 and the laser regrows out of that remnant, so the sampled value depends on whether the compiler contracts a*b+c into an FMA: arm64 does by default, x86 does with -march=native. Raise the resolution to 200, where the laser reaches a steady state, and assert the steady-state envelope at the cavity boundary instead of an instantaneous field value. Steady-state lasing fixes the amplitude but not the phase, so the envelope is reproducible: contracted and uncontracted builds agree on it to 6e-6, against 98% before. The envelope no longer constrains the lasing frequency, which the old sample caught through its phase in builds that contracted the same way. A frequency check can be added later if that coverage is wanted, the peak of a DFT of the boundary field is identical across both builds.
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.
At resolution 40 the optical period spans only ~13 time steps and the laser spikes chaotically instead of settling. Between spikes the field collapses to ~1e-18 and the laser regrows out of that remnant, so the sampled value depends on whether the compiler contracts a*b+c into an FMA: arm64 does by default, x86 does with -march=native.
Raise the resolution to 200, where the laser reaches a steady state, and assert the steady-state envelope at the cavity boundary instead of an instantaneous field value. Steady-state lasing fixes the amplitude but not the phase, so the envelope is reproducible: contracted and uncontracted builds agree on it to 6e-6, against 98% before. The envelope no longer constrains the lasing frequency, which the old sample caught through its phase in builds that contracted the same way. A frequency check can be added later if that coverage is wanted, the peak of a DFT of the boundary field is identical across both builds.