From f9775081ed1a80d56c00228828bfdbf4815befa0 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Fri, 17 Apr 2026 18:18:51 -0400 Subject: [PATCH] =?UTF-8?q?whitepaper:=20polish=20=E2=80=94=20Env.lookup?= =?UTF-8?q?=20fix=20noted,=20C=20line=20count=20accurate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small updates surfaced by the whitepaper audit + the just-landed Env.lookup commit (68c3d3a): 1. §12.1 MOAD-0001 adds a third correctness fix (Env.lookup shortcut skipping intermediate parent frames). The bug got triggered by the portal-over-HTTP client where a let-loop accumulator named `count` collided with the SRFI-1 `count` builtin; the inner (let ((next ...))) frame had no `count`, the shortcut returned the global builtin, and OP_LOOK_ADD1 died with `function + int`. 2. Abstract's C line count refined: "~9,000 lines" → "9,164 lines of runtime C (plus ~1,200 in the test harness)" to match the real numbers. The main story, four scopes of feedback, and all benchmark numbers remain current. No other drift. --- whitepaper/uncommonlisp-whitepaper.pdf | 306 +++++++++++++------------ whitepaper/uncommonlisp-whitepaper.rst | 4 +- 2 files changed, 159 insertions(+), 151 deletions(-) diff --git a/whitepaper/uncommonlisp-whitepaper.pdf b/whitepaper/uncommonlisp-whitepaper.pdf index 41eb0e1..4ae3e4d 100644 --- a/whitepaper/uncommonlisp-whitepaper.pdf +++ b/whitepaper/uncommonlisp-whitepaper.pdf @@ -246,7 +246,7 @@ endobj << /A << /S /URI /Type /Action /URI (mailto:russell@unturf.com) ->> /Border [ 0 0 0 ] /Rect [ 248.0736 359.0236 334.3536 371.0236 ] /Subtype /Link /Type /Annot +>> /Border [ 0 0 0 ] /Rect [ 248.0736 269.0236 334.3536 281.0236 ] /Subtype /Link /Type /Annot >> endobj 31 0 obj @@ -263,14 +263,14 @@ endobj << /A << /S /URI /Type /Action /URI (mailto:russell@unturf) ->> /Border [ 0 0 0 ] /Rect [ 134.8436 557.8236 202.0657 569.8236 ] /Subtype /Link /Type /Annot +>> /Border [ 0 0 0 ] /Rect [ 134.8436 458.6236 202.0657 470.6236 ] /Subtype /Link /Type /Annot >> endobj 33 0 obj << /A << /S /URI /Type /Action /URI (https://undefect.com/public/stress-on-our-shared-heart/) ->> /Border [ 0 0 0 ] /Rect [ 247.8136 557.8236 385.3838 569.8236 ] /Subtype /Link /Type /Annot +>> /Border [ 0 0 0 ] /Rect [ 247.8136 458.6236 385.3838 470.6236 ] /Subtype /Link /Type /Annot >> endobj 34 0 obj @@ -287,14 +287,14 @@ endobj << /A << /S /URI /Type /Action /URI (https://undefect.com/public/stress-on-our-shared-heart/) ->> /Border [ 0 0 0 ] /Rect [ 293.562 681.0236 417.502 693.0236 ] /Subtype /Link /Type /Annot +>> /Border [ 0 0 0 ] /Rect [ 293.562 597.0236 417.502 609.0236 ] /Subtype /Link /Type /Annot >> endobj 36 0 obj << /A << /S /URI /Type /Action /URI (mailto:russell@unturf) ->> /Border [ 0 0 0 ] /Rect [ 423.062 681.0236 487.672 693.0236 ] /Subtype /Link /Type /Annot +>> /Border [ 0 0 0 ] /Rect [ 423.062 597.0236 487.672 609.0236 ] /Subtype /Link /Type /Annot >> endobj 37 0 obj @@ -344,7 +344,7 @@ endobj endobj 42 0 obj << -/Author () /CreationDate (D:20260417140439-04'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20260417140439-04'00') /Producer (ReportLab PDF Library - \(opensource\)) +/Author () /CreationDate (D:20260417181837-04'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20260417181837-04'00') /Producer (ReportLab PDF Library - \(opensource\)) /Subject (\(unspecified\)) /Title () /Trapped /False >> endobj @@ -588,37 +588,37 @@ endobj endobj 89 0 obj << -/Dest [ 31 0 R /XYZ 57.02362 637.0236 0 ] /Next 90 0 R /Parent 87 0 R /Prev 88 0 R /Title (12.2 MOAD-0002: The Intertangle in Our Own Design) +/Dest [ 31 0 R /XYZ 57.02362 547.0236 0 ] /Next 90 0 R /Parent 87 0 R /Prev 88 0 R /Title (12.2 MOAD-0002: The Intertangle in Our Own Design) >> endobj 90 0 obj << -/Dest [ 31 0 R /XYZ 57.02362 395.0236 0 ] /Parent 87 0 R /Prev 89 0 R /Title (12.3 Our Shared Infrastructure) +/Dest [ 31 0 R /XYZ 57.02362 305.0236 0 ] /Parent 87 0 R /Prev 89 0 R /Title (12.3 Our Shared Infrastructure) >> endobj 91 0 obj << -/Dest [ 31 0 R /XYZ 57.02362 179.0236 0 ] /Next 92 0 R /Parent 44 0 R /Prev 87 0 R /Title (13. Future Work) +/Dest [ 34 0 R /XYZ 57.02362 765.0236 0 ] /Next 92 0 R /Parent 44 0 R /Prev 87 0 R /Title (13. Future Work) >> endobj 92 0 obj << -/Dest [ 34 0 R /XYZ 57.02362 609.0236 0 ] /Next 93 0 R /Parent 44 0 R /Prev 91 0 R /Title (14. The Defect in the Model) +/Dest [ 34 0 R /XYZ 57.02362 509.8236 0 ] /Next 93 0 R /Parent 44 0 R /Prev 91 0 R /Title (14. The Defect in the Model) >> endobj 93 0 obj << -/Dest [ 37 0 R /XYZ 57.02362 615.0236 0 ] /Next 94 0 R /Parent 44 0 R /Prev 92 0 R /Title (Citation) +/Dest [ 37 0 R /XYZ 57.02362 531.0236 0 ] /Next 94 0 R /Parent 44 0 R /Prev 92 0 R /Title (Citation) >> endobj 94 0 obj << -/Dest [ 37 0 R /XYZ 57.02362 533.8236 0 ] /Next 95 0 R /Parent 44 0 R /Prev 93 0 R /Title (References) +/Dest [ 37 0 R /XYZ 57.02362 449.8236 0 ] /Next 95 0 R /Parent 44 0 R /Prev 93 0 R /Title (References) >> endobj 95 0 obj << -/Dest [ 37 0 R /XYZ 57.02362 452.6236 0 ] /Parent 44 0 R /Prev 94 0 R /Title (License) +/Dest [ 37 0 R /XYZ 57.02362 368.6236 0 ] /Parent 44 0 R /Prev 94 0 R /Title (License) >> endobj 96 0 obj @@ -630,7 +630,7 @@ endobj endobj 97 0 obj << -/Length 4839 +/Length 4887 >> stream 1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET @@ -770,7 +770,7 @@ Q q 1 0 0 1 23 -3 cm q -BT 1 0 0 1 0 14 Tm .220556 Tw 12 TL /F3 10 Tf 0 0 0 rg (C interpreter + x86_64 JIT) Tj /F1 10 Tf ( \227 ~9,000 lines, 7--10\327 faster than CPython on recursive workloads, JSON) Tj T* 0 Tw (portal) Tj T* ET +BT 1 0 0 1 0 14 Tm .368241 Tw 12 TL /F3 10 Tf 0 0 0 rg (C interpreter + x86_64 JIT) Tj /F1 10 Tf ( \227 9,164 lines of runtime C \(plus ~1,200 in the test harness\), 7--10\327 faster) Tj T* 0 Tw (than CPython on recursive workloads, JSON portal) Tj T* ET Q Q q @@ -7389,7 +7389,7 @@ endstream endobj 114 0 obj << -/Length 8325 +/Length 8222 >> stream 1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET @@ -7447,33 +7447,39 @@ q 1 0 0 1 57.02362 669.0236 cm Q q -1 0 0 1 57.02362 651.0236 cm +1 0 0 1 57.02362 579.0236 cm +q +BT 1 0 0 1 0 74 Tm 4.926213 Tw 12 TL /F1 10 Tf 0 0 0 rg (A third correctness fix landed after the portal-over-HTTP demo exposed it: ) Tj /F5 10 Tf (uncommonlisp.py) Tj /F1 10 Tf ('s) Tj T* 0 Tw .515223 Tw /F5 10 Tf (Env.lookup) Tj /F1 10 Tf ( used to short-cut from the local frame directly to the global frame before walking intermediate) Tj T* 0 Tw 1.47713 Tw (parents. That was fast but wrong \227 a let-loop parameter named the same as a global builtin \() Tj /F5 10 Tf (count) Tj /F1 10 Tf (, a) Tj T* 0 Tw .409897 Tw (SRFI-1 procedure\) got shadowed in reverse, the shortcut returned the global builtin instead of walking up to) Tj T* 0 Tw .07402 Tw (the loop's parameter frame. Fix: walk ) Tj /F5 10 Tf (self) Tj ( ) Tj /F6 10 Tf 12 TL (\256) Tj /F5 10 Tf 12 TL ( ) Tj (self.p) Tj ( ) Tj /F6 10 Tf 12 TL (\256) Tj /F5 10 Tf 12 TL ( ) Tj (...) Tj ( ) Tj /F6 10 Tf 12 TL (\256) Tj /F5 10 Tf 12 TL ( ) Tj (global) Tj /F1 10 Tf ( in order, without any shortcut.) Tj T* 0 Tw 1.17189 Tw (The inline cache at ) Tj /F5 10 Tf (OP_LOOKUP) Tj /F1 10 Tf ( was correspondingly tightened to validate the full chain before firing. 975) Tj T* 0 Tw (tests remained green.) Tj T* ET +Q +Q +q +1 0 0 1 57.02362 561.0236 cm q 0 0 0 rg BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (Every release audit surfaces more. Writing new code is writing new sediment, unless the audit runs.) Tj T* ET Q Q q -1 0 0 1 57.02362 625.0236 cm +1 0 0 1 57.02362 535.0236 cm q BT 1 0 0 1 0 2 Tm 12 TL /F2 10 Tf .133333 .133333 .133333 rg (12.2 MOAD-0002: The Intertangle in Our Own Design) Tj T* ET Q Q q -1 0 0 1 57.02362 607.0236 cm +1 0 0 1 57.02362 517.0236 cm q 0 0 0 rg BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (All three implementations share mutable global state between subsystems:) Tj T* ET Q Q q -1 0 0 1 57.02362 601.0236 cm +1 0 0 1 57.02362 511.0236 cm Q q -1 0 0 1 57.02362 601.0236 cm +1 0 0 1 57.02362 511.0236 cm Q q -1 0 0 1 57.02362 553.0236 cm +1 0 0 1 57.02362 463.0236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7495,10 +7501,10 @@ Q Q Q q -1 0 0 1 57.02362 547.0236 cm +1 0 0 1 57.02362 457.0236 cm Q q -1 0 0 1 57.02362 511.0236 cm +1 0 0 1 57.02362 421.0236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7520,10 +7526,10 @@ Q Q Q q -1 0 0 1 57.02362 505.0236 cm +1 0 0 1 57.02362 415.0236 cm Q q -1 0 0 1 57.02362 469.0236 cm +1 0 0 1 57.02362 379.0236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7545,25 +7551,25 @@ Q Q Q q -1 0 0 1 57.02362 451.0236 cm +1 0 0 1 57.02362 361.0236 cm Q q -1 0 0 1 57.02362 409.0236 cm +1 0 0 1 57.02362 319.0236 cm q BT 1 0 0 1 0 26 Tm .770556 Tw 12 TL /F1 10 Tf 0 0 0 rg (We documented these rather than refactoring them. In each case, the coupling exists for performance \(the) Tj T* 0 Tw .79631 Tw (globals are on hot paths\) or necessity \() Tj /F5 10 Tf (setjmp) Tj /F1 10 Tf ( requires thread-local state\). The documentation makes the) Tj T* 0 Tw (coupling visible so future work can decouple selectively.) Tj T* ET Q Q q -1 0 0 1 57.02362 383.0236 cm +1 0 0 1 57.02362 293.0236 cm q BT 1 0 0 1 0 2 Tm 12 TL /F2 10 Tf .133333 .133333 .133333 rg (12.3 Our Shared Infrastructure) Tj T* ET Q Q q -1 0 0 1 57.02362 371.0236 cm +1 0 0 1 57.02362 281.0236 cm Q q -1 0 0 1 57.02362 359.0236 cm +1 0 0 1 57.02362 269.0236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7579,41 +7585,50 @@ Q Q Q q -1 0 0 1 57.02362 359.0236 cm +1 0 0 1 57.02362 269.0236 cm Q q -1 0 0 1 57.02362 305.0236 cm +1 0 0 1 57.02362 215.0236 cm q BT 1 0 0 1 0 38 Tm 1.468917 Tw 12 TL /F1 10 Tf 0 0 0 rg (Every MOAD we fixed in our own code is a MOAD we understand better when we find it in others. The) Tj T* 0 Tw 3.534168 Tw (sedimentary defect in ) Tj /F5 10 Tf (intern_symbol) Tj /F1 10 Tf ( is the same pattern as the sedimentary defect in Lean 4's) Tj T* 0 Tw .17985 Tw /F5 10 Tf (check_duplicated_univ_params) Tj /F1 10 Tf (. The intertangle in our global environment register is the same pattern) Tj T* 0 Tw (as the intertangle in any system that routes state through implicit globals instead of explicit parameters.) Tj T* ET Q Q q -1 0 0 1 57.02362 239.0236 cm +1 0 0 1 57.02362 149.0236 cm q BT 1 0 0 1 0 50 Tm 1.036556 Tw 12 TL /F3 10 Tf 0 0 0 rg (Our infrastructure does not extract rent from workaholics to feed gluttons.) Tj /F1 10 Tf ( A symbol table that does) Tj T* 0 Tw .025176 Tw (O\(N\) work per lookup is a workaholic node \227 it does more work than necessary on every operation, and that) Tj T* 0 Tw .250642 Tw (cost compounds through every downstream consumer. Fixing it reduces stress on our shared computational) Tj T* 0 Tw .385785 Tw (heart. The CPU cycles saved are cycles available for the next lambda, the next continuation, the next portal) Tj T* 0 Tw (resume.) Tj T* ET Q Q q -1 0 0 1 57.02362 197.0236 cm +1 0 0 1 57.02362 107.0236 cm q 0 0 0 rg BT 1 0 0 1 0 26 Tm /F1 10 Tf 12 TL 3.447739 Tw (This is the permacomputer obligation: infrastructure that renews itself. Code that gets faster as we) Tj T* 0 Tw .462545 Tw (understand it better. A hash table is not an optimization \227 it is the removal of unnecessary suffering from a) Tj T* 0 Tw (system that deserves better.) Tj T* ET Q Q + +endstream +endobj +115 0 obj +<< +/Length 8475 +>> +stream +1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET q -1 0 0 1 57.02362 165.8236 cm +1 0 0 1 57.02362 751.8236 cm q BT 1 0 0 1 0 2.2 Tm 13.2 TL /F2 11 Tf .133333 .133333 .133333 rg (13. Future Work) Tj T* ET Q Q q -1 0 0 1 57.02362 151.8236 cm +1 0 0 1 57.02362 737.8236 cm Q q -1 0 0 1 57.02362 151.8236 cm +1 0 0 1 57.02362 737.8236 cm Q q -1 0 0 1 57.02362 127.8236 cm +1 0 0 1 57.02362 713.8236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7635,10 +7650,10 @@ Q Q Q q -1 0 0 1 57.02362 121.8236 cm +1 0 0 1 57.02362 707.8236 cm Q q -1 0 0 1 57.02362 85.82362 cm +1 0 0 1 57.02362 671.8236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7660,19 +7675,10 @@ Q Q Q q -1 0 0 1 57.02362 79.82362 cm +1 0 0 1 57.02362 665.8236 cm Q - -endstream -endobj -115 0 obj -<< -/Length 8088 ->> -stream -1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET q -1 0 0 1 57.02362 741.0236 cm +1 0 0 1 57.02362 641.8236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7694,10 +7700,10 @@ Q Q Q q -1 0 0 1 57.02362 735.0236 cm +1 0 0 1 57.02362 635.8236 cm Q q -1 0 0 1 57.02362 711.0236 cm +1 0 0 1 57.02362 611.8236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7719,10 +7725,10 @@ Q Q Q q -1 0 0 1 57.02362 705.0236 cm +1 0 0 1 57.02362 605.8236 cm Q q -1 0 0 1 57.02362 681.0236 cm +1 0 0 1 57.02362 581.8236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7744,10 +7750,10 @@ Q Q Q q -1 0 0 1 57.02362 675.0236 cm +1 0 0 1 57.02362 575.8236 cm Q q -1 0 0 1 57.02362 663.0236 cm +1 0 0 1 57.02362 563.8236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7769,10 +7775,10 @@ Q Q Q q -1 0 0 1 57.02362 657.0236 cm +1 0 0 1 57.02362 557.8236 cm Q q -1 0 0 1 57.02362 645.0236 cm +1 0 0 1 57.02362 545.8236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7794,61 +7800,61 @@ Q Q Q q -1 0 0 1 57.02362 627.0236 cm +1 0 0 1 57.02362 527.8236 cm Q q -1 0 0 1 57.02362 595.8236 cm +1 0 0 1 57.02362 496.6236 cm q BT 1 0 0 1 0 2.2 Tm 13.2 TL /F2 11 Tf .133333 .133333 .133333 rg (14. The Defect in the Model) Tj T* ET Q Q q -1 0 0 1 57.02362 575.8236 cm +1 0 0 1 57.02362 476.6236 cm q 0 0 0 rg BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (This paper is evidence of a problem that extends beyond any single codebase.) Tj T* ET Q Q q -1 0 0 1 57.02362 509.8236 cm +1 0 0 1 57.02362 410.6236 cm q BT 1 0 0 1 0 50 Tm .653022 Tw 12 TL /F1 10 Tf 0 0 0 rg (On April 4, 2026, ) Tj 0 .4 .6 rg (russell@unturf) Tj 0 0 0 rg ( published ) Tj 0 .4 .6 rg ("Stress on Our Shared Heart") Tj 0 0 0 rg ( \227 a systematic analysis of 1,264) Tj T* 0 Tw .998334 Tw (MOAD defects across 60+ ecosystems, 18 programming languages, with 919 patches written. The central) Tj T* 0 Tw 2.218835 Tw (finding: O\(N\262\) sedimentary defects compound across architectural layers, creating invisible performance) Tj T* 0 Tw .27131 Tw (taxation on every downstream consumer. A single bottleneck multiplies against every other bottleneck in the) Tj T* 0 Tw (dependency chain.) Tj T* ET Q Q q -1 0 0 1 57.02362 479.8236 cm +1 0 0 1 57.02362 380.6236 cm q 0 0 0 rg BT 1 0 0 1 0 14 Tm /F1 10 Tf 12 TL 2.113022 Tw (On April 13--14, 2026 \227 nine days later \227 the machine learning agent that built uncommonlisp wrote) Tj T* 0 Tw (MOAD-0001 into fresh code. Twice.) Tj T* ET Q Q q -1 0 0 1 57.02362 413.8236 cm +1 0 0 1 57.02362 314.6236 cm q BT 1 0 0 1 0 50 Tm 1.989873 Tw 12 TL /F5 10 Tf 0 0 0 rg (intern_symbol) Tj /F1 10 Tf ( in the assembly implementation: a linear scan through all interned symbols. O\(N\) per) Tj T* 0 Tw 1.841147 Tw (lookup. The exact pattern described in "Stress on Our Shared Heart." The exact pattern the agent was) Tj T* 0 Tw 3.328647 Tw (explicitly instructed to avoid. The agent had the full MOAD taxonomy in its context window. It had) Tj T* 0 Tw 2.822739 Tw /F5 10 Tf (BLACKOPS.md) Tj /F1 10 Tf ( defining all five MOADs. It had the undefect.com mission statement. And it still wrote) Tj T* 0 Tw /F5 10 Tf (jmp) Tj ( ) Tj (.isym_search) Tj /F1 10 Tf ( instead of a hash table.) Tj T* ET Q Q q -1 0 0 1 57.02362 383.8236 cm +1 0 0 1 57.02362 284.6236 cm q BT 1 0 0 1 0 14 Tm 1.541835 Tw 12 TL /F5 10 Tf 0 0 0 rg (list.index\(\)) Tj /F1 10 Tf ( in the Python implementation's ) Tj /F5 10 Tf (_define_record_type) Tj /F1 10 Tf (: linear search for field position.) Tj T* 0 Tw (O\(N\) where O\(1\) was trivial. Same defect. Same context. Same failure.) Tj T* ET Q Q q -1 0 0 1 57.02362 365.8236 cm +1 0 0 1 57.02362 266.6236 cm q 0 0 0 rg BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (The commit history proves it:) Tj T* ET Q Q q -1 0 0 1 57.02362 359.8236 cm +1 0 0 1 57.02362 260.6236 cm Q q -1 0 0 1 57.02362 359.8236 cm +1 0 0 1 57.02362 260.6236 cm Q q -1 0 0 1 57.02362 347.8236 cm +1 0 0 1 57.02362 248.6236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7870,10 +7876,10 @@ Q Q Q q -1 0 0 1 57.02362 341.8236 cm +1 0 0 1 57.02362 242.6236 cm Q q -1 0 0 1 57.02362 329.8236 cm +1 0 0 1 57.02362 230.6236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7895,10 +7901,10 @@ Q Q Q q -1 0 0 1 57.02362 323.8236 cm +1 0 0 1 57.02362 224.6236 cm Q q -1 0 0 1 57.02362 311.8236 cm +1 0 0 1 57.02362 212.6236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7920,61 +7926,61 @@ Q Q Q q -1 0 0 1 57.02362 293.8236 cm +1 0 0 1 57.02362 194.6236 cm Q q -1 0 0 1 57.02362 275.8236 cm +1 0 0 1 57.02362 176.6236 cm q 0 0 0 rg BT 1 0 0 1 0 2 Tm /F3 10 Tf 12 TL (The defect is in the model, not the programmer.) Tj T* ET Q Q q -1 0 0 1 57.02362 221.8236 cm +1 0 0 1 57.02362 122.6236 cm q BT 1 0 0 1 0 38 Tm 5.336796 Tw 12 TL /F1 10 Tf 0 0 0 rg (Language models learn from training data. The training data contains millions of linear scans,) Tj T* 0 Tw 3.434395 Tw /F5 10 Tf (list.contains) Tj /F1 10 Tf ( calls, ) Tj /F5 10 Tf (std::find) Tj /F1 10 Tf ( inside loops, ) Tj /F5 10 Tf (array.indexOf) Tj /F1 10 Tf ( in hot paths. These patterns are) Tj T* 0 Tw .94631 Tw (statistically dominant. When a model generates code, it reproduces the dominant patterns from its training) Tj T* 0 Tw (distribution \227 including the sedimentary defects.) Tj T* ET Q Q q -1 0 0 1 57.02362 179.8236 cm +1 0 0 1 57.02362 80.62362 cm q 0 0 0 rg BT 1 0 0 1 0 26 Tm /F1 10 Tf 12 TL .029897 Tw (Cantor formalized set theory in 1874. Hash tables were implemented in 1953. The O\(1\) membership test has) Tj T* 0 Tw .363241 Tw (been known for 152 years and available in every language for 73 years. Yet language models still default to) Tj T* 0 Tw (O\(N\) because O\(N\) is what most code does. The training data is the sediment.) Tj T* ET Q Q -q -1 0 0 1 57.02362 137.8236 cm -q -BT 1 0 0 1 0 26 Tm 2.359862 Tw 12 TL /F3 10 Tf 0 0 0 rg (This means every machine learning agent generating code today is propagating MOAD-0001 by) Tj T* 0 Tw .91789 Tw (default.) Tj /F1 10 Tf ( Not because the solutions are unknown. Not because the agents lack capability. But because the) Tj T* 0 Tw (statistical distribution of training data encodes the defect as the norm.) Tj T* ET -Q -Q -q -1 0 0 1 57.02362 95.82362 cm -q -BT 1 0 0 1 0 26 Tm .412917 Tw 12 TL /F1 10 Tf 0 0 0 rg (The fix is not to patch individual outputs. The fix is to teach models that ) Tj /F3 10 Tf (O\(1\) is the default) Tj /F1 10 Tf ( for membership) Tj T* 0 Tw 4.550556 Tw (tests, lookups, and deduplication. That ) Tj /F5 10 Tf (set\(\)) Tj /F1 10 Tf ( is not an optimization \227 it is the baseline. That) Tj T* 0 Tw /F5 10 Tf (list.contains) Tj /F1 10 Tf ( inside a loop is a defect, not a pattern.) Tj T* ET -Q -Q endstream endobj 116 0 obj << -/Length 2925 +/Length 3850 >> stream 1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET q 1 0 0 1 57.02362 729.0236 cm q +BT 1 0 0 1 0 26 Tm 2.359862 Tw 12 TL /F3 10 Tf 0 0 0 rg (This means every machine learning agent generating code today is propagating MOAD-0001 by) Tj T* 0 Tw .91789 Tw (default.) Tj /F1 10 Tf ( Not because the solutions are unknown. Not because the agents lack capability. But because the) Tj T* 0 Tw (statistical distribution of training data encodes the defect as the norm.) Tj T* ET +Q +Q +q +1 0 0 1 57.02362 687.0236 cm +q +BT 1 0 0 1 0 26 Tm .412917 Tw 12 TL /F1 10 Tf 0 0 0 rg (The fix is not to patch individual outputs. The fix is to teach models that ) Tj /F3 10 Tf (O\(1\) is the default) Tj /F1 10 Tf ( for membership) Tj T* 0 Tw 4.550556 Tw (tests, lookups, and deduplication. That ) Tj /F5 10 Tf (set\(\)) Tj /F1 10 Tf ( is not an optimization \227 it is the baseline. That) Tj T* 0 Tw /F5 10 Tf (list.contains) Tj /F1 10 Tf ( inside a loop is a defect, not a pattern.) Tj T* ET +Q +Q +q +1 0 0 1 57.02362 645.0236 cm +q 0 0 0 rg BT 1 0 0 1 0 26 Tm /F1 10 Tf 12 TL 1.790491 Tw (Until that teaching happens at the training level, every agent needs a MOAD audit pass on every code) Tj T* 0 Tw 1.596373 Tw (generation. This paper \227 with its commit history showing the defect introduced and then fixed \227 is the) Tj T* 0 Tw (evidence that the audit is necessary.) Tj T* ET Q Q q -1 0 0 1 57.02362 723.0236 cm +1 0 0 1 57.02362 639.0236 cm Q q -1 0 0 1 57.02362 681.0236 cm +1 0 0 1 57.02362 597.0236 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -7997,30 +8003,30 @@ Q Q Q q -1 0 0 1 57.02362 681.0236 cm +1 0 0 1 57.02362 597.0236 cm Q q -1 0 0 1 57.02362 651.0236 cm +1 0 0 1 57.02362 567.0236 cm q 0 0 0 rg BT 1 0 0 1 0 14 Tm /F1 10 Tf 12 TL 1.253223 Tw (The stress is real. The compound burden is measurable. And the models that generate our infrastructure) Tj T* 0 Tw (carry the defect in their weights.) Tj T* ET Q Q q -1 0 0 1 57.02362 633.0236 cm +1 0 0 1 57.02362 549.0236 cm q 0 0 0 rg BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (This paper is the proof. The commit history is the evidence. The fix starts with awareness.) Tj T* ET Q Q q -1 0 0 1 57.02362 601.8236 cm +1 0 0 1 57.02362 517.8236 cm q BT 1 0 0 1 0 2.2 Tm 13.2 TL /F2 11 Tf .133333 .133333 .133333 rg (Citation) Tj T* ET Q Q q -1 0 0 1 57.02362 551.8236 cm +1 0 0 1 57.02362 467.8236 cm q q 1 0 0 1 0 0 cm @@ -8041,13 +8047,13 @@ Q Q Q q -1 0 0 1 57.02362 520.6236 cm +1 0 0 1 57.02362 436.6236 cm q BT 1 0 0 1 0 2.2 Tm 13.2 TL /F2 11 Tf .133333 .133333 .133333 rg (References) Tj T* ET Q Q q -1 0 0 1 57.02362 470.6236 cm +1 0 0 1 57.02362 386.6236 cm q q 1 0 0 1 0 0 cm @@ -8068,16 +8074,16 @@ Q Q Q q -1 0 0 1 57.02362 439.4236 cm +1 0 0 1 57.02362 355.4236 cm q BT 1 0 0 1 0 2.2 Tm 13.2 TL /F2 11 Tf .133333 .133333 .133333 rg (License) Tj T* ET Q Q q -1 0 0 1 57.02362 423.4236 cm +1 0 0 1 57.02362 339.4236 cm Q q -1 0 0 1 57.02362 220.3477 cm +1 0 0 1 57.02362 136.3477 cm q 0 0 0 rg BT /F1 10 Tf 12 TL ET @@ -8093,10 +8099,10 @@ Q Q Q q -1 0 0 1 57.02362 212.3477 cm +1 0 0 1 57.02362 128.3477 cm Q q -1 0 0 1 57.02362 204.3477 cm +1 0 0 1 57.02362 120.3477 cm Q endstream @@ -8370,52 +8376,52 @@ xref 0001609109 00000 n 0001609218 00000 n 0001609426 00000 n -0001614317 00000 n -0001621887 00000 n -0001629667 00000 n -0001638917 00000 n -0001648212 00000 n -0001656394 00000 n -0001669488 00000 n -0001679743 00000 n -0001688624 00000 n -0001697648 00000 n -0001706496 00000 n -0001716382 00000 n -0001729508 00000 n -0001745175 00000 n -0001756270 00000 n -0001763341 00000 n -0001769131 00000 n -0001777509 00000 n -0001785650 00000 n -0001788628 00000 n -0001791304 00000 n -0001791570 00000 n -0001791605 00000 n -0001791640 00000 n -0001791675 00000 n -0001791710 00000 n -0001791745 00000 n -0001791780 00000 n -0001791815 00000 n -0001791850 00000 n -0001791885 00000 n -0001791921 00000 n -0001791957 00000 n -0001791993 00000 n -0001792029 00000 n -0001792065 00000 n -0001792101 00000 n -0001792137 00000 n -0001792173 00000 n -0001792209 00000 n -0001792245 00000 n -0001792281 00000 n +0001614365 00000 n +0001621935 00000 n +0001629715 00000 n +0001638965 00000 n +0001648260 00000 n +0001656442 00000 n +0001669536 00000 n +0001679791 00000 n +0001688672 00000 n +0001697696 00000 n +0001706544 00000 n +0001716430 00000 n +0001729556 00000 n +0001745223 00000 n +0001756318 00000 n +0001763389 00000 n +0001769179 00000 n +0001777454 00000 n +0001785982 00000 n +0001789885 00000 n +0001792561 00000 n +0001792827 00000 n +0001792862 00000 n +0001792897 00000 n +0001792932 00000 n +0001792967 00000 n +0001793002 00000 n +0001793037 00000 n +0001793072 00000 n +0001793107 00000 n +0001793142 00000 n +0001793178 00000 n +0001793214 00000 n +0001793250 00000 n +0001793286 00000 n +0001793322 00000 n +0001793358 00000 n +0001793394 00000 n +0001793430 00000 n +0001793466 00000 n +0001793502 00000 n +0001793538 00000 n trailer << /ID -[] +[<044917cc1fdfac9b3ae7e5313f97bf27><044917cc1fdfac9b3ae7e5313f97bf27>] % ReportLab generated PDF document -- digest (opensource) /Info 42 0 R @@ -8423,5 +8429,5 @@ trailer /Size 140 >> startxref -1792317 +1793574 %%EOF diff --git a/whitepaper/uncommonlisp-whitepaper.rst b/whitepaper/uncommonlisp-whitepaper.rst index b33ed41..2a67de3 100644 --- a/whitepaper/uncommonlisp-whitepaper.rst +++ b/whitepaper/uncommonlisp-whitepaper.rst @@ -61,7 +61,7 @@ A programming language needs one primitive to become universal: feedback. A func **uncommonlisp** proves this by implementing R7RS Scheme three ways: - **Python bytecode VM** — 3,743 lines, full first-class continuations, JSON portal, reference implementation -- **C interpreter + x86_64 JIT** — ~9,000 lines, 7--10× faster than CPython on recursive workloads, JSON portal +- **C interpreter + x86_64 JIT** — 9,164 lines of runtime C (plus ~1,200 in the test harness), 7--10× faster than CPython on recursive workloads, JSON portal - **Pure x86_64 assembly** — 4,968 lines, 22 KB stripped binary, zero external dependencies, **91 builtins including a full TCP stack, `eval`, and `read-from-string`**, binary heap-dump portal All three share one interchange format: **Scheme source itself**. An S-expression portal (``(define x 42)``) written by any implementation loads in any other — a 3×3 producer×consumer matrix, 9/9 cells green. The language *is* the wire protocol. This is not a property we added; it is what a parser has always made possible. We report it because most systems forget. @@ -944,6 +944,8 @@ The Python implementation had a similar defect: ``_define_record_type`` used ``l - ``c/builtins.c``'s ``bi_string_replace`` scanned the source byte-by-byte, calling ``strncmp(src, from, from_len)`` at every position. O(N·k). Replaced with ``strstr`` (libc-tuned, typically Boyer-Moore-Horspool) called in a loop that skips to the next match. O(N + matches·k). - ``uncommonlisp.py``'s ``_tokenize_lines`` called ``src.count('\\n', 0, m.start())`` per token to compute line numbers. O(N·M). Replaced with a single pass that builds a ``line_starts`` array, then bisects per token. O(M + N log M). +A third correctness fix landed after the portal-over-HTTP demo exposed it: ``uncommonlisp.py``'s ``Env.lookup`` used to short-cut from the local frame directly to the global frame before walking intermediate parents. That was fast but wrong — a let-loop parameter named the same as a global builtin (``count``, a SRFI-1 procedure) got shadowed in reverse, the shortcut returned the global builtin instead of walking up to the loop's parameter frame. Fix: walk ``self → self.p → ... → global`` in order, without any shortcut. The inline cache at ``OP_LOOKUP`` was correspondingly tightened to validate the full chain before firing. 975 tests remained green. + Every release audit surfaces more. Writing new code is writing new sediment, unless the audit runs. 12.2 MOAD-0002: The Intertangle in Our Own Design