Commit 342c389
committed
mudlark: polish API surface and fix decay depth bug for 1.0.0
BREAKING CHANGES:
- Replace `GNodeInfo<C, V>` with `Node<C, V>` — `gnode_info()` now
returns the same Surface 1 view type used by `layers()`. A new
`#[doc(hidden)] GNodeChildren` covers the child-linkage use case.
- Demote `VNodeId` to `pub(crate)` — no public consuming method
exists (ADR-M-032 handle test).
- Demote `v_root()` to `pub(crate)`.
- Mark `GNodeId::from_index()` and `GNodeId::index()` as
`#[doc(hidden)]`.
- Split `Observation::scale()` (panicking default) into a separate
`ScalableObservation<V>` sub-trait. Cross-type impls (f64→uint,
f32→uint, f64→f32) implement both; same-type impls no longer
carry an unusable `scale()`.
- Relax `select_plateaus` bound from `V: Proratable + Inspectable`
to `V: Inspectable`.
- Demote `serde` from a default feature to opt-in.
- `Cell` now represents the uncovered interval (terminal or vacated
semi-internal half), not always the full G-node range. `sample()`
returns the narrowed interval for semi-internals.
Bug fixes:
- Fix decay factor-table index-out-of-bounds panic for f64
coordinates where G-tree depth can exceed N (ADR-M-038). The
factor table is now sized from the actual max depth within the
subtree, not from `N - d_root`.
- Allow `attenuation = 0.0` in `decay()` (annihilation, §THEORY
M-7.3) and handle `attenuation = ∞` (infinite amplification)
without NaN from `ln(0) * 0` or `ln(∞) * 0`.
- Guard `Attenuatable::attenuate()` for f32/f64 against IEEE 754
`0 * ∞ = NaN` — if either operand is zero, return zero.
- Fix invariant checkers and debug assertions to short-circuit
`∞ == ∞` before computing `∞ - ∞ = NaN`.
Improvements:
- Add `Node::parent` field and `Node::is_root()` method.
- Add `debug_assert!` P2 guard in `observe()` for negative
accumulations (ADR-M-033).
- Move `select_plateaus` from graph_query.rs to graph_plateau.rs.
- Relax `Pewei` method bounds: `layer_count()`, `node_count()`,
`reconstruct_all()` require only `Accumulator`, not `Proratable`.
- Correct sampling cost from O(1.44 H + 1.67) to O(1.44 H).
- Mark `build_plateaus()` and `build_plateau_basis()` as
`#[doc(hidden)]`.
Documentation:
- Rewrite ADR-M-032 with testable surface-assignment criteria and
expanded analogy tables.
- Add ADR-M-038 (decay factor-table depth bound).
- Significantly expand docs/api.md with Cell/Node/contour-range
semantics, cross-references, and worked examples.
- Update idea.md, architecture.md, performance.md, testing.md.
Tests:
- Add `tests/decay_infinite.rs` — infinite amplification, ADR-M-038
regression, and annihilation edge cases (480 lines).
- Add `tests/negative_f64.rs` — P2 violation guard and downstream
semantic breakage tests (290 lines).
- Update test count: 833 → 868 (346 unit, 415 integration,
107 doc-tests).
- Update CHANGELOG release date to 2026-03-20.1 parent 3defaac commit 342c389
47 files changed
Lines changed: 3356 additions & 672 deletions
File tree
- packages/mudlark
- adr
- docs
- src
- tests
- traits
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
137 | | - | |
| 145 | + | |
138 | 146 | | |
139 | 147 | | |
140 | 148 | | |
| |||
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
151 | | - | |
152 | | - | |
| 159 | + | |
| 160 | + | |
153 | 161 | | |
154 | 162 | | |
155 | 163 | | |
| |||
165 | 173 | | |
166 | 174 | | |
167 | 175 | | |
168 | | - | |
| 176 | + | |
169 | 177 | | |
170 | 178 | | |
171 | 179 | | |
| |||
208 | 216 | | |
209 | 217 | | |
210 | 218 | | |
211 | | - | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| |||
284 | 292 | | |
285 | 293 | | |
286 | 294 | | |
287 | | - | |
288 | | - | |
| 295 | + | |
| 296 | + | |
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
0 commit comments