Commit a9ae5f6
committed
perf: reuse an already-correctly-capped dataset instead of re-simulating it
should_simulate's PYAUTO_SMALL_DATASETS=1 branch deleted and re-simulated every
dataset unconditionally. That was correct when written, and the docstring said
why: it "cannot know the capped dataset on disk was produced by the SAME cap, so
it always regenerates". The SMALLDAT stamp (PyAutoNerves#153) removes exactly
that limitation, so the branch was paying for a full simulation pass per dataset
per smoke run across ~253 call sites, for datasets that were already correct.
Reuse now requires positive evidence on BOTH counts: stamped SMALLDAT = T AND
measuring exactly SMALL_DATASETS_SHAPE_NATIVE.
The second half is the trap, and dropping it would be worse than not doing this
at all. SMALLDAT = T means "capped at whatever the cap was when this was
written", NOT "capped at today's cap". If SMALL_DATASETS_SHAPE_NATIVE is ever
changed, every dataset on disk goes on claiming T at the old size, and reusing
on the stamp alone would silently feed stale wrong-sized data to a run that
asked for the new cap -- the same silent-stale-dataset bug the stamp was
introduced to prevent, reintroduced through the opposite branch. Pinned by test.
This is the mirror image of _stamp_contradicted_by_shape on the full-resolution
branch and exists for the same reason: the stamp records the writer's
environment, not a measured property of the data. Neither branch may treat it as
unfalsifiable.
Interferometer datasets deliberately never qualify and keep regenerating every
run. Their data.fits is (n_visibilities, 2) -- shape fixed by the committed uv
file, unchanged by the cap -- so shape cannot corroborate their stamp, and the
alternative is trusting the stamp alone for precisely the family whose
corruption is invisible. Stated in the docstring rather than left to fall out of
the code.
Everything without a readable top-level data.fits (JSON-only, datacubes nesting
theirs in channel_XXX/, multi_dataset's prefixed names) also fails the check and
regenerates, preserving today's behaviour for the families this cannot speak
about.
The existing test asserting the unconditional behaviour encoded the limitation
being removed; rewritten, plus cases for each trap above.1 parent 82b5d16 commit a9ae5f6
2 files changed
Lines changed: 130 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
217 | 255 | | |
218 | 256 | | |
219 | 257 | | |
| |||
223 | 261 | | |
224 | 262 | | |
225 | 263 | | |
226 | | - | |
| 264 | + | |
227 | 265 | | |
228 | | - | |
229 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
230 | 274 | | |
231 | 275 | | |
232 | 276 | | |
| |||
316 | 360 | | |
317 | 361 | | |
318 | 362 | | |
319 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
320 | 366 | | |
321 | 367 | | |
322 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
191 | | - | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
195 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
196 | 199 | | |
197 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
198 | 274 | | |
199 | 275 | | |
200 | 276 | | |
| |||
0 commit comments