Repository navigation
Commit 31642a7
committed
[fix.db.rho.D8+] the version hashed the code and not the numbers the code reads, so 22 stale-geometry cubes were served under a rule that would not have drawn them
Reported by the physics session, who deleted the 22 rows by hand: the MEP box
now grows until the contour closes across the whole slider range. Every cube's
GEOMETRY changed with it. The method version did not move. Reads go through
app.v_field_cube_servable, which keys on METHOD currency — so the cache kept
serving old-geometry cubes under the new rule, and the failure is silent by
construction because a stale cube is a perfectly valid cube. Nothing crashes,
nothing looks wrong, and the picture is of a box today's code would not draw.
WHY IT ESCAPED, and this is the generalisable part: unit_version() hashed
inspect.getsource() of the listed functions. The geometry is decided by
module-level CONSTANTS — PAD_MAX, PAD_STEP, FIXED_ISO, GRID_MAX_DIM,
ISO_ENCLOSED_FRACTION, ISO_SLIDER_FLOOR — which those functions READ and do not
CONTAIN. A version that covers source but not constants misses exactly the edit
most likely to happen: tuning a number IS the common change, rewriting a
function is the rare one.
Constants are now part of the unit and are declared per unit, which makes SCOPE
the design decision rather than an accident:
classical geometry consts -> fields.mep, fields.mlp only
cubegen grid + cost consts -> the four quantum units only
That asymmetry is load-bearing. A classical padding tweak must NOT invalidate a
converged Fe-heme SCF (minutes of CPU), or the next person stops tuning. Asserted
in both directions rather than hoped for.
POSITIVE CONTROLS, because a version that has never been shown to move on a
constant is exactly the state this bug came from:
PAD_MAX +1.0 -> {fields.mep, fields.mlp} (and nothing else)
CUBE_GRID_ORB +1 -> the four fields.qm.* units (and nothing else)
PAD_STEP +0.5 -> zero quantum units invalidated
a constant that does not exist -> LookupError naming it, because a name that
silently vanishes from the module would quietly leave the version, which is
how this hole would come back
5/5 green. The tests restore the module state and assert the restore.
FIRST ACT OF THE FIX IS A ONE-TIME FULL INVALIDATION: servable went 57 -> 0,
because every cached cube predates today's geometry rule. That is the correct
outcome — the alternative is continuing to serve them. Verified the cache works
going forward in the same breath: a fresh ethanol MEP returned computed, then db,
and servable climbed to 2. The 57 orphaned rows are reclaimable with
bin/dirac-sweep by hand; nothing deletes them automatically.
NEXT: wire app.job (still 0 rows, no writer) so a long compute is visible while
it runs — backend/jobs.py is written, not yet called.1 parent 43d21f9 commit 31642a7
2 files changed
Lines changed: 172 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
| 79 | + | |
| 80 | + | |
73 | 81 | | |
74 | 82 | | |
75 | 83 | | |
| |||
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
| |||
133 | 147 | | |
134 | 148 | | |
135 | 149 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
142 | 173 | | |
143 | 174 | | |
144 | 175 | | |
| |||
149 | 180 | | |
150 | 181 | | |
151 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
152 | 191 | | |
153 | 192 | | |
154 | 193 | | |
| |||
157 | 196 | | |
158 | 197 | | |
159 | 198 | | |
160 | | - | |
| 199 | + | |
| 200 | + | |
161 | 201 | | |
162 | 202 | | |
163 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
0 commit comments