fix: the swept dt values must be distinct on disk - #8
Merged
sotashimozono merged 1 commit intoSep 9, 2026
Merged
Conversation
`production.toml` swept `dt = [1e-2, 5e-3, 2.5e-3, 1.25e-3]`, which is the natural
halving sequence and the wrong answer. A swept float reaches its directory name
through `%.2f`, so those four render `0.01, 0.01, 0.00, 0.00`: twenty distinct points
claim ten directories and half the sweep silently overwrites the other half while the
ledger reports every point as done. `debug.toml` had the same shape at four points
into two. `ParamIO.diagnose` said so all along; nothing ran it.
smoke.toml ok=true 1 point
debug.toml ok=false 4 points -> 2 directories
production.toml ok=false 20 points -> 10 directories
Only smoke.toml was clean, and smoke.toml is the one CI runs — which is why this
template shipped a sweep that cannot be run at size.
The replacement values are not free either. `MyModule.decay_error` takes
`n = round(Int, t_end/dt)`, so a dt that does not divide `t_end` integrates to a
different final time and contributes an error that has nothing to do with the step
size. `[0.08, 0.04, 0.02, 0.01]` is distinct on disk and fails this: at dt=0.08 the
integration stops at t=0.96 and the truncation error cancels against the end-time
error, giving 5.79e-04 — SMALLER than the error at dt=0.01, so the coarsest point
would sit below the finest on the convergence plot.
`[0.1, 0.05, 0.02, 0.01]` satisfies both: distinct under `%.2f`, exact divisors of 1.0,
and the rendered name equals the value rather than a rounding of it.
Verified: all three configs `ok=true`; the debug sweep runs to four distinct
directories with four distinct rows, and err/dt stays flat across them; test/runtests.jl
and report.jl both still pass.
The upstream half of this is DataVault #39/#41 — `Vault` now honours
`[datavault] float_format = "auto"`, which lets a sweep use any values it likes, and
warns at construction when a grid collides. This template pins the registered
DataVault 0.7, so it cannot adopt that until a release; the values are the fix that
works today.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
📚 Docs preview: https://qatlashub.github.io/templateHPC.jl/previews/PR8/ (updates on each push to this PR) |
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.
Description
production.tomlswept the natural halving sequence, and the natural halving sequence is thewrong answer. A swept float reaches its directory name through
%.2f.Type of Change
bug)Proposed Changes
dt = [1e-2, 5e-3, 2.5e-3, 1.25e-3]renders as0.01, 0.01, 0.00, 0.00. Twenty distinct pointsclaim ten directories; half the sweep silently overwrites the other half while the ledger reports
every point as done.
ParamIO.diagnose:smoke.tomldebug.tomlproduction.tomlOnly
smoke.tomlwas clean — andsmoke.tomlis the one CI runs. That is why a template couldship a sweep that cannot be run at size.
The replacement values are not free either.
MyModule.decay_errortakesn = round(Int, t_end/dt), so adtthat does not dividet_endintegrates to a different finaltime and contributes an error unrelated to the step size.
[0.08, 0.04, 0.02, 0.01]is distincton disk and still wrong:
At
dt=0.08the truncation error cancels against the end-time error, so the coarsest pointlands below the finest and the convergence plot reads backwards.
[0.1, 0.05, 0.02, 0.01]satisfies both constraints — distinct under%.2f, exact divisors of1.0 — and the rendered name equals the value rather than a rounding of it.
debug.tomlbecomes[0.05, 0.01]for the same reasons.Usage or Results
Four points, four directories, four distinct rows, and
err/dtflat across them. All threeconfigs now report
ok=true.test/runtests.jlandreport/report.jlboth still pass.The upstream half
DataVault #39 and #41 fix the other side:
Vaultnow honours[datavault] float_format = "auto"— which was previously read by
ParamIO.diagnoseand ignored by the writer, so setting it turnedthe diagnostic green while the data kept colliding — and warns at construction when a grid
collides at all. With that, a sweep can use whatever values the physics wants.
This template pins the registered DataVault 0.7, so it cannot adopt
autountil there is arelease. Changing the values is the fix that works today, and it is the right example regardless:
a template's configs should not need a knob to be correct.
check list
./setup.shを通したか — configs only, no renamed identifiers touchedprojects/ExampleSweepが instantiate できるか — compute / collect / report all re-runsetup.shの書き換え対象に入っているか — no new files🤖 Generated with Claude Code