Skip to content

Commit b4c316b

Browse files
luisleo526claude
andcommitted
Merge pull request 759 head cecedc0 (Write bounded drawing arenas in place and share their slots between checkpoints)
Plain merge of the source head into the combined branch; nothing was resolved by hand. The source head is the pull request branch merged with main c6a61ef. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2 parents 378ce2f + cecedc0 commit b4c316b

8 files changed

Lines changed: 461 additions & 93 deletions

‎CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,19 @@ version number follows semantic versioning over the surfaces the
174174
`request.security` at the first whole bucket opening at or after the origin.
175175
A run that does not declare it is unchanged. The option has no defined
176176
meaning in a live run. See `docker/README.md`.
177+
- A bounded drawing arena (the line, box and label arenas the generated code
178+
builds from a script's declared `max_*_count`) now writes in place and keeps
179+
its slots in blocks of 32 that a checkpoint of the arena shares, like an
180+
unbound arena's records. A create, a delete or a setter used to replace the
181+
whole state with a deep copy, so a script that moved a few of its live
182+
drawings on every bar paid time proportional to the bound on every call, and
183+
the first write after each script-state checkpoint paid it again; they now
184+
copy only the blocks of 32 records they write, so they do no per-record work
185+
in the bound (the first write after a checkpoint still copies the slot
186+
directory and the creation order, a directory entry and an order index per
187+
occupant, and deleting the oldest drawing moves the directory's entries).
188+
The bound, the typed overflow outcome, the slot reuse order, the
189+
stale-handle behaviour and every value a script reads are unchanged.
177190

178191
## 1.9.1 — 2026-10-31
179192

‎ci/cr150-source-bounds.yaml‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ ceilings:
8787
# --emit-seed, 4 stale entries removed): the bounded drawings, the owned
8888
# storage and runtime context service, the ledger cache
8989
# and the selected-capacity driver, reader and core. None is bounded.
90+
# Two of those groups are gone (U1666 and U1668, the whole-state copies a bounded
91+
# drawing arena made on every create, delete and edit): its slots are now shared
92+
# blocks written in place, so the ceiling drops by two.
9093
# One materialize_relative_exits local-list group and three
9194
# SeriesPercentileNearestRank groups remain OPEN as well.
92-
unreviewed: 1406
95+
unreviewed: 1404
9396
pending-flat-memory: 184
9497
owners:
9598
- {name: "generated-cpp", globs: ["tutorial/**"]}
@@ -1681,14 +1684,12 @@ entries:
16811684
- {id: "U1643", file: "src/native_execution_consumer.cpp", symbol: "cohort_opening_index_", ops: ["grow"], container: "unresolved by the index: cohort_opening_index_.reserve(...)", owner: "native-kernel", phase: "unclassified", state: "unreviewed", note: "Derived scratch populated from physical lots during eligible ordinary bar target reads. The lot count must fit row_budget before reserve(max_rows) and emplace_back; over-budget input or bad_alloc uses the complete reader. Reserve requests the fixed payload on rebuild and retains the first successful allocation across commands and begin. Layout estimate from source, not measured: 4096 rows of 16 bytes, 64 KiB payload, excluding vector and allocator overhead. Settlement and host lot-write generations invalidate the view; no rollback image, hash fold or persistence. Member-vector reserve and loop growth are outside the gate's bounded admission form, so this stays OPEN. Tests: tests/test_native_cohort_target_cost.cpp, tests/test_native_cohort_target_transcript.cpp, tests/test_native_cohort_target_invalidation.cpp, tests/test_native_cohort_target_bypass.cpp.", line: 14724}
16821685
- {id: "U1644", file: "src/native_execution_consumer.hpp", symbol: "cohort_opening_index_", ops: ["decl"], container: "std::vector<CohortOpeningIndexRow>", owner: "native-kernel", phase: "unclassified", state: "unreviewed", note: "Consumer-owned derived scratch, rebuilt from physical lots during eligible ordinary bar target reads and invalidated by settlement and host lot-write generations. Capacity survives clear and begin; contents are never persisted or hashed and require no rollback image. Layout estimate from source, not measured: kCohortOpeningIndexBytes requests 64 KiB payload, 4096 rows at 16 bytes each, excluding vector and allocator overhead; larger lot sets use the complete reader. Unsupported member-vector admission stays OPEN. Tests: tests/test_native_cohort_target_cost.cpp, tests/test_native_cohort_target_transcript.cpp, tests/test_native_cohort_target_invalidation.cpp, tests/test_native_cohort_target_bypass.cpp.", line: 2867}
16831686
- {id: "U1664", file: "include/pineforge/drawing.hpp", symbol: "<temp:string>", ops: ["temp"], container: "unresolved by the index: std::string", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 123}
1684-
- {id: "U1665", file: "include/pineforge/drawing.hpp", symbol: "bound_", ops: ["alloc"], container: "unresolved by the index: make_shared", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 710}
1685-
- {id: "U1666", file: "include/pineforge/drawing.hpp", symbol: "candidate", ops: ["alloc"], container: "unresolved by the index: make_shared", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 731}
1687+
- {id: "U1665", file: "include/pineforge/drawing.hpp", symbol: "bound_", ops: ["alloc"], container: "unresolved by the index: make_shared", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 739}
16861688
- {id: "U1667", file: "include/pineforge/drawing.hpp", symbol: "directory", ops: ["decl", "grow"], container: "std::vector<DirectoryEntry>", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 635}
1687-
- {id: "U1668", file: "include/pineforge/drawing.hpp", symbol: "make_shared", ops: ["alloc"], container: "unresolved by the index: make_shared", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 838}
1688-
- {id: "U1669", file: "include/pineforge/drawing.hpp", symbol: "order", ops: ["assign", "decl", "grow"], container: "std::deque<std::int32_t>", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 640}
1689-
- {id: "U1670", file: "include/pineforge/drawing.hpp", symbol: "records", ops: ["decl"], container: "detail::DrawingRecordStore<Rec>", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 763}
1690-
- {id: "U1671", file: "include/pineforge/drawing.hpp", symbol: "slots", ops: ["decl"], container: "std::vector<Slot>", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 638}
1691-
- {id: "U1672", file: "include/pineforge/drawing.hpp", symbol: "value", ops: ["grow"], container: "unresolved by the index: value.emplace(...)", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 845}
1689+
- {id: "U1669", file: "include/pineforge/drawing.hpp", symbol: "order", ops: ["assign", "decl", "grow"], container: "std::deque<std::int32_t>", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 658}
1690+
- {id: "U1670", file: "include/pineforge/drawing.hpp", symbol: "records", ops: ["decl"], container: "detail::DrawingRecordStore<Rec>", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 801}
1691+
- {id: "U1671", file: "include/pineforge/drawing.hpp", symbol: "slots", ops: ["decl", "grow"], container: "DrawingRecordStore<Slot>", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 636}
1692+
- {id: "U1672", file: "include/pineforge/drawing.hpp", symbol: "value", ops: ["grow"], container: "unresolved by the index: value.emplace(...)", owner: "script-state", phase: "unclassified", state: "unreviewed", line: 890}
16921693
- {id: "U1673", file: "include/pineforge/owned_storage.hpp", symbol: "<temp:Base>", ops: ["temp"], container: "unresolved by the index: Base", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 342}
16931694
- {id: "U1674", file: "include/pineforge/owned_storage.hpp", symbol: "<temp:OwnedDeque>", ops: ["temp"], container: "unresolved by the index: OwnedDeque", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 341}
16941695
- {id: "U1675", file: "include/pineforge/owned_storage.hpp", symbol: "<temp:deque>", ops: ["temp"], container: "unresolved by the index: std::deque<T, OwnedAllocator<T>>", owner: "engine-core", phase: "unclassified", state: "unreviewed", line: 338}

‎ci/cr150-source-sites.json‎

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,12 +2868,51 @@
28682868
"namespace pineforge #1",
28692869
"namespace detail #2",
28702870
"template < class Rec > struct BoundDrawingState #1",
2871-
"explicit BoundDrawingState ( DrawingBoundConfig config ) : slots ( storage_slots ( config ) ) , slot_bound ( config . slot_bound ) , pending_creation_slots ( config . pending_creation_slots ) #1"
2871+
"explicit BoundDrawingState ( DrawingBoundConfig config ) : slot_bound ( config . slot_bound ) , pending_creation_slots ( config . pending_creation_slots ) #1"
28722872
],
28732873
"cls": "grow",
28742874
"spelling": "directory . reserve ( . . . )",
28752875
"ordinal": 1
28762876
},
2877+
{
2878+
"file": "include/pineforge/drawing.hpp",
2879+
"symbol": "slots",
2880+
"scope": [
2881+
"namespace pineforge #1",
2882+
"namespace detail #2",
2883+
"template < class Rec > struct BoundDrawingState #1",
2884+
"explicit BoundDrawingState ( DrawingBoundConfig config ) : slot_bound ( config . slot_bound ) , pending_creation_slots ( config . pending_creation_slots ) #1"
2885+
],
2886+
"cls": "grow",
2887+
"spelling": "slots . push_back ( . . . )",
2888+
"ordinal": 1
2889+
},
2890+
{
2891+
"file": "include/pineforge/drawing.hpp",
2892+
"symbol": "directory",
2893+
"scope": [
2894+
"namespace pineforge #1",
2895+
"namespace detail #2",
2896+
"template < class Rec > struct BoundDrawingState #1",
2897+
"BoundDrawingState ( const BoundDrawingState & other ) : slots ( other . slots ) , order ( other . order ) , next_id ( other . next_id ) , slot_bound ( other . slot_bound ) , pending_creation_slots ( other . pending_creation_slots ) , free_from ( other . free_from ) #1"
2898+
],
2899+
"cls": "grow",
2900+
"spelling": "directory . reserve ( . . . )",
2901+
"ordinal": 1
2902+
},
2903+
{
2904+
"file": "include/pineforge/drawing.hpp",
2905+
"symbol": "directory",
2906+
"scope": [
2907+
"namespace pineforge #1",
2908+
"namespace detail #2",
2909+
"template < class Rec > struct BoundDrawingState #1",
2910+
"BoundDrawingState ( const BoundDrawingState & other ) : slots ( other . slots ) , order ( other . order ) , next_id ( other . next_id ) , slot_bound ( other . slot_bound ) , pending_creation_slots ( other . pending_creation_slots ) , free_from ( other . free_from ) #1"
2911+
],
2912+
"cls": "grow",
2913+
"spelling": "directory . assign ( . . . )",
2914+
"ordinal": 1
2915+
},
28772916
{
28782917
"file": "include/pineforge/drawing.hpp",
28792918
"symbol": "slots",
@@ -2883,7 +2922,7 @@
28832922
"template < class Rec > struct BoundDrawingState #1"
28842923
],
28852924
"cls": "decl",
2886-
"spelling": "std :: vector < Slot >",
2925+
"spelling": "DrawingRecordStore < Slot >",
28872926
"ordinal": 1
28882927
},
28892928
{
@@ -2944,18 +2983,6 @@
29442983
"spelling": "make_shared",
29452984
"ordinal": 1
29462985
},
2947-
{
2948-
"file": "include/pineforge/drawing.hpp",
2949-
"symbol": "candidate",
2950-
"scope": [
2951-
"namespace pineforge #1",
2952-
"template < class Rec > class DrawingArena #1",
2953-
"template < class Edit > void bound_edit ( int32_t id , Edit && edit ) #1"
2954-
],
2955-
"cls": "alloc",
2956-
"spelling": "make_shared",
2957-
"ordinal": 1
2958-
},
29592986
{
29602987
"file": "include/pineforge/drawing.hpp",
29612988
"symbol": "bound_",
@@ -3035,7 +3062,7 @@
30353062
},
30363063
{
30373064
"file": "include/pineforge/drawing.hpp",
3038-
"symbol": "make_shared",
3065+
"symbol": "bound_",
30393066
"scope": [
30403067
"namespace pineforge #1",
30413068
"template < class Rec > class DrawingArena #1",
@@ -3047,50 +3074,50 @@
30473074
},
30483075
{
30493076
"file": "include/pineforge/drawing.hpp",
3050-
"symbol": "make_shared",
3077+
"symbol": "directory",
30513078
"scope": [
30523079
"namespace pineforge #1",
30533080
"template < class Rec > class DrawingArena #1",
30543081
"[ [ nodiscard ] ] DrawingAllocationResult try_alloc ( Rec r ) #1"
30553082
],
3056-
"cls": "alloc",
3057-
"spelling": "make_shared",
3058-
"ordinal": 2
3083+
"cls": "grow",
3084+
"spelling": "directory . reserve ( . . . )",
3085+
"ordinal": 1
30593086
},
30603087
{
30613088
"file": "include/pineforge/drawing.hpp",
3062-
"symbol": "value",
3089+
"symbol": "order",
30633090
"scope": [
30643091
"namespace pineforge #1",
30653092
"template < class Rec > class DrawingArena #1",
30663093
"[ [ nodiscard ] ] DrawingAllocationResult try_alloc ( Rec r ) #1"
30673094
],
30683095
"cls": "grow",
3069-
"spelling": "value . emplace ( . . . )",
3096+
"spelling": "order . push_back ( . . . )",
30703097
"ordinal": 1
30713098
},
30723099
{
30733100
"file": "include/pineforge/drawing.hpp",
3074-
"symbol": "directory",
3101+
"symbol": "value",
30753102
"scope": [
30763103
"namespace pineforge #1",
30773104
"template < class Rec > class DrawingArena #1",
30783105
"[ [ nodiscard ] ] DrawingAllocationResult try_alloc ( Rec r ) #1"
30793106
],
30803107
"cls": "grow",
3081-
"spelling": "directory . push_back ( . . . )",
3108+
"spelling": "value . emplace ( . . . )",
30823109
"ordinal": 1
30833110
},
30843111
{
30853112
"file": "include/pineforge/drawing.hpp",
3086-
"symbol": "order",
3113+
"symbol": "directory",
30873114
"scope": [
30883115
"namespace pineforge #1",
30893116
"template < class Rec > class DrawingArena #1",
30903117
"[ [ nodiscard ] ] DrawingAllocationResult try_alloc ( Rec r ) #1"
30913118
],
30923119
"cls": "grow",
3093-
"spelling": "order . push_back ( . . . )",
3120+
"spelling": "directory . push_back ( . . . )",
30943121
"ordinal": 1
30953122
},
30963123
{
@@ -3117,19 +3144,6 @@
31173144
"spelling": "order_ . push_back ( . . . )",
31183145
"ordinal": 1
31193146
},
3120-
{
3121-
"file": "include/pineforge/drawing.hpp",
3122-
"symbol": "candidate",
3123-
"scope": [
3124-
"namespace pineforge #1",
3125-
"template < class Rec > class DrawingArena #1",
3126-
"void erase ( int32_t id ) #1",
3127-
"if ( bound_ ) #1"
3128-
],
3129-
"cls": "alloc",
3130-
"spelling": "make_shared",
3131-
"ordinal": 1
3132-
},
31333147
{
31343148
"file": "include/pineforge/drawing.hpp",
31353149
"symbol": "text",

0 commit comments

Comments
 (0)