Refactor pts 11-15, SWE-lake blending reinstatement, 3D Agnesi golden master#67
Open
ray-chew wants to merge 8 commits into
Open
Refactor pts 11-15, SWE-lake blending reinstatement, 3D Agnesi golden master#67ray-chew wants to merge 8 commits into
ray-chew wants to merge 8 commits into
Conversation
- drop stale SHA-migration scratch (input/output.md, sha*.py, sha_map.txt) - move PHASE_C_GPU_RESULTS.md + tfc_generalization_plan.md under dev_notes/ - update path references in STYLE_GUIDE.md (tracked) and local notes - docs-only; no solver files touched
- delete the commented-out _update_solution_variables/_update_solution_arrays_jit block at the tail of compute_advection.py (34 lines) - the live _update_solution_variables (ooJ-aware) is untouched - repro gate fast: 3 cases bit-identical at tol 0
- new CASE_SETS["blending"] = warm bubble + hydrostatic, the cheap gate for edits under interfaces/dynamics_blending - add test_blending_hydrostatic to CASE_SETS["full"] (was missing) - coverage extension only; no pass criterion moved - capture --set blending green (both cases, baselines snapshotted)
- move run_window, CFL host control (_cfl_maxima*, _host_dt), _check_supported, _eval_forcing and the window compile cache (device_kernels.py 697-921, verbatim) into device_loop.py - device_kernels keeps the traced substeps + make_step (~690 lines) - device_step shim now re-exports run_window from device_loop; __all__ unchanged - gates: device<->device bit-identity (fast set, pre-split baseline), 11/11 device equivalence + fullrun tests, numpy fast bit-diff
- port swe_lake.py to ModelState, 2D x-y layout (thin-y 3D form in history); do_lake_to_swe_conv mirrors comp_psinc but rolls back the look-ahead clock - repair orchestration swe branches: undefined flux, unbound conversion flag (threaded as lake_to_swe_pending through time_update), CFL override kept - fix latent duplicate-ud TypeError on the continuous-blending do_psinc_to_comp_conv call (8 args vs 7 params; path unexercised by gates) - new golden-master case test_blending_swe (balanced SWE vortex, initial swe->lake->swe blend) registered in IC_MODULES, test_blending.py, repro gate - gates: warm bubble + hydrostatic + fast set bit-identical at tol 0; new case 7/7 fields green vs its master; blended vs unblended twin ~3e-4
- named predicates replace the nested conditionals: _window_start_conversion_due, _full_blend_due, _initial_blend_phase (to_limit / to_full / None) - drop the field-order-dependent ModelState iterator unpack; bind the load-bearing stale sol/npf aliases explicitly and document why - drop the dead debug threading from prepare_blending/blending_before_timestep - bit-identical at tol 0 on all three blending masters + the fast set
- the integration job ran the 7 test_jax_* scripts relying on their module-level skip; pytest >= 9 exits 5 on no-tests-collected - drop them there; the jax-equivalence job runs all 7 with jax installed - unblocks PR #66 CI (failed at test_jax_operator_equivalence)
- circular Agnesi bell h0=100 m, a=10 km, N=0.01 1/s, U=10 m/s (hydrostatic, linear regime), Gal-Chen, 64x32x64, 10 steps - first terrain case with orography varying in both horizontal coordinates; z->-z mirror symmetry preserved to ~5e-9 - register in IC_MODULES; freeze stripped target (tol 5e-4, same rationale as 2D Agnesi) - not CI-wired: ~5 min/run on the numpy path
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
Follow-up to #66 (stacked; retargets to
developwhen that merges). Eight commits: five gated refactor pts, the SWE↔lake blending reinstatement, the pytest-9 CI fix (cherry-pick of the one on #66), and the true-3D Agnesi golden-master case.Mechanical refactor pts (bit-identical at tol 0)
dev_notes/_update_solution_variablesvariant dropped fromcompute_advection.pyblendingcase set;test_blending_hydrostaticadded tofulldevice_kernels.pyhost loop split intodevice_loop.pybehind thedevice_stepshim; proven by pre/post-split device↔device bit-identity + 11/11 device equivalence/fullrun testsModelStateiterator unpack and deaddebugthreading removedSWE↔lake blending reinstated
The path was provably dead since the ModelState refactor (undefined
flux, pre-refactortime_updateAPI, unbound conversion flag). Now:swe_lake.pyported to the ModelState API in the 2D x-y layout;do_lake_to_swe_convmirrorscomp_psincbut rolls back the look-ahead clock (legacy scheduling; no master pins the advanced clock here)lake_to_swe_pending; latent duplicate-udTypeError on the continuous-blending call fixedtest_blending_swe(balanced SWE vortex, initial swe→lake→swe blend), registered in IC_MODULES /test_blending.py/ repro gatedev_notes/swe_blending_reinstatement.mdNew terrain case
test_agnesi_3d: first true-3D (G2 ≠ 0) mountain-wave golden master — circular Agnesi bell, Gal-Chen, 64×32×64; z→−z mirror symmetry ~5e-9. Not CI-wired (~5 min/run).Validation
🤖 Generated with Claude Code