Skip to content

Commit 69bc8d6

Browse files
committed
Admit a wrapped-helper zero-boundary witness
1 parent 1077755 commit 69bc8d6

9 files changed

Lines changed: 139 additions & 16 deletions

File tree

‎research/k8-phase-local-gauges/CERTIFICATE.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎research/k8-phase-local-gauges/PROOF.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ This proves the declared one-helper optimum, conditional on the source-bound
7575
finite input and retained primitive cost model. It does not prove an all-circuit
7676
or all-helper bound. The same argument applies after fixing PR1214's fully priced
7777
two-helper word; only one new phase-local helper is optimized in that comparison.
78+
The identity boundary in that composition is relative to the fixed PR1214 word;
79+
its existing two constant gauges and their transfer assumptions are inherited.
80+
The wrapped L652 witness instead applies the zero-boundary rule directly to the
81+
selected original word, including both residual-wrapper boundaries.
7882

7983
## Separate checks and limits
8084

‎research/k8-phase-local-gauges/README.md‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ complex call**: its unrestricted saving 344 becomes 340. L427 likewise pays 4,
1717
while L359 pays zero. [BOUNDARY-COMPARISON.json](BOUNDARY-COMPARISON.json) records
1818
the full 16-helper comparison and four corruption/coverage controls.
1919

20+
Among the **240 wrapped helpers**, the exact best reset schedule is L652, saving
21+
**72 primitives per complex call**. Its complete forward/backward words are also
22+
materialized, literally replayed and admitted by the retained local frame/wrapper
23+
checker. This demonstrates a helper interface excluded by PR1259's unwrapped domain.
24+
2025
On the source-bound PR1094/PR1042 k8 word, the exact best single-helper schedule
2126
is L427, with 22 new SCALE macros in each orientation. It saves **522 real scalar
2227
primitives per complex call** (261 per real/imaginary component), compared with
@@ -52,22 +57,25 @@ gauge class differ: the latter may remain nonzero across non-scalar events.
5257

5358
The composed claim fixes PR1214's two-helper witness and optimizes **one extra
5459
phase-local helper**. It is not a global three-helper or all-helper optimum.
60+
In this comparison, the added gauge is zero at each boundary **relative to the
61+
fixed PR1214 word**; PR1214's two constant gauges and their inherited transfer
62+
assumptions remain. It does not make those predecessor gauges zero at boundaries.
5563
No native C++ compiler, complete hosting/invoice, outer moment, selected cold
5664
replay, CI or Lean result is claimed. The unchanged emitted Python frame/wrapper
5765
checker is a local check, distinct from those obligations. All-size/compiler,
5866
realization, hosting, precision/tape, analytic and bit assumptions remain.
5967

6068
- Main DP: 95,490 vertices per orientation on the selected word; 94,261 on PR1214.
6169
- Separate distance-transform DP uses literal PR696 lowerer lengths on a padded
62-
domain: **1,908 helper minima**, **758,270 vertices**, all agree exactly.
70+
domain: all **1,908** census minima, plus both wrapped-witness minima, agree exactly.
6371
- Independently reconstructed unrestricted minima agree with all **32** values
6472
in the pinned PR1259 certificate; exact boundary premiums distinguish the classes.
65-
- Literal lowered replay: **296,404 primitives** across four candidate words,
73+
- Literal lowered replay: **445,342 primitives** across six candidate words,
6674
all **713** initial columns, including initially dirty coefficient work.
6775
- Original macro replay separately checks all 712 data/helper/center columns.
68-
- Unchanged source-pinned frame/wrapper checker: both versions, both orientations,
76+
- Unchanged source-pinned frame/wrapper checker: three versions, both orientations,
6977
all **25 inherited mutation controls** rejected for each version.
70-
- Nine package test groups include 258 exhaustive tiny shortest-path instances,
78+
- Ten package test groups include 258 exhaustive tiny shortest-path instances,
7179
unit-discount, domain-expansion, missing-scale, wrong-orientation pricing,
7280
nonzero-boundary and source-corruption controls. Checks also pass with `-O`.
7381

@@ -95,7 +103,7 @@ python3 -I -B research/k8-phase-local-gauges/frame_replay.py
95103
```
96104

97105
Expected markers: `PASS_K8_PHASE_LOCAL_GAUGES`,
98-
`PASS_INDEPENDENT_PHASE_GAUGES`, nine tests `OK`, and two
106+
`PASS_INDEPENDENT_PHASE_GAUGES`, ten tests `OK`, and three
99107
`PASS_INDEPENDENT_LOCAL_SCALAR_FRAME_AND_WRAPPER_REPLAY` receipts with 25 controls.
100108
The source-pinned historical frame checker uses assertions; its subprocess always
101109
runs without `-O`, even if the driver is invoked with `-O`.
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
{
22
"status": "PASS_COMPLETE_SCOPED_PACKAGE",
33
"base": "dadfea6e8a78ff6ba901705f87532a71c6f5bbb8",
4-
"timestamp_utc": "2026-10-13T21:24:23.019964+00:00",
4+
"timestamp_utc": "2026-10-13T21:30:12.618897+00:00",
55
"platform": "macOS-27.0.1-arm64-arm-64bit-Mach-O",
66
"main_interpreter": "3.14.7",
77
"portable_interpreter": "CPython 3.12.13",
88
"checks": [
99
"Complete reproduce.py on CPython3.12.13",
1010
"Main and independent checks under isolated optimized default Python",
11-
"Nine test groups under isolated optimized Python",
11+
"Ten test groups under isolated optimized Python",
1212
"25 selected-record source/inventory tests",
1313
"verify_selected_result.py",
1414
"research_baseline.py (source bindings only)",
1515
"Complete offline relocated replay from path containing a space with exactly12 external pinned files",
16-
"Exact pinned PR1259 comparison: all32 unrestricted minima; four corruption/domain controls"
16+
"Exact pinned PR1259 comparison: all32 unrestricted minima; four corruption/domain controls",
17+
"Wrapped L652 full literal and emitted frame/wrapper admission, both orientations"
1718
],
1819
"overlap_refresh": {
19-
"open_prs": 855,
20-
"newest_pr": 1261,
20+
"open_prs": 860,
21+
"newest_pr": 1268,
2122
"main": "dadfea6e8a78ff6ba901705f87532a71c6f5bbb8",
2223
"closest": [
2324
1161,
@@ -31,13 +32,19 @@
3132
"new_overlap_found": true,
3233
"resolution": "Credit PR1259 varying-gauge/clipping mechanism; distinct zero-at-every-nonscalar contract, exact restriction-price comparison, wrapped-helper coverage and emitted local frame/wrapper admission. No composition with PR1263."
3334
},
34-
"certificate_sha256": "a86a8f223f421227ed2fa6f3d3e4d807bcb2045fd53482234a583a163ce971f5",
35+
"certificate_sha256": "072fd0970d6a7d5b06b1d2def082aa6e1b83800c1b3f6e05b889d6773c20d705",
3536
"not_run": [
3637
"Native C++ compiler",
3738
"Complete hosting/global invoice",
3839
"Selected cold replay",
3940
"Remote CI",
4041
"Lean"
4142
],
42-
"changes_kappa": false
43+
"changes_kappa": false,
44+
"independent_totals": {
45+
"helper_minima": 1910,
46+
"padded_vertices": 759448,
47+
"literal_primitives": 445342,
48+
"formal_columns": 713
49+
}
4350
}

‎research/k8-phase-local-gauges/frame_replay.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def main():
2020
lib = v.engine()
2121
with tarfile.open(v.ROOT / lib.ARCHIVE) as archive:
2222
word = archive.extractfile('slots/local/CANONICAL-WORD.json.gz').read()
23-
for prefix in ('', 'pr1214_'):
23+
for prefix in ('', 'pr1214_', 'wrapped_'):
2424
programs = {orientation: witnesses[prefix + orientation]
2525
for orientation in ('forward', 'backward')}
2626
with tempfile.TemporaryDirectory(prefix='k8-phase-gauges-') as directory:

‎research/k8-phase-local-gauges/independent.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def main():
154154
word, programs, _, _ = lib.load()
155155
cert = json.loads((HERE / 'CERTIFICATE.json').read_text())
156156
total_vertices, rows_checked, primitives = 0, 0, 0
157-
for scenario in ('orientations', 'on_pr1214'):
157+
for scenario in ('orientations', 'on_pr1214', 'wrapped_example'):
158158
for orientation, original in programs.items():
159159
events = original
160160
if scenario == 'on_pr1214':

‎research/k8-phase-local-gauges/test_package.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ def test_09_profiles_and_full_cost(self):
115115
result['after']['complex_primitives'], 1094)
116116
self.assertLessEqual(result['after']['prefix_bits'], 68)
117117

118+
def test_10_wrapped_witness_is_inside_wrapper_domain(self):
119+
for orientation, events in self.programs.items():
120+
result = self.receipt['wrapped_example'][orientation]
121+
self.assertEqual((result['helper'], result['delta'], result['wrapped_helpers_checked']),
122+
(652, -36, 240))
123+
self.assertIn(652, {e[2] for e in events if e[0] == 'residual_adapter'})
124+
self.assertEqual(result['before']['paid_profile'], result['after']['paid_profile'])
125+
118126

119127
if __name__ == '__main__':
120128
unittest.main(verbosity=2)

‎research/k8-phase-local-gauges/verify.py‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def compute():
154154
helpers, excluded = lib.domain(word, programs)
155155
receipt = {'base': BASE, 'seed': 26, 'status': 'PASS_K8_PHASE_LOCAL_GAUGES',
156156
'scope': 'one helper, all integer exponents, reset at every non-scalar event',
157-
'excluded_helpers': excluded, 'orientations': {}, 'on_pr1214': {}}
157+
'excluded_helpers': excluded, 'orientations': {}, 'on_pr1214': {}, 'wrapped_example': {}}
158158
witnesses = {}
159159
for orientation, events in programs.items():
160160
result = census(lib, events, helpers)
@@ -171,6 +171,29 @@ def compute():
171171
result['inserted_scales'] = len(candidate) - len(events)
172172
receipt['orientations'][orientation] = result
173173
witnesses[orientation] = candidate
174+
wrapped = {event[2] for event in events if event[0] == 'residual_adapter'}
175+
wrapped_rows = [row for row in result['rows'] if row[0] in wrapped]
176+
need(len(wrapped_rows) == 240, 'wrapped helper domain')
177+
best_wrapped = min(wrapped_rows, key=lambda row: (row[1], row[0]))
178+
h = best_wrapped[0]
179+
stream = terms(lib, events, [h])[h]
180+
plan = []
181+
for run, rs in sorted(stream.items()):
182+
answer = solve_run(rs)
183+
if any(answer['path']):
184+
plan.append({'run': run, 'terms': rs, **answer})
185+
wrapped_word = construct(lib, events, h, plan)
186+
wrapped_price = lib.invoice(wrapped_word, 'copy-init')
187+
need(wrapped_price['real_primitives'] - before['real_primitives'] == best_wrapped[1],
188+
'wrapped candidate full invoice')
189+
need(wrapped_price['paid_profile'] == before['paid_profile'], 'wrapped profile')
190+
receipt['wrapped_example'][orientation] = {
191+
'helper': h, 'delta': best_wrapped[1], 'rows': [best_wrapped], 'schedule': plan,
192+
'wrapped_helpers_checked': 240, 'before': before, 'after': wrapped_price,
193+
'candidate_endpoint': lib.replay(wrapped_word, orientation),
194+
'candidate_sha256': sha(canonical(wrapped_word)),
195+
'inserted_scales': len(wrapped_word) - len(events)}
196+
witnesses['wrapped_' + orientation] = wrapped_word
174197
# Retain the predecessor's fixed two-helper witness, independently
175198
# reconstruct and price it; do not inherit its optimum as a new claim.
176199
pair_info = json.loads((HERE / 'vendor/pr1214/CERTIFICATE.json').read_text())
@@ -215,6 +238,8 @@ def main():
215238
for orientation, result in receipt['on_pr1214'].items():
216239
print('on_pr1214', orientation, 'helper', result['helper'], 'extra per-component saving',
217240
-result['delta'], 'complete complex invoice', result['after']['complex_primitives'])
241+
for orientation, result in receipt['wrapped_example'].items():
242+
print('wrapped', orientation, 'helper', result['helper'], 'per-component saving', -result['delta'])
218243

219244

220245
if __name__ == '__main__':
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"status": "PASS_INDEPENDENT_LOCAL_SCALAR_FRAME_AND_WRAPPER_REPLAY",
3+
"canonical_word_sha256": "16bc0ebb04b4be6c0ade74badc6a0c0cdba4215eda86e4ff9f13abf8ecebd219",
4+
"local_programs_sha256": "c02ba361b82dd9356959a54fbe8173390df67486ba2e9f99276a8ec41e0f3d5c",
5+
"v": 112,
6+
"helpers": 480,
7+
"local": {
8+
"forward": {
9+
"all_exact_columns": 704,
10+
"prefix_l1_upper": "2765345294379392599/1024",
11+
"prefix_bits_upper": 52,
12+
"charged_payload_bits": 192,
13+
"private_work_erased": true
14+
},
15+
"backward": {
16+
"all_exact_columns": 704,
17+
"prefix_l1_upper": "14824960514781440791821/64",
18+
"prefix_bits_upper": 68,
19+
"charged_payload_bits": 192,
20+
"private_work_erased": true
21+
}
22+
},
23+
"paid_profiles": {
24+
"forward": {
25+
"1": 2412,
26+
"4": 142,
27+
"8": 8,
28+
"3": 432,
29+
"2": 418,
30+
"5": 82
31+
},
32+
"backward": {
33+
"1": 2412,
34+
"4": 142,
35+
"8": 8,
36+
"3": 432,
37+
"2": 418,
38+
"5": 82
39+
}
40+
},
41+
"entering_helpers": 192,
42+
"cold_hyperplane_ended_helpers": 48,
43+
"negative_controls_rejected": [
44+
"wrong_scale",
45+
"missing_center",
46+
"wrong_common_frame",
47+
"wrong_child_rank",
48+
"missing_pre_wrapper",
49+
"missing_post_wrapper",
50+
"wrapper_with_wrong_frame",
51+
"wrapper_in_wrong_phase",
52+
"wrapper_on_a_data_register",
53+
"wrapper_on_a_target_register",
54+
"wrapper_on_a_centre_register",
55+
"hpe_pre_wrapper_resolved_to_full_recipe",
56+
"hpe_post_wrapper_without_terminal_frame",
57+
"hpe_post_wrapper_wrong_terminal_frame",
58+
"hpe_tail_gate_at_full_frame",
59+
"hpe_tail_climb_dropped",
60+
"hpe_helper_exit_adapter_to_full",
61+
"hpe_tail_gate_moved_into_full_cleanup",
62+
"cold_hpe_pre_wrapper_replaced_by_identity_entry_adapter",
63+
"cold_hpe_pre_wrapper_dropped",
64+
"cold_hpe_post_wrapper_replaced_by_exit_adapter",
65+
"cold_hpe_pre_wrapper_resolved_to_cold_full_convention",
66+
"cold_hpe_wrapper_with_nonzero_entrance",
67+
"cold_hpe_post_wrapper_wrong_terminal_frame",
68+
"cold_hpe_premix_gate_before_pre_wrapper"
69+
],
70+
"scope": "Literal forward and inverse-transpose replay on every arbitrary data/helper column, physical frame incidence, ordered paid wrappers, cleared private work and prefix coefficients. Global hosting and outer exponent are separate."
71+
}

0 commit comments

Comments
 (0)