Skip to content

Commit 3defaac

Browse files
committed
feat(package): mudlark, a φ-bounded geometric-value graph
Introduce the new sub-package called "mudlark", named after the Magpie-Lark. Path: "packages/mudlark"
1 parent 6749e87 commit 3defaac

152 files changed

Lines changed: 63210 additions & 12 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ are preferred over unit tests. Integration tests should test the public
2929
API, perhaps using `#[doc(hidden)]` helpers when appropriate.
3030

3131
| Level | Visibility | Location |
32-
|-------------|--------------|---------------|
32+
| ----------- | ------------ | ------------- |
3333
| Unit | `private` | inline |
3434
| Crate | `pub(crate)` | `/src/tests/` |
3535
| Integration | `pub` | `/tests/` |
3636

37-
3837
## Test Doc-Headers
3938

4039
Every test file (module) should maintain an index of the tests contained in the module-doc. The primary purpose is to make it easy to scan the test files to detect duplicates or overlapping coverage. Please opportunistically create if missing.
@@ -48,10 +47,11 @@ carries a **package qualifier** so the target document is never ambiguous.
4847
ADR references (`ADR-T-001`, `ADR-R-001`, …) are an exception — they
4948
use their own `ADR-<PREFIX>-<NNN>` form without the `§` prefix.
5049

51-
| Prefix | Package | Example document |
52-
|--------|----------------------|--------------------------------------|
53-
| `T-` | Torrust (root crate) | *(none yet)* |
54-
| `R-` | render-text-as-image | `packages/render-text-as-image/` |
50+
| Prefix | Package | Example document |
51+
| ------ | -------------------- | -------------------------------- |
52+
| `T-` | Torrust (root crate) | |
53+
| `M-` | Mudlark | `packages/mudlark/docs/idea.md` |
54+
| `R-` | render-text-as-image | `packages/render-text-as-image/` |
5555

5656
### General Rules
5757

@@ -61,9 +61,10 @@ use their own `ADR-<PREFIX>-<NNN>` form without the `§` prefix.
6161
code and cross-package references always use the fully qualified
6262
`§BOOK PACKAGE_PREFIX-N` form.
6363
- Example: `§SPEC R-1.1` refers to §1.1 of `packages/render-text-as-image/docs/specification.md`.
64-
- ADRs live in an `adr/` directory per package (`/adr/` for the
64+
- Example: `§IDEA M-1.5` refers to §1.5 of `packages/mudlark/docs/idea.md`.
65+
- ADRs live in an `adr/` directory per package (`docs/adr/` for the
6566
root crate) and use sequential numbering: `NNN-slug.md`. Referenced
66-
as `ADR-T-001`, `ADR-R-001`, `ADR-R-002`.
67+
as `ADR-T-001`, `ADR-M-024`, `ADR-R-002`.
6768

6869
## Replacing a File
6970

Cargo.lock

Lines changed: 169 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = [".", "packages/render-text-as-image"]
2+
members = [".", "packages/mudlark", "packages/render-text-as-image"]
33

44
[package]
55
default-run = "torrust-index"

packages/mudlark/CHANGELOG.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-03-11
9+
10+
Initial stable release. The public API surface documented in
11+
[docs/api.md](docs/api.md) is now covered by semver guarantees.
12+
13+
### Added
14+
15+
- **Dual-tree index (`GvGraph<C, V, N>`)** — adaptive-resolution spatial
16+
index backed by interlocking G-Tree (geometric) and V-Tree (value)
17+
structures.
18+
- **Observation pipeline**`observe(coord, delta)` with automatic
19+
split, rebalance, and eviction.
20+
- **Batch construction**`GvGraph::from_observations(config, iter)`.
21+
- **`Extend<(C, O)>`** — incremental batch insertion via
22+
`g.extend([(coord, delta), …])`.
23+
- **Point query**`get(coord)` returning `Cell<C, V>` snapshots.
24+
- **Plateau projection**`plateaus()` in O(1) with the
25+
`dynamic-contour-tracking` feature.
26+
- **Range sum**`range_sum(range)` for G-Tree recursive range
27+
queries (requires `V: Proratable`).
28+
- **Contour range queries**`contour_range(start, end)` and
29+
`contour_range_energy(start, end)` decomposing lattice-aligned
30+
intervals into interior, boundary, and straddling elements
31+
(requires `V: Proratable + Inspectable`).
32+
- **Plateau selection**`select_plateaus(lo, hi)` snapping
33+
arbitrary coordinates to lattice-aligned contour range endpoints
34+
(requires `V: Proratable + Inspectable`).
35+
- **Proportional sampling**`sample(rng)` with O(1.44 H + 1.67)
36+
expected cost (inherent: `V: Weighable`; via `WeightedSampler`
37+
trait: `V: Weighable + Inspectable`).
38+
- **PEWEI extraction**`extract()` producing significance-ordered
39+
`Pewei<C, V>` snapshots with layer iteration and reconstruction.
40+
- **Streaming V-Tree BFS**`layers()` yielding `(layer_index, Node)`
41+
lazily.
42+
- **Temporal decay**`decay(root, attenuation, q)` with
43+
subband-adaptive scaling (requires `V: Attenuatable +
44+
Inspectable`).
45+
- **Budget enforcement** — configurable hard budget with
46+
`check_evictions()` and automatic eviction during observation.
47+
- **Accessors**`node_count()`, `terminal_count()`, `budget()`,
48+
`total_sum()`, `config()`, `g_root()`, `v_root()`,
49+
`depth_evict()`, `depth_create()`, `depth_buffer()`,
50+
`headroom()`, `soft_limit()` — all O(1).
51+
- **Three-surface visibility model** (ADR-M-032) — Prints (Surface 1),
52+
Film (Surface 2), Emulsion (Surface 3) with flat crate-root
53+
re-exports.
54+
- **Chemistry contract traits**`Coordinate`, `Accumulator`,
55+
`Attenuatable`, `Weighable`, `Proratable`, `Inspectable`,
56+
`Observation<V>`, `Rng`.
57+
- **Instrument traits**`SpatialRead`, `SpatialWrite`,
58+
`TemporalDecay`, `WeightedSampler`.
59+
- **Built-in implementations** for `u8``u128`, `f32`, `f64`.
60+
- **Feature flags**`dynamic-contour-tracking` (default), `serde`
61+
(default), `rand` (default).
62+
- **Serde support**`Serialize`/`Deserialize` on all Surface 1
63+
snapshot types behind the `serde` feature.
64+
- **rand integration** — blanket `Rng` impl for `rand_core::Rng`
65+
behind the `rand` feature.
66+
- **Invariant checker**`assert_invariants()` exposed as a
67+
`#[doc(hidden)]` testing affordance.
68+
- **Shared test infrastructure** — config presets, plan runner, fluent
69+
builder, and RNG stubs in the `testing` module.
70+
- **143 Criterion benchmarks** across six families (observe, query,
71+
extract, lifecycle, spray, pathological).
72+
- **833 tests** (346 unit, 379 integration, 108 doc-tests).
73+
- **37 architecture decision records** in `adr/`.
74+
- **Full documentation**`idea.md` (formal spec), `api.md`,
75+
`architecture.md`, `performance.md`, `testing.md`, `theory.md`.
76+
77+
[1.0.0]: https://github.com/torrust/torrust-index/releases/tag/mudlark-v1.0.0

0 commit comments

Comments
 (0)