SNAPKITTYWEST commited on
Commit
fadf040
Β·
verified Β·
1 Parent(s): 6e78341

October 2026 main drop: mirror from GitHub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ docs/images/foundry-j-verify.png filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
13
+
14
+ The licenses for most software and other practical works are designed
15
+ to take away your freedom to share and change the works. By contrast,
16
+ our General Public Licenses are intended to guarantee your freedom to
17
+ share and change all versions of a program--to make sure it remains free
18
+ software for all its users.
19
+
20
+ When we speak of free software, we are referring to freedom, not
21
+ price. Our General Public Licenses are designed to make sure that you
22
+ have the freedom to distribute copies of free software (and charge for
23
+ them if you wish), that you receive source code or can get it if you
24
+ want it, that you can change the software or use pieces of it in new
25
+ free programs, and that you know you can do these things.
26
+
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ TERMS AND CONDITIONS
60
+
61
+ 0. Definitions.
62
+
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
64
+
65
+ "Copyright" also means copyright-like laws that apply to other kinds of
66
+ works, such as semiconductor masks.
67
+
68
+ "The Program" refers to any copyrightable work licensed under this
69
+ License. Each licensee is addressed as "you". "Licensees" and
70
+ "recipients" may be individuals or organizations.
71
+
72
+ To "modify" a work means to copy from or adapt all or part of the work
73
+ in a fashion requiring copyright permission, other than the making of an
74
+ exact copy. The resulting work is called a "modified version" of the
75
+ earlier work or a work "based on" the earlier work.
76
+
77
+ A "covered work" means either the unmodified Program or a work based
78
+ on the Program.
79
+
80
+ To "propagate" a work means to do anything with it that, without
81
+ permission, would make you directly or secondarily liable for
82
+ infringement under applicable copyright law, except executing it on a
83
+ computer or modifying a private copy. Propagation includes copying,
84
+ distribution (with or without modification), making available to the
85
+ public, and in some countries other activities as well.
86
+
87
+ To "convey" a work means any kind of propagation that enables other
88
+ parties to make or receive copies. Mere interaction with a user through
89
+ a computer network, with no transfer of a copy, is not conveying.
90
+
91
+ An interactive user interface displays "Appropriate Legal Notices"
92
+ to the extent that it includes a convenient and prominently visible
93
+ feature that (1) displays an appropriate copyright notice, and (2)
94
+ tells the user that there is no warranty for the work (except to the
95
+ extent that warranties are provided), that licensees may convey the
96
+ work under this License, and how to view a copy of this License. If
97
+ the interface presents a list of user commands or options, such as a
98
+ menu, a prominent item in the list meets this criterion.
99
+
100
+ 1. Source Code.
101
+
102
+ The "source code" for a work means the preferred form of the work
103
+ for making modifications to it. "Object code" means any non-source
104
+ form of a work.
105
+
106
+ A "Standard Interface" means an interface that either is an official
107
+ standard defined by a recognized standards body, or, in the case of
108
+ interfaces specified for a particular programming language, one that
109
+ is widely used among developers working in that language.
110
+
111
+ The "System Libraries" of an executable work include anything, other
112
+ than the work as a whole, that (a) is included in the normal form of
113
+ packaging a Major Component, but which is not part of that Major
114
+ Component, and (b) serves only to enable use of the work with that
115
+ Major Component, or to implement a Standard Interface for which an
116
+ implementation is available to the public in source code form. A
117
+ "Major Component", in this context, means a major essential component
118
+ (kernel, window system, and so on) of the specific operating system
119
+ (if any) on which the executable work runs, or a compiler used to
120
+ produce the work, or an object code interpreter used to run it.
121
+
122
+ The "Corresponding Source" for a work in object code form means all
123
+ the source code needed to generate, install, and (for an executable
124
+ work) run the object code and to modify the work, including scripts to
125
+ control those activities. However, it does not include the work's
126
+ System Libraries, or general-purpose tools or generally available free
127
+ programs which are used unmodified in performing those activities but
128
+ which are not part of the work. For example, Corresponding Source
129
+ includes interface definition files associated with source files for
130
+ the work, and the source code for shared libraries and dynamically
131
+ linked subprograms that the work is specifically designed to require,
132
+ such as by intimate data communication or control flow between those
133
+ subprograms and other parts of the work.
134
+
135
+ The Corresponding Source need not include anything that users
136
+ can regenerate automatically from other parts of the Corresponding
137
+ Source.
138
+
139
+ The Corresponding Source for a work in source code form is that
140
+ same work.
141
+
142
+ 2. Basic Permissions.
143
+
144
+ All rights granted under this License are granted for the term of
145
+ copyright on the Program, and are irrevocable provided the stated
146
+ conditions are met. This License explicitly affirms your unlimited
147
+ permission to run the unmodified Program. The output from running a
148
+ covered work is covered by this License only if the output, given its
149
+ content, constitutes a covered work. This License acknowledges your
150
+ rights of fair use or other equivalent, as provided by copyright law.
151
+
152
+ You may make, run and propagate covered works that you do not
153
+ convey, without conditions so long as your license otherwise remains
154
+ in force. You may convey covered works to others for the sole purpose
155
+ of having them make modifications exclusively for you, or provide you
156
+ with facilities for running those works, provided that you comply with
157
+ the terms of this License in conveying all material for which you do
158
+ not control copyright. Those thus making or running the covered works
159
+ for you must do so exclusively on your behalf, under your direction
160
+ and control, on terms that prohibit them from making any copies of
161
+ your copyrighted material outside their relationship with you.
162
+
163
+ Conveying under any other circumstances is permitted solely under
164
+ the conditions stated below. Sublicensing is not allowed; section 10
165
+ makes it unnecessary.
166
+
167
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
+
169
+ No covered work shall be deemed part of an effective technological
170
+ measure under any applicable law fulfilling obligations under article
171
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
+ similar laws prohibiting or restricting circumvention of such
173
+ measures.
174
+
175
+ When you convey a covered work, you waive any legal power to forbid
176
+ circumvention of technological measures to the extent such circumvention
177
+ is effected by exercising rights under this License with respect to
178
+ the covered work, and you disclaim any intention to limit operation or
179
+ modification of the work as a means of enforcing, against the work's
180
+ users, your or third parties' legal rights to forbid circumvention of
181
+ technological measures.
182
+
183
+ 4. Conveying Verbatim Copies.
184
+
185
+ You may convey verbatim copies of the Program's source code as you
186
+ receive it, in any medium, provided that you conspicuously and
187
+ appropriately publish on each copy an appropriate copyright notice;
188
+ keep intact all notices stating that this License and any
189
+ non-permissive terms added in accord with section 7 apply to the code;
190
+ keep intact all notices of the absence of any warranty; and give all
191
+ recipients a copy of this License along with the Program.
192
+
193
+ You may charge any price or no price for each copy that you convey,
194
+ and you may offer support or warranty protection for a fee.
195
+
196
+ 5. Conveying Modified Source Versions.
197
+
198
+ You may convey a work based on the Program, or the modifications to
199
+ produce it from the Program, in the form of source code under the
200
+ terms of section 4, provided that you also meet all of these conditions:
201
+
202
+ a) The work must carry prominent notices stating that you modified
203
+ it, and giving a relevant date.
204
+
205
+ b) The work must carry prominent notices stating that it is
206
+ released under this License and any conditions added under section
207
+ 7. This requirement modifies the requirement in section 4 to
208
+ "keep intact all notices".
209
+
210
+ c) You must license the entire work, as a whole, under this
211
+ License to anyone who comes into possession of a copy. This
212
+ License will therefore apply, along with any applicable section 7
213
+ additional terms, to the whole of the work, and all its parts,
214
+ regardless of how they are packaged. This License gives no
215
+ permission to license the work in any other way, but it does not
216
+ invalidate such permission if you have separately received it.
217
+
218
+ d) If the work has interactive user interfaces, each must display
219
+ Appropriate Legal Notices; however, if the Program has interactive
220
+ interfaces that do not display Appropriate Legal Notices, your
221
+ work need not make them do so.
222
+
223
+ A compilation of a covered work with other separate and independent
224
+ works, which are not by their nature extensions of the covered work,
225
+ and which are not combined with it such as to form a larger program,
226
+ in or on a volume of a storage or distribution medium, is called an
227
+ "aggregate" if the compilation and its resulting copyright are not
228
+ used to limit the access or legal rights of the compilation's users
229
+ beyond what the individual works permit. Inclusion of a covered work
230
+ in an aggregate does not cause this License to apply to the other
231
+ parts of the aggregate.
232
+
233
+ 6. Conveying Non-Source Forms.
234
+
235
+ You may convey a covered work in object code form under the terms
236
+ of sections 4 and 5, provided that you also convey the
237
+ machine-readable Corresponding Source under the terms of this License,
238
+ in one of these ways:
239
+
240
+ a) Convey the object code in, or embodied in, a physical product
241
+ (including a physical distribution medium), accompanied by the
242
+ Corresponding Source fixed on a durable physical medium
243
+ customarily used for software interchange.
244
+
245
+ b) Convey the object code in, or embodied in, a physical product
246
+ (including a physical distribution medium), accompanied by a
247
+ written offer, valid for at least three years and valid for as
248
+ long as you offer spare parts or customer support for that product
249
+ model, to give anyone who possesses the object code either (1) a
250
+ copy of the Corresponding Source for all the software in the
251
+ product that is covered by this License, on a durable physical
252
+ medium customarily used for software interchange, for a price no
253
+ more than your reasonable cost of physically performing this
254
+ conveying of source, or (2) access to copy the
255
+ Corresponding Source from a network server at no charge.
256
+
257
+ c) Convey individual copies of the object code with a copy of the
258
+ written offer to provide the Corresponding Source. This
259
+ alternative is allowed only occasionally and noncommercially, and
260
+ only if you received the object code with such an offer, in accord
261
+ with subsection 6b.
262
+
263
+ d) Convey the object code by offering access from a designated
264
+ place (gratis or for a charge), and offer equivalent access to the
265
+ Corresponding Source in the same way through the same place at no
266
+ further charge. You need not require recipients to copy the
267
+ Corresponding Source along with the object code. If the place to
268
+ copy the object code is a network server, the Corresponding Source
269
+ may be on a different server (operated by you or a third party)
270
+ that supports equivalent copying facilities, provided you maintain
271
+ clear directions next to the object code saying where to find the
272
+ Corresponding Source. Regardless of what server hosts the
273
+ Corresponding Source, you remain obligated to ensure that it is
274
+ available for as long as needed to satisfy these requirements.
275
+
276
+ e) Convey the object code using peer-to-peer transmission, provided
277
+ you inform other peers where the object code and Corresponding
278
+ Source of the work are being offered to the general public at no
279
+ charge under subsection 6d.
280
+
281
+ A separable portion of the object code, whose source code is excluded
282
+ from the Corresponding Source as a System Library, need not be
283
+ included in conveying the object code work.
284
+
285
+ A "User Product" is either (1) a "consumer product", which means any
286
+ tangible personal property which is normally used for personal, family,
287
+ or household purposes, or (2) anything designed or sold for incorporation
288
+ into a dwelling. In determining whether a product is a consumer product,
289
+ doubtful cases shall be resolved in favor of coverage. For a particular
290
+ product received by a particular user, "normally used" refers to a
291
+ typical or common use of that class of product, regardless of the status
292
+ of the particular user or of the way in which the particular user
293
+ actually uses, or expects or is expected to use, the product. A product
294
+ is a consumer product regardless of whether the product has substantial
295
+ commercial, industrial or non-consumer uses, unless such uses represent
296
+ the only significant mode of use of the product.
297
+
298
+ "Installation Information" for a User Product means any methods,
299
+ procedures, authorization keys, or other information required to install
300
+ and execute modified versions of a covered work in that User Product from
301
+ a modified version of its Corresponding Source. The information must
302
+ suffice to ensure that the continued functioning of the modified object
303
+ code is in no case prevented or interfered with solely because
304
+ modification has been made.
305
+
306
+ If you convey an object code work under this section in, or with, or
307
+ specifically for use in, a User Product, and the conveying occurs as
308
+ part of a transaction in which the right of possession and use of the
309
+ User Product is transferred to the recipient in perpetuity or for a
310
+ fixed term (regardless of how the transaction is characterized), the
311
+ Corresponding Source conveyed under this section must be accompanied
312
+ by the Installation Information. But this requirement does not apply
313
+ if neither you nor any third party retains the ability to install
314
+ modified object code on the User Product (for example, the work has
315
+ been installed in ROM).
316
+
317
+ The requirement to provide Installation Information does not include a
318
+ requirement to continue to provide support service, warranty, or updates
319
+ for a work that has been modified or installed by the recipient, or for
320
+ the User Product in which it has been modified or installed. Access to a
321
+ network may be denied when the modification itself materially and
322
+ adversely affects the operation of the network or violates the rules and
323
+ protocols for communication across the network.
324
+
325
+ Corresponding Source conveyed, and Installation Information provided,
326
+ in accord with this section must be in a format that is publicly
327
+ documented (and with an implementation available to the public in
328
+ source code form), and must require no special password or key for
329
+ unpacking, reading or copying.
330
+
331
+ 7. Additional Terms.
332
+
333
+ "Additional permissions" are terms that supplement the terms of this
334
+ License by making exceptions from one or more of its conditions.
335
+ Additional permissions that are applicable to the entire Program shall
336
+ be treated as though they were included in this License, to the extent
337
+ that they are valid under applicable law. If additional permissions
338
+ apply only to part of the Program, that part may be used separately
339
+ under those permissions, but the entire Program remains governed by
340
+ this License without regard to the additional permissions.
341
+
342
+ When you convey a copy of a covered work, you may at your option
343
+ remove any additional permissions from that copy, or from any part of
344
+ it. (Additional permissions may be written to require their own
345
+ removal in certain cases when you modify the work.) You may place
346
+ additional permissions on material, added by you to a covered work,
347
+ for which you have or can give appropriate copyright permission.
348
+
349
+ Notwithstanding any other provision of this License, for material you
350
+ add to a covered work, you may (if authorized by the copyright holders of
351
+ that material) supplement the terms of this License with terms:
352
+
353
+ a) Disclaiming warranty or limiting liability differently from the
354
+ terms of sections 15 and 16 of this License; or
355
+
356
+ b) Requiring preservation of specified reasonable legal notices or
357
+ author attributions in that material or in the Appropriate Legal
358
+ Notices displayed by works containing it; or
359
+
360
+ c) Prohibiting misrepresentation of the origin of that material, or
361
+ requiring that modified versions of such material be marked in
362
+ reasonable ways as different from the original version; or
363
+
364
+ d) Limiting the use for publicity purposes of names of licensors or
365
+ authors of the material; or
366
+
367
+ e) Declining to grant rights under trademark law for use of some
368
+ trade names, trademarks, or service marks; or
369
+
370
+ f) Requiring indemnification of licensors and authors of that
371
+ material by anyone who conveys the material (or modified versions of
372
+ it) with contractual assumptions of liability to the recipient, for
373
+ any liability that these contractual assumptions directly impose on
374
+ those licensors and authors.
375
+
376
+ All other non-permissive additional terms are considered "further
377
+ restrictions" within the meaning of section 10. If the Program as you
378
+ received it, or any part of it, contains a notice stating that it is
379
+ governed by this License along with a term that is a further
380
+ restriction, you may remove that term. If a license document contains
381
+ a further restriction but permits relicensing or conveying under this
382
+ License, you may add to a covered work material governed by the terms
383
+ of that license document, provided that the further restriction does
384
+ not survive such relicensing or conveying.
385
+
386
+ If you add terms to a covered work in accord with this section, you
387
+ must place, in the relevant source files, a statement of the
388
+ additional terms that apply to those files, or a notice indicating
389
+ where to find the applicable terms.
390
+
391
+ Additional terms, permissive or non-permissive, may be stated in the
392
+ form of a separately written license, or stated as exceptions;
393
+ the above requirements apply either way.
394
+
395
+ 8. Termination.
396
+
397
+ You may not propagate or modify a covered work except as expressly
398
+ provided under this License. Any attempt otherwise to propagate or
399
+ modify it is void, and will automatically terminate your rights under
400
+ this License (including any patent licenses granted under the third
401
+ paragraph of section 11).
402
+
403
+ However, if you cease all violation of this License, then your
404
+ license from a particular copyright holder is reinstated (a)
405
+ provisionally, unless and until the copyright holder explicitly and
406
+ finally terminates your license, and (b) permanently, if the copyright
407
+ holder fails to notify you of the violation by some reasonable means
408
+ prior to 60 days after the cessation.
409
+
410
+ Moreover, your license from a particular copyright holder is
411
+ reinstated permanently if the copyright holder notifies you of the
412
+ violation by some reasonable means, this is the first time you have
413
+ received notice of violation of this License (for any work) from that
414
+ copyright holder, and you cure the violation prior to 30 days after
415
+ your receipt of the notice.
416
+
417
+ Termination of your rights under this section does not terminate the
418
+ licenses of parties who have received copies or rights from you under
419
+ this License. If your rights have been terminated and not permanently
420
+ reinstated, you do not qualify to receive new licenses for the same
421
+ material under section 10.
422
+
423
+ 9. Acceptance Not Required for Having Copies.
424
+
425
+ You are not required to accept this License in order to receive or
426
+ run a copy of the Program. Ancillary propagation of a covered work
427
+ occurring solely as a consequence of using peer-to-peer transmission
428
+ to receive a copy likewise does not require acceptance. However,
429
+ nothing other than this License grants you permission to propagate or
430
+ modify any covered work. These actions infringe copyright if you do
431
+ not accept this License. Therefore, by modifying or propagating a
432
+ covered work, you indicate your acceptance of this License to do so.
433
+
434
+ 10. Automatic Licensing of Downstream Recipients.
435
+
436
+ Each time you convey a covered work, the recipient automatically
437
+ receives a license from the original licensors, to run, modify and
438
+ propagate that work, subject to this License. You are not responsible
439
+ for enforcing compliance by third parties with this License.
440
+
441
+ An "entity transaction" is a transaction transferring control of an
442
+ organization, or substantially all assets of one, or subdividing an
443
+ organization, or merging organizations. If propagation of a covered
444
+ work results from an entity transaction, each party to that
445
+ transaction who receives a copy of the work also receives whatever
446
+ licenses to the work the party's predecessor in interest had or could
447
+ give under the previous paragraph, plus a right to possession of the
448
+ Corresponding Source of the work from the predecessor in interest, if
449
+ the predecessor has it or can get it with reasonable efforts.
450
+
451
+ You may not impose any further restrictions on the exercise of the
452
+ rights granted or affirmed under this License. For example, you may
453
+ not impose a license fee, royalty, or other charge for exercise of
454
+ rights granted under this License, and you may not initiate litigation
455
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
456
+ any patent claim is infringed by making, using, selling, offering for
457
+ sale, or importing the Program or any portion of it.
458
+
459
+ 11. Patents.
460
+
461
+ A "contributor" is a copyright holder who authorizes use under this
462
+ License of the Program or a work on which the Program is based. The
463
+ work thus licensed is called the contributor's "contributor version".
464
+
465
+ A contributor's "essential patent claims" are all patent claims
466
+ owned or controlled by the contributor, whether already acquired or
467
+ hereafter acquired, that would be infringed by some manner, permitted
468
+ by this License, of making, using, or selling its contributor version,
469
+ but do not include claims that would be infringed only as a
470
+ consequence of further modification of the contributor version. For
471
+ purposes of this definition, "control" includes the right to grant
472
+ patent sublicenses in a manner consistent with the requirements of
473
+ this License.
474
+
475
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
476
+ patent license under the contributor's essential patent claims, to
477
+ make, use, sell, offer for sale, import and otherwise run, modify and
478
+ propagate the contents of its contributor version.
479
+
480
+ In the following three paragraphs, a "patent license" is any express
481
+ agreement or commitment, however denominated, not to enforce a patent
482
+ (such as an express permission to practice a patent or covenant not to
483
+ sue for patent infringement). To "grant" such a patent license to a
484
+ party means to make such an agreement or commitment not to enforce a
485
+ patent against the party.
486
+
487
+ If you convey a covered work, knowingly relying on a patent license,
488
+ and the Corresponding Source of the work is not available for anyone
489
+ to copy, free of charge and under the terms of this License, through a
490
+ publicly available network server or other readily accessible means,
491
+ then you must either (1) cause the Corresponding Source to be so
492
+ available, or (2) arrange to deprive yourself of the benefit of the
493
+ patent license for this particular work, or (3) arrange, in a manner
494
+ consistent with the requirements of this License, to extend the patent
495
+ license to downstream recipients. "Knowingly relying" means you have
496
+ actual knowledge that, but for the patent license, your conveying the
497
+ covered work in a country, or your recipient's use of the covered work
498
+ in a country, would infringe one or more identifiable patents in that
499
+ country that you have reason to believe are valid.
500
+
501
+ If, pursuant to or in connection with a single transaction or
502
+ arrangement, you convey, or propagate by procuring conveyance of, a
503
+ covered work, and grant a patent license to some of the parties
504
+ receiving the covered work authorizing them to use, propagate, modify
505
+ or convey a specific copy of the covered work, then the patent license
506
+ you grant is automatically extended to all recipients of the covered
507
+ work and works based on it.
508
+
509
+ A patent license is "discriminatory" if it does not include within
510
+ the scope of its coverage, prohibits the exercise of, or is
511
+ conditioned on the non-exercise of one or more of the rights that are
512
+ specifically granted under this License. You may not convey a covered
513
+ work if you are a party to an arrangement with a third party that is
514
+ in the business of distributing software, under which you make payment
515
+ to the third party based on the extent of your activity of conveying
516
+ the work, and under which the third party grants, to any of the
517
+ parties who would receive the covered work from you, a discriminatory
518
+ patent license (a) in connection with copies of the covered work
519
+ conveyed by you (or copies made from those copies), or (b) primarily
520
+ for and in connection with specific products or compilations that
521
+ contain the covered work, unless you entered into that arrangement,
522
+ or that patent license was granted, prior to 28 March 2007.
523
+
524
+ Nothing in this License shall be construed as excluding or limiting
525
+ any implied license or other defenses to infringement that may
526
+ otherwise be available to you under applicable patent law.
527
+
528
+ 12. No Surrender of Others' Freedom.
529
+
530
+ If conditions are imposed on you (whether by court order, agreement or
531
+ otherwise) that contradict the conditions of this License, they do not
532
+ excuse you from the conditions of this License. If you cannot convey a
533
+ covered work so as to satisfy simultaneously your obligations under this
534
+ License and any other pertinent obligations, then as a consequence you may
535
+ not convey it at all. For example, if you agree to terms that obligate you
536
+ to collect a royalty for further conveying from those to whom you convey
537
+ the Program, the only way you could satisfy both those terms and this
538
+ License would be to refrain entirely from conveying the Program.
539
+
540
+ 13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
552
+
553
+ Notwithstanding any other provision of this License, you have
554
+ permission to link or combine any covered work with a work licensed
555
+ under version 3 of the GNU General Public License into a single
556
+ combined work, and to convey the resulting work. The terms of this
557
+ License will continue to apply to the part which is the covered work,
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
560
+
561
+ 14. Revised Versions of this License.
562
+
563
+ The Free Software Foundation may publish revised and/or new versions of
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
566
+ address new problems or concerns.
567
+
568
+ Each version is given a distinguishing version number. If the
569
+ Program specifies that a certain numbered version of the GNU Affero General
570
+ Public License "or any later version" applies to it, you have the
571
+ option of following the terms and conditions either of that numbered
572
+ version or of any later version published by the Free Software
573
+ Foundation. If the Program does not specify a version number of the
574
+ GNU Affero General Public License, you may choose any version ever published
575
+ by the Free Software Foundation.
576
+
577
+ If the Program specifies that a proxy can decide which future
578
+ versions of the GNU Affero General Public License can be used, that proxy's
579
+ public statement of acceptance of a version permanently authorizes you
580
+ to choose that version for the Program.
581
+
582
+ Later license versions may give you additional or different
583
+ permissions. However, no additional obligations are imposed on any
584
+ author or copyright holder as a result of your choosing to follow a
585
+ later version.
586
+
587
+ 15. Disclaimer of Warranty.
588
+
589
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597
+
598
+ 16. Limitation of Liability.
599
+
600
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
+ SUCH DAMAGES.
609
+
610
+ 17. Interpretation of Sections 15 and 16.
611
+
612
+ If the disclaimer of warranty and limitation of liability provided
613
+ above cannot be given local legal effect according to their terms,
614
+ reviewing courts shall apply local law that most closely approximates
615
+ an absolute waiver of all civil liability in connection with the
616
+ Program, unless a warranty or assumption of liability accompanies a
617
+ copy of the Program in return for a fee.
618
+
619
+ END OF TERMS AND CONDITIONS
620
+
621
+ How to Apply These Terms to Your New Programs
622
+
623
+ If you develop a new program, and you want it to be of the greatest
624
+ possible use to the public, the best way to achieve this is to make it
625
+ free software which everyone can redistribute and change under these terms.
626
+
627
+ To do so, attach the following notices to the program. It is safest
628
+ to attach them to the start of each source file to most effectively
629
+ state the exclusion of warranty; and each file should have at least
630
+ the "copyright" line and a pointer to where the full notice is found.
631
+
632
+ <one line to give the program's name and a brief idea of what it does.>
633
+ Copyright (C) <year> <name of author>
634
+
635
+ This program is free software: you can redistribute it and/or modify
636
+ it under the terms of the GNU Affero General Public License as published by
637
+ the Free Software Foundation, either version 3 of the License, or
638
+ (at your option) any later version.
639
+
640
+ This program is distributed in the hope that it will be useful,
641
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
642
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
+ GNU Affero General Public License for more details.
644
+
645
+ You should have received a copy of the GNU Affero General Public License
646
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
647
+
648
+ Also add information on how to contact you by electronic and paper mail.
649
+
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
657
+
658
+ You should also get your employer (if you work as a programmer) or school,
659
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
661
+ <https://www.gnu.org/licenses/>.
README.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: agpl-3.0
3
+ tags:
4
+ - snapkitty
5
+ - october-2026-drop
6
+ - j
7
+ - goldilocks-field
8
+ - spectral
9
+ - contraction
10
+ - banach
11
+ - research
12
+ ---
13
+
14
+ > Mirrored from [https://github.com/SNAPKITTYWEST/foundry-j](https://github.com/SNAPKITTYWEST/foundry-j) at commit `cee36b3`. Part of the **SnapKitty October 2026 main drop**.
15
+
docs/images/.gitkeep ADDED
File without changes
docs/images/foundry-j-verify.png ADDED

Git LFS Details

  • SHA256: e546b51f7641bd4cc92acb9348a8d3b583600679a1ce0c61b4616bdc2c9405bd
  • Pointer size: 131 Bytes
  • Size of remote file: 109 kB
j/BOXING.md ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry / Prime Materia Commons
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+
5
+ This file is part of Foundry F1 Pure-J Core.
6
+ License: GNU Affero General Public License v3.0 or later.
7
+ See <https://www.gnu.org/licenses/>.
8
+ -->
9
+
10
+ # Foundry J Core β€” Record boxing contracts
11
+
12
+ Field **order** is owned by `spec/J_API.md`. This file freezes the **boxing / nesting** used by Pure-J Core under `j/` so `;` (link) never flattens multi-field records into sibling boxes when paired with another value.
13
+
14
+ ## J link hazard (why wrap)
15
+
16
+ In J9, `x ; y` with **unboxed** `x` and **list-of-boxes** `y` yields `(<x) , y` β€” the fields of `y` become siblings of `x`. Multi-field records must therefore be wrapped in **one outer box** whenever they are:
17
+
18
+ - returned alone as a record value, or
19
+ - linked with another value (`value ; <record>`).
20
+
21
+ Atoms and plain numeric arrays are not list-of-boxes; `xi ; lam` with two numeric arrays is already length-stable.
22
+
23
+ ## StepInfo (length 7)
24
+
25
+ Open field list (J_API order):
26
+
27
+ ```text
28
+ step ; q ; epsilon ; n_xi ; n_lam ; projected ; residual
29
+ ```
30
+
31
+ | Producer | Return shape |
32
+ |----------|----------------|
33
+ | `rec_step` | `x_next ; <StepInfo>` β€” always length 2 |
34
+ | `rec_run` | list of `<StepInfo>` (one box per step) |
35
+ | `REC_STATE` | `x_current ; converged ; <history>` β€” length 3; `history` is the same list `rec_run` returns |
36
+
37
+ Unpack:
38
+
39
+ ```j
40
+ 'x info' =. x rec_step ... NB. info is still boxed
41
+ info =. > info NB. open length-7 StepInfo
42
+ NB. or: info =. 1 {:: pair
43
+
44
+ hist =. x0 rec_run ...
45
+ step =. > k { hist NB. open StepInfo
46
+ resid =. 6 {:: step NB. or > 6 { step
47
+ ```
48
+
49
+ ## SpectralResult (length 5)
50
+
51
+ Open field list (J_API order):
52
+
53
+ ```text
54
+ spectral_radius ; contractive ; gershgorin_bound ; power_iter_bound ; used_power_iteration
55
+ ```
56
+
57
+ | Producer | Return shape |
58
+ |----------|----------------|
59
+ | `gershgorin_check` | `<SpectralResult>` |
60
+ | `power_iteration_check` | `<SpectralResult>` |
61
+ | `spectral_analyze` | `<SpectralResult>` |
62
+
63
+ Unpack: `sr_open res` then index, or `1 {:: > res`, or `sr_contractive res`.
64
+ `sr_open` is `>` (Core). Parenthesize: `sr_open (J spectral_analyze eps)`.
65
+
66
+ Accessors `sr_radius` … `sr_used_pi` accept wrapped or open form.
67
+
68
+ ## AceCert (length 4)
69
+
70
+ Open field list (J_API order):
71
+
72
+ ```text
73
+ lipschitz_upper ; safety_margin ; tail_bound ; certified
74
+ ```
75
+
76
+ | Producer | Return shape |
77
+ |----------|----------------|
78
+ | `ace_certify` | `<AceCert>` |
79
+
80
+ `ace_certify` consumes a list of `<StepInfo>` (same packing as `rec_run` history).
81
+
82
+ Unpack: `> ace` then field index, e.g. `3 {:: > ace` for `certified`.
83
+
84
+ ## PMat
85
+
86
+ Open field list (shape used by Core today):
87
+
88
+ ```text
89
+ rows ; cols ; entries
90
+ ```
91
+
92
+ - `rows`, `cols` β€” integer atoms
93
+ - `entries` β€” numeric table `nΓ—5`: `sign , delta_source , delta_target , row , col` (empty: `0 5 $ 0`)
94
+
95
+ | Producer | Return shape |
96
+ |----------|----------------|
97
+ | `pmat_new` | open `rows ; cols ; entries` |
98
+ | `pmat_compose` | open `rows ; cols ; entries` |
99
+ | `pmat_insert` | **`new_PMat ; <ok>`** β€” length 2; `new_PMat` is the open 3-field PMat; `ok` is boolean 0/1 wrapped so the pair stays length-2 under link |
100
+
101
+ Unpack insert:
102
+
103
+ ```j
104
+ pair =. m pmat_insert row ; col ; sign ; sig
105
+ m =. 0 {:: pair NB. open PMat
106
+ ok =. 1 {:: pair NB. boolean (opens <ok>)
107
+ NB. 'm ok' =. pair then ok =. > ok
108
+ ```
109
+
110
+ Accessors `pmat_rows` / `pmat_cols` / `pmat_entries` take the **open** PMat.
111
+
112
+ `pmat_validate_grading` remains the C++ stub: always `1` (no invented checks).
113
+
114
+ ## Other multi-part returns
115
+
116
+ | Producer | Return shape |
117
+ |----------|----------------|
118
+ | `synth_weights` | `xi_schedule ; lambda_schedule` β€” length 2; each a numeric table |
119
+ | `soft_project` | `xi ; lam` β€” length 2; each a numeric list |
120
+
121
+ Both sides are unboxed numerics, so bare `;` is length-stable. Do not link an unboxed value onto these pairs without wrapping the pair: `value ; <(xi;lam)>`.
122
+
123
+ ## Summary preference
124
+
125
+ | Situation | Shape |
126
+ |-----------|--------|
127
+ | Record alone | `<record>` (StepInfo items in history; SpectralResult; AceCert) |
128
+ | Value + record | `value ; <record>` (`rec_step`; conceptually same nesting for insert) |
129
+ | PMat alone | open `rows ; cols ; entries` |
130
+ | PMat + ok | `PMat ; <ok>` |
131
+ | Numeric pair | `a ; b` (schedules / soft_project) |
j/certify.ijs ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” AceCertificate math (PURE J)
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Contract: spec/J_API.md Β§ ace_*; PROPERTIES Β§H (53–54); j/BOXING.md.
20
+ NB. AceCert open fields: lipschitz_upper ; safety_margin ; tail_bound ; certified
21
+ NB. ace_certify returns <AceCert>.
22
+ NB. Verbs: ace_safety_margin ace_tail_bound ace_certify
23
+
24
+ cocurrent 'foundry'
25
+
26
+ NB. max_q ace_safety_margin epsilon β†’ (1-Ξ΅) - max_q (PROPERTIES 53)
27
+ ace_safety_margin =: 4 : '(1 - y) - x'
28
+
29
+ NB. tail_norm ace_tail_bound max_q β†’ tail/(1-max_q) or _ if max_q>=1 (PROPERTIES 54)
30
+ ace_tail_bound =: 4 : 0
31
+ if. y >: 1 do. _ else. x % 1 - y end.
32
+ )
33
+
34
+ NB. steps ace_certify delta
35
+ NB. steps = list of <StepInfo> (same packing as rec_run history)
36
+ NB. Returns <AceCert>
37
+ ace_certify =: 4 : 0
38
+ steps =. boxxopen x
39
+ delta =. y
40
+ if. 0 = # steps do. < 0 ; 0 ; 0 ; 0 return. end.
41
+ qs =. 0 $ 0.
42
+ rs =. 0 $ 0.
43
+ for_s. steps do.
44
+ info =. > s
45
+ qs =. qs , 1 {:: info
46
+ rs =. rs , 6 {:: info
47
+ end.
48
+ max_q =. >./ qs
49
+ max_resid =. >./ rs
50
+ eps =. 2 {:: > 0 { steps
51
+ margin =. max_q ace_safety_margin eps
52
+ tail =. max_resid ace_tail_bound max_q
53
+ certified =. margin >: delta
54
+ < max_q ; margin ; tail ; certified
55
+ )
56
+
57
+ cocurrent 'base'
j/foundry.ijs ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” Pure-J Core package loader
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Load order matches dependency: types β†’ goldilocks β†’ pmat β†’ spectral β†’
20
+ NB. recurrence β†’ gate β†’ certify.
21
+ NB. Record boxing contracts: j/BOXING.md (StepInfo, SpectralResult, AceCert, PMat).
22
+ NB.
23
+ NB. Usage (from any cwd):
24
+ NB. load '/workspace/foundry-j/j/foundry.ijs'
25
+ NB. Then verbs live in locale 'foundry'; bring into base with:
26
+ NB. cocurrent 'foundry' NB. or call as foundry_fp_add_ etc.
27
+
28
+ (3 : 0) ''
29
+ here =. ({.~ i:&'/') > {: 4!:3 ''
30
+ if. 0 = # here do. here =. 1!:43 '' end.
31
+ sep =. '/'
32
+ mods =. 'types';'goldilocks';'pmat';'spectral';'recurrence';'gate';'certify'
33
+ for_m. mods do.
34
+ load here , sep , (> m) , '.ijs'
35
+ end.
36
+ i. 0 0
37
+ )
38
+
39
+ NB. Optional: export key verbs into base for Verify convenience
40
+ NB. Uncomment if desired:
41
+ NB. (3 : 0) ''
42
+ NB. names =. ;: 'fp_add fp_sub fp_mul fp_inv fp_mulmod fp_pow fp_reduce fp_add_batch fp_mul_batch pmat_new pmat_insert pmat_conservation pmat_compose pmat_frobenius pmat_validate_grading gershgorin_bound gershgorin_check power_iteration power_iteration_check spectral_analyze synth_weights soft_project q_estimate residual_l2 rec_step rec_run tier_eps emit_apply csl_neutrality csl_beneficence csl_commutation ace_safety_margin ace_tail_bound ace_certify GOLDILOCKS_PRIME p EPSILON_FOLD P64'
43
+ NB. for_n. names do.
44
+ NB. (n) =: (n) f. NB. not valid across locales this way
45
+ NB. end.
46
+ NB. i.0 0
47
+ NB. )
48
+
49
+ NB. Instead expose a verb that copies selected names into base:
50
+ foundry_export =: 3 : 0
51
+ ns =. ;: 'fp_reduce fp_add fp_sub fp_mul fp_mulmod fp_pow fp_inv fp_add_batch fp_mul_batch pmat_new pmat_insert pmat_validate_grading pmat_conservation pmat_compose pmat_frobenius pmat_entries pmat_shape gershgorin_bound gershgorin_check power_iteration power_iteration_check spectral_analyze sr_open sr_fields sr_radius sr_contractive synth_weights soft_project q_estimate residual_l2 rec_step rec_run tier_eps tier_epsilon emit_apply csl_neutrality csl_beneficence csl_commutation ace_safety_margin ace_tail_bound ace_certify GOLDILOCKS_PRIME p EPSILON_FOLD P64 P_64 K_MAX MAX_DRIFT PHI PIRTM_MAGIC T1 T2 T3 T4 WP_UNIFORM WP_HARMONIC WP_LOGDECAY GP_PASSTHROUGH GP_SUPPRESS GP_HOLD GP_ATTENUATE CSL_PASS CSL_FAIL_NEUTRALITY CSL_FAIL_BENEFICENCE CSL_FAIL_COMMUTATION'
52
+ cocurrent 'base'
53
+ for_n. ns do.
54
+ ". (>n) , ' =: ' , (>n) , '_foundry_'
55
+ end.
56
+ i. 0 0
57
+ )
j/gate.ijs ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” Emission Gate + CSL checks (PURE J)
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Contract: spec/J_API.md Β§ Emission/CSL; PROPERTIES Β§H (48–52).
20
+ NB. Verbs: emit_apply csl_neutrality csl_beneficence csl_commutation
21
+ NB. Verdicts: CSL_PASS CSL_FAIL_NEUTRALITY CSL_FAIL_BENEFICENCE CSL_FAIL_COMMUTATION
22
+ NB. Policies: GP_PASSTHROUGH GP_SUPPRESS GP_HOLD GP_ATTENUATE (types.ijs)
23
+
24
+ cocurrent 'foundry'
25
+
26
+ NB. ── emit_apply ──────────────────────────────────────────────────────────────
27
+ NB. out emit_apply (prev ; q ; policy ; epsilon)
28
+ NB. PassThrough: out
29
+ NB. Suppress: zeros if q >= 1-Ξ΅ else out (PROPERTIES 48)
30
+ NB. Hold: prev if q >= 1-Ξ΅ else out
31
+ NB. Attenuate: out * max(0, (1-Ξ΅)-q) NB. parens: J is RTL (PROPERTIES 49)
32
+ emit_apply =: 4 : 0
33
+ out =. , x
34
+ y =. boxxopen y
35
+ prev =. , > 0 { y
36
+ q =. 0 ". ": > 1 { y
37
+ pol =. 0 ". ": > 2 { y
38
+ eps =. 0 ". ": > 3 { y , <0.1
39
+ select. pol
40
+ case. GP_PASSTHROUGH do. out
41
+ case. GP_SUPPRESS do.
42
+ if. q >: 1 - eps do. (# out) $ 0. else. out end.
43
+ case. GP_HOLD do.
44
+ if. q >: 1 - eps do. prev else. out end.
45
+ case. GP_ATTENUATE do.
46
+ scale =. 0 >. (1 - eps) - q
47
+ out * scale
48
+ case. do. out
49
+ end.
50
+ )
51
+
52
+ NB. ── csl_neutrality ──────────────────────────────────────────────────────────
53
+ NB. x csl_neutrality (Tx ; epsilon)
54
+ NB. Fail if |xi-xj|>1e_15 and |Ti-Tj|/|xi-xj| > 1+Ξ΅ (PROPERTIES 50)
55
+ csl_neutrality =: 4 : 0
56
+ xv =. , x
57
+ y =. boxxopen y
58
+ Tx =. , > 0 { y
59
+ eps =. 0 ". ": > 1 { y , <0.1
60
+ n =. # xv
61
+ verdict =. CSL_PASS
62
+ for_i. i. n do.
63
+ for_j. (i + 1) + i. 0 >. (n - i) - 1 do.
64
+ dx =. | (i { xv) - j { xv
65
+ dT =. | (i { Tx) - j { Tx
66
+ if. (dx > 1e_15) *. ((dT % dx) > 1 + eps) do.
67
+ verdict =. CSL_FAIL_NEUTRALITY
68
+ end.
69
+ end.
70
+ end.
71
+ verdict
72
+ )
73
+
74
+ NB. ── csl_beneficence ─────────────────────────────────────────────────────────
75
+ NB. x csl_beneficence (Tx ; residual ; epsilon)
76
+ NB. β€–T(x)β€–_2 ≀ (1+Ξ΅)β€–xβ€–_2 and residual ≀ (1+Ξ΅)β€–xβ€–_2 (PROPERTIES 51)
77
+ csl_beneficence =: 4 : 0
78
+ xv =. , x
79
+ y =. boxxopen y
80
+ Tx =. , > 0 { y
81
+ resid =. 0 ". ": > 1 { y
82
+ eps =. 0 ". ": > 2 { y , <0.1
83
+ norm_x =. %: xv +/ . * xv
84
+ norm_Tx =. %: Tx +/ . * Tx
85
+ if. (norm_x > 1e_15) *. (norm_Tx > (1 + eps) * norm_x) do.
86
+ CSL_FAIL_BENEFICENCE return.
87
+ end.
88
+ if. resid > (1 + eps) * norm_x do.
89
+ CSL_FAIL_BENEFICENCE return.
90
+ end.
91
+ CSL_PASS
92
+ )
93
+
94
+ NB. ── csl_commutation ─────────────────────────────────────────────────────────
95
+ NB. x csl_commutation (T_hook ; filter_hook ; epsilon)
96
+ NB. β€–filter(T(x)) - T(filter(x))β€–_∞ ≀ Ξ΅ (PROPERTIES 52)
97
+ csl_commutation =: 4 : 0
98
+ xv =. , x
99
+ y =. boxxopen y
100
+ Th =. 0 { y
101
+ Fh =. 1 { y
102
+ eps =. 0 ". ": > 2 { y , <0.1
103
+ Tx =. xv apply_hook Th
104
+ fTx =. Tx apply_hook Fh
105
+ fx =. xv apply_hook Fh
106
+ Tfx =. fx apply_hook Th
107
+ if. +./ eps < | fTx - Tfx do. CSL_FAIL_COMMUTATION else. CSL_PASS end.
108
+ )
109
+
110
+ cocurrent 'base'
j/goldilocks.ijs ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” Goldilocks F_p arithmetic (PURE J)
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Contract: spec/J_API.md Β§ Goldilocks; PROPERTIES Β§A–C (1–18).
20
+ NB. Carrier Fp: extended int with 0 ≀ v < p.
21
+ NB.
22
+ NB. Verbs: fp_reduce fp_add fp_sub fp_mul fp_mulmod fp_pow fp_inv
23
+ NB. fp_add_batch fp_mul_batch
24
+
25
+ cocurrent 'foundry'
26
+
27
+ NB. fp_reduce y β€” single-limb: (y >= p) ? y-p : y (PROPERTIES 12)
28
+ fp_reduce =: 3 : 0"0
29
+ y =. x: y
30
+ if. y >: p do. y - p else. y end.
31
+ )
32
+
33
+ NB. fp_mulmod x y β€” Goldilocks fold (PROPERTIES 5–11)
34
+ NB. 2^64 ≑ 2^32-1 (mod p); x ≑ lo + hi_lo*EPSILON_FOLD - hi_hi (mod p)
35
+ fp_mulmod =: 4 : 0"0
36
+ a =. x: x
37
+ b =. x: y
38
+ product =. a * b
39
+ lo =. TWO64 | product
40
+ hi =. product <.@% TWO64
41
+ hi_lo =. TWO32 | hi NB. C++: hi & 0xFFFFFFFFull (= mod 2^32), not mod EPSILON_FOLD
42
+ hi_hi =. hi <.@% TWO32
43
+ folded =. lo + hi_lo * EPSILON_FOLD
44
+ if. folded >: hi_hi do.
45
+ reduced =. folded - hi_hi
46
+ else.
47
+ reduced =. folded + p - hi_hi
48
+ end.
49
+ if. reduced >: p do. reduced =. reduced - p end.
50
+ reduced
51
+ )
52
+
53
+ NB. fp_add x y β€” (a+b) mod p (PROPERTIES 13)
54
+ fp_add =: 4 : 0"0
55
+ r =. (x: x) + (x: y)
56
+ if. r >: p do. r =. r - p end.
57
+ r
58
+ )
59
+
60
+ NB. fp_sub x y β€” (a-b) mod p with underflow +p (PROPERTIES 14)
61
+ fp_sub =: 4 : 0"0
62
+ r =. (x: x) - (x: y)
63
+ if. r < 0x do. r =. r + p end.
64
+ r
65
+ )
66
+
67
+ NB. fp_mul x y β€” mulmod (PROPERTIES 15)
68
+ fp_mul =: 4 : 0"0
69
+ x fp_mulmod y
70
+ )
71
+
72
+ NB. fp_pow x y β€” square-and-multiply x^y mod p (PROPERTIES 17)
73
+ fp_pow =: 4 : 0
74
+ a =. x: x
75
+ e =. x: y
76
+ result =. 1x
77
+ base =. a
78
+ while. e > 0x do.
79
+ if. 1x = 2x | e do. result =. result fp_mul base end.
80
+ base =. base fp_mul base
81
+ e =. e <.@% 2x
82
+ end.
83
+ result
84
+ )
85
+
86
+ NB. fp_inv y β€” Fermat a^(p-2) (PROPERTIES 16)
87
+ fp_inv =: 3 : 0
88
+ y fp_pow (p - 2x)
89
+ )
90
+
91
+ NB. Batch elementwise (PROPERTIES 18) β€” same verbs, list rank
92
+ fp_add_batch =: fp_add"0
93
+ fp_mul_batch =: fp_mul"0
94
+
95
+ cocurrent 'base'
j/pmat.ijs ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” Prime Monomial Matrix / PMAT (PURE J)
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Contract: spec/J_API.md Β§ PMAT; PROPERTIES Β§E (26–32); GAP_DECISIONS Β§3–4; j/BOXING.md.
20
+ NB. PMat open fields: rows ; cols ; entries
21
+ NB. entries = nΓ—5 table: sign, delta_source, delta_target, row, col
22
+ NB. Signature = length-2 list (delta_source, delta_target)
23
+ NB. pmat_insert returns new_PMat ; <ok> (length 2; see BOXING.md)
24
+ NB.
25
+ NB. Verbs: pmat_new pmat_insert pmat_validate_grading pmat_conservation
26
+ NB. pmat_compose pmat_frobenius
27
+ NB. Accessors: pmat_rows pmat_cols pmat_entries pmat_shape
28
+
29
+ cocurrent 'foundry'
30
+
31
+ NB. rows pmat_new cols β†’ empty PMat
32
+ pmat_new =: 4 : 0
33
+ (x ; y ; (0 5 $ 0))
34
+ )
35
+
36
+ pmat_rows =: 0 {:: ]
37
+ pmat_cols =: 1 {:: ]
38
+ pmat_entries =: 2 {:: ]
39
+ pmat_shape =: 3 : '(pmat_rows y) , (pmat_cols y)'
40
+
41
+ NB. m pmat_insert (row ; col ; sign ; Signature)
42
+ NB. Signature may be length-2 list or two trailing atoms ds,dt
43
+ NB. Returns new_PMat ; <ok> (BOXING.md). ok=0 on bounds/sign failure only
44
+ NB. (PROPERTIES 27 / GAP_DECISIONS Β§3 β€” no signature↔grade checks).
45
+ pmat_insert =: 4 : 0
46
+ args =. y
47
+ if. 1 = L. args do.
48
+ 'r c s sig' =. 4 {. args , 4 $ a:
49
+ if. 1 = L. sig do. sig =. > sig end.
50
+ 'ds dt' =. 2 {. sig , 0 0
51
+ else.
52
+ 'r c s ds dt' =. 5 {. args , 5 $ 0
53
+ end.
54
+ rows =. pmat_rows x
55
+ cols =. pmat_cols x
56
+ ents =. pmat_entries x
57
+ ok =. 1
58
+ if. (r >: rows) +. (r < 0) do. ok =. 0 end.
59
+ if. (c >: cols) +. (c < 0) do. ok =. 0 end.
60
+ if. -. s e. _1 1 do. ok =. 0 end.
61
+ if. ok do.
62
+ ents =. ents , s , ds , dt , r , c
63
+ (rows ; cols ; ents) ; <ok
64
+ else.
65
+ x ; <ok
66
+ end.
67
+ )
68
+
69
+ NB. Mirror C++ stub: always true (PROPERTIES 28 gap / GAP_DECISIONS Β§3)
70
+ pmat_validate_grading =: 3 : '1'
71
+
72
+ NB. Ξ£ monomials β†’ Signature (PROPERTIES 29)
73
+ pmat_conservation =: 3 : 0
74
+ ents =. pmat_entries y
75
+ if. 0 = # ents do. 0 0 else. +/ 1 2 {"1 ents end.
76
+ )
77
+
78
+ NB. a pmat_compose b β€” sign *= ; ds += a.delta_source only ; dt += b.delta_target only
79
+ NB. (PROPERTIES 31 as coded / GAP_DECISIONS Β§4 β€” not full both-signature sum)
80
+ pmat_compose =: 4 : 0
81
+ a =. x
82
+ b =. y
83
+ rA =. pmat_rows a
84
+ cB =. pmat_cols b
85
+ eA =. pmat_entries a
86
+ eB =. pmat_entries b
87
+ if. (0 = # eA) +. (0 = # eB) do. rA pmat_new cB return. end.
88
+ acc =. 0 5 $ 0
89
+ for_i. i. rA do.
90
+ for_j. i. cB do.
91
+ sign_acc =. 1
92
+ mon_ds =. 0
93
+ mon_dt =. 0
94
+ any =. 0
95
+ arows =. eA #~ i = 3 {"1 eA
96
+ brows =. eB #~ j = 4 {"1 eB
97
+ for_ai. i. # arows do.
98
+ ea =. ai { arows
99
+ acol =. 4 { ea
100
+ for_bi. i. # brows do.
101
+ eb =. bi { brows
102
+ if. acol = 3 { eb do.
103
+ sign_acc =. sign_acc * (0 { ea) * (0 { eb)
104
+ mon_ds =. mon_ds + 1 { ea
105
+ mon_dt =. mon_dt + 2 { eb
106
+ any =. 1
107
+ end.
108
+ end.
109
+ end.
110
+ if. any do.
111
+ if. sign_acc >: 0 do. sign_acc =. 1 else. sign_acc =. _1 end.
112
+ acc =. acc , sign_acc , mon_ds , mon_dt , i , j
113
+ end.
114
+ end.
115
+ end.
116
+ rA ; cB ; acc
117
+ )
118
+
119
+ NB. Frobenius = sqrt(#entries) (PROPERTIES 32)
120
+ pmat_frobenius =: 3 : '%: # pmat_entries y'
121
+
122
+ cocurrent 'base'
j/recurrence.ijs ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” Banach Contraction Recurrence (PURE J)
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Contract: spec/J_API.md Β§ Banach recurrence; PROPERTIES Β§G (39–46); j/BOXING.md.
20
+ NB. Equation: x_{t+1} = Ξ_t Β· x_t + Ξ›_t Β· T(x_t) + g_t
21
+ NB. Constraint: q_t = β€–Ξžβ€– + β€–Ξ›β€–Β·β€–Tβ€– < 1 - Ξ΅
22
+ NB.
23
+ NB. Verbs: synth_weights soft_project q_estimate residual_l2 rec_step rec_run
24
+ NB. (tier_eps lives in types.ijs)
25
+ NB.
26
+ NB. StepInfo open fields (length 7):
27
+ NB. step ; q ; epsilon ; n_xi ; n_lam ; projected ; residual
28
+ NB. rec_step β†’ x_next ; <StepInfo>
29
+ NB. rec_run β†’ list of <StepInfo>
30
+ NB. REC_STATE β†’ x_current ; converged ; <history>
31
+ NB. T / p_op hooks: boxed verb-name strings (or gerunds) resolved by apply_hook.
32
+
33
+ cocurrent 'foundry'
34
+
35
+ NB. x apply_hook boxed_fn β€” invoke rank-1β†’1 transform
36
+ apply_hook =: 4 : 0
37
+ f =. > y
38
+ if. 2 = 3!:0 f do. (f)~ x else. f `: 6 x end.
39
+ )
40
+
41
+ NB. ── synth_weights ───────────────────────────────────────────────────────────
42
+ NB. synth_weights max_steps;tier;profile;[primes]
43
+ NB. Returns xi_schedule ; lambda_schedule (length 2; numeric tables) β€” BOXING.md
44
+ NB. q_star=1-tier_eps; xi=q_star*factor*0.7; lam=q_star*factor*0.3 (PROPERTIES 44)
45
+ synth_weights =: 3 : 0
46
+ y =. boxxopen y
47
+ max_steps =. 0 ". ": > 0 { y , <200
48
+ tier =. 0 ". ": > 1 { y , <T1
49
+ profile =. 0 ". ": > 2 { y , <WP_UNIFORM
50
+ q_star =. 1 - tier_eps tier
51
+ xi_s =. 0 2 $ 0.
52
+ lam_s =. 0 2 $ 0.
53
+ for_t. i. max_steps do.
54
+ select. profile
55
+ case. WP_HARMONIC do. factor =. % t + 1.
56
+ case. WP_LOGDECAY do. factor =. % ^. t + 2.
57
+ case. do. factor =. 1.
58
+ end.
59
+ xi_s =. xi_s , (q_star * factor * 0.7) , 0.
60
+ lam_s =. lam_s , 0. , (q_star * factor * 0.3)
61
+ end.
62
+ xi_s ; lam_s
63
+ :
64
+ synth_weights x
65
+ )
66
+
67
+ NB. ── soft_project ────────────────────────────────────────────────────────────
68
+ NB. (xi ; lam) soft_project (q ; eps) β€” scale by (1-eps)/q if q>1-eps
69
+ NB. Returns xi ; lam (length 2; numeric lists) β€” BOXING.md
70
+ soft_project =: 4 : 0
71
+ 'xi lam' =. x
72
+ xi =. , > xi
73
+ lam =. , > lam
74
+ 'q eps' =. 2 {. (,y) , 0 0.1
75
+ target =. 1 - eps
76
+ if. q <: target do. xi ; lam
77
+ else. scale =. target % q
78
+ (xi * scale) ; (lam * scale)
79
+ end.
80
+ )
81
+
82
+ NB. ── q_estimate ──────────────────────────────────────────────────────────────
83
+ NB. q_estimate xi;lam;x;Tx (PROPERTIES 42)
84
+ q_estimate =: 3 : 0
85
+ 'xi lam xv Tx' =. y
86
+ xi =. , > xi
87
+ lam =. , > lam
88
+ xv =. , > xv
89
+ Tx =. , > Tx
90
+ n_xi =. >./ | xi
91
+ n_lam =. >./ | lam
92
+ n_T =. >./ | Tx
93
+ n_x =. >./ | xv
94
+ if. n_x > 1e_15 do. n_T =. n_T % n_x end.
95
+ n_xi + n_lam * n_T
96
+ )
97
+
98
+ NB. ── residual_l2 ─────────────────────────────────────────────────────────────
99
+ NB. x_next residual_l2 x_t β†’ β€–x'-xβ€–_2
100
+ residual_l2 =: 4 : 0
101
+ d =. (,x) - ,y
102
+ %: d +/ . * d
103
+ )
104
+
105
+ NB. weight at component i (C++: xi[min(i,1)])
106
+ wt_at =: 4 : '((y <. 1) { , x)'
107
+
108
+ NB. ── rec_step ────────────────────────────────────────────────────────────────
109
+ NB. x_t rec_step xi;lam;g;T_hook;p_hook;[step_idx];[tier]
110
+ NB. Returns x_next ; <StepInfo> (length 2 β€” BOXING.md)
111
+ rec_step =: 4 : 0
112
+ xv =. , x
113
+ y =. boxxopen y
114
+ xi =. , > 0 { y
115
+ lam =. , > 1 { y
116
+ g =. , > 2 { y
117
+ Th =. 3 { y
118
+ Ph =. 4 { y
119
+ if. 0 = # g do. g =. (# xv) $ 0. end.
120
+ if. 5 < # y do. step_idx =. 0 ". ": > 5 { y else. step_idx =. 0 end.
121
+ if. 6 < # y do. tier =. 0 ". ": > 6 { y else. tier =. T1 end.
122
+ eps =. tier_eps tier
123
+ dim =. # xv
124
+
125
+ Tx =. xv apply_hook Th
126
+ q =. q_estimate xi ; lam ; xv ; Tx
127
+ projected =. 0
128
+ xi_use =. xi
129
+ lam_use =. lam
130
+ if. q > 1 - eps do.
131
+ sp =. (xi ; lam) soft_project q , eps
132
+ xi_use =. , > 0 { sp
133
+ lam_use =. , > 1 { sp
134
+ q =. q_estimate xi_use ; lam_use ; xv ; Tx
135
+ projected =. 1
136
+ end.
137
+ n_xi =. >./ | xi_use
138
+ n_lam =. >./ | lam_use
139
+
140
+ x_next =. dim $ 0.
141
+ for_i. i. dim do.
142
+ val =. ((xi_use wt_at i) * i { xv) + ((lam_use wt_at i) * i { Tx) + i { g
143
+ x_next =. val i} x_next
144
+ end.
145
+ x_next =. x_next apply_hook Ph
146
+ resid =. x_next residual_l2 xv
147
+ info =. step_idx ; q ; eps ; n_xi ; n_lam ; projected ; resid
148
+ x_next ; <info
149
+ )
150
+
151
+ NB. ── rec_run ─────────────────────────────────────────────────────────────────
152
+ NB. x0 rec_run max_steps;tier;profile;tol;T_hook;p_hook
153
+ NB. Returns list of <StepInfo> (Verify prop 46 via this history).
154
+ NB. Sets REC_STATE =: x_current ; converged ; <history> (length 3)
155
+ rec_run =: 4 : 0
156
+ x0 =. , x
157
+ y =. boxxopen y
158
+ max_steps =. 0 ". ": > 0 { y , <200
159
+ tier =. 0 ". ": > 1 { y , <T1
160
+ profile =. 0 ". ": > 2 { y , <WP_UNIFORM
161
+ tol =. 0 ". ": > 3 { y , <1e_6
162
+ Th =. 4 { y , <'['
163
+ Ph =. 5 { y , <'['
164
+ if. 0 = max_steps do. max_steps =. 200 end.
165
+ if. 0 = tol do. tol =. 1e_6 end.
166
+
167
+ sched =. synth_weights max_steps ; tier ; profile
168
+ xi_s =. > 0 { sched
169
+ lam_s =. > 1 { sched
170
+ g =. (# x0) $ 0.
171
+ xc =. x0
172
+ history =. 0 $ a:
173
+ converged =. 0
174
+
175
+ for_t. i. max_steps do.
176
+ xi =. t { xi_s
177
+ lam =. t { lam_s
178
+ pair =. xc rec_step xi ; lam ; g ; Th ; Ph ; t ; tier
179
+ xc =. , > 0 { pair
180
+ info =. > 1 { pair
181
+ history =. history , <info
182
+ resid =. 6 {:: info
183
+ if. resid < tol do. converged =. 1 break. end.
184
+ end.
185
+
186
+ REC_STATE =: xc ; converged ; <history
187
+ history
188
+ )
189
+
190
+ rec_state_x =: 0 {:: ]
191
+ rec_state_converged =: 1 {:: ]
192
+ rec_state_history =: 2 {:: ]
193
+
194
+ cocurrent 'base'
j/spectral.ijs ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” Spectral Governor (PURE J)
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Contract: spec/J_API.md Β§ Spectral; PROPERTIES Β§F (33–38); j/BOXING.md.
20
+ NB. Jacobian = nΓ—n real matrix.
21
+ NB. SpectralResult open fields:
22
+ NB. spectral_radius ; contractive ; gershgorin_bound ;
23
+ NB. power_iter_bound ; used_power_iteration
24
+ NB. Producers return <SpectralResult> (one outer box) β€” see BOXING.md.
25
+ NB.
26
+ NB. Verbs: gershgorin_bound gershgorin_check power_iteration
27
+ NB. power_iteration_check spectral_analyze
28
+
29
+ cocurrent 'foundry'
30
+
31
+ NB. gershgorin_bound J (PROPERTIES 33)
32
+ gershgorin_bound =: 3 : 0
33
+ J =. y
34
+ n =. # J
35
+ if. 0 = n do. 0 return. end.
36
+ bounds =. 0 $ 0.
37
+ for_i. i. n do.
38
+ row =. i { J
39
+ diag =. | i { row
40
+ off =. +/ | (i ~: i. n) # row
41
+ bounds =. bounds , diag + off
42
+ end.
43
+ >./ bounds
44
+ )
45
+
46
+ NB. J gershgorin_check epsilon β€” contractive iff bound < 1-Ξ΅ (PROPERTIES 34)
47
+ NB. Returns <SpectralResult>
48
+ gershgorin_check =: 4 : 0
49
+ bound =. gershgorin_bound x
50
+ contractive =. bound < (1 - y)
51
+ < bound ; contractive ; bound ; bound ; 0
52
+ )
53
+
54
+ NB. J power_iteration (max_iters , tol)
55
+ NB. Defaults: max_iters=100, tol=1e_12 (PROPERTIES 35)
56
+ power_iteration =: 4 : 0
57
+ J =. x
58
+ 'max_iters tol' =. 2 {. (,y) , 100 1e_12
59
+ n =. # J
60
+ if. 0 = n do. 0 return. end.
61
+ v =. n $ %: % n
62
+ eigenvalue =. 0.
63
+ for_iter. i. max_iters do.
64
+ Jv =. J +/ . * v
65
+ new_ev =. v +/ . * Jv
66
+ if. tol > | new_ev - eigenvalue do. | new_ev return. end.
67
+ eigenvalue =. new_ev
68
+ norm =. %: Jv +/ . * Jv
69
+ if. norm < 1e_15 do. break. end.
70
+ v =. Jv % norm
71
+ end.
72
+ | eigenvalue
73
+ )
74
+
75
+ NB. J power_iteration_check (epsilon , max_iters) (PROPERTIES 36)
76
+ NB. Returns <SpectralResult>
77
+ power_iteration_check =: 4 : 0
78
+ 'eps max_iters' =. 2 {. (,y) , 0.1 100
79
+ bound =. x power_iteration max_iters , 1e_12
80
+ gersho =. gershgorin_bound x
81
+ contractive =. bound < (1 - eps)
82
+ < bound ; contractive ; gersho ; bound ; 1
83
+ )
84
+
85
+ NB. J spectral_analyze epsilon (PROPERTIES 37)
86
+ NB. Gershgorin first; if contractive but bound > 0.95*(1-Ξ΅), power-iterate
87
+ NB. Returns <SpectralResult>
88
+ spectral_analyze =: 4 : 0
89
+ result =. > x gershgorin_check y
90
+ 'sr c gersh pi used' =. result
91
+ if. c *. (gersh > 0.95 * 1 - y) do.
92
+ result =. > x power_iteration_check y , 100
93
+ end.
94
+ < result
95
+ )
96
+
97
+ NB. SpectralResult accessors β€” accept <SpectralResult> (L.>1) or open fields
98
+ sr_open =: >
99
+ sr_fields =: 3 : 'if. 1 < L. y do. > y else. y end.'
100
+ sr_radius =: 0 {:: sr_fields
101
+ sr_contractive =: 1 {:: sr_fields
102
+ sr_gersh =: 2 {:: sr_fields
103
+ sr_power =: 3 {:: sr_fields
104
+ sr_used_pi =: 4 {:: sr_fields
105
+
106
+ cocurrent 'base'
j/types.ijs ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. =============================================================================
2
+ NB. Foundry F1 β€” Shared types and constants (PURE J)
3
+ NB. Copyright (C) 2026 Foundry / Prime Materia Commons
4
+ NB.
5
+ NB. This program is free software: you can redistribute it and/or modify
6
+ NB. it under the terms of the GNU Affero General Public License as published
7
+ NB. by the Free Software Foundation, either version 3 of the License, or
8
+ NB. (at your option) any later version.
9
+ NB.
10
+ NB. This program is distributed in the hope that it will be useful,
11
+ NB. but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ NB. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ NB. GNU Affero General Public License for more details.
14
+ NB.
15
+ NB. You should have received a copy of the GNU Affero General Public License
16
+ NB. along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ NB. =============================================================================
18
+ NB.
19
+ NB. Contract: spec/J_API.md nouns + PROPERTIES.md Β§A,D (constants).
20
+ NB. GAP_DECISIONS: EPSILON_FOLD fold noun; BARRITT_MU omitted (no Barrett path);
21
+ NB. PHI exposed, no math consumer. Boxing: see j/BOXING.md.
22
+ NB. Locale: foundry
23
+
24
+ cocurrent 'foundry'
25
+
26
+ NB. ── Field / system constants (PROPERTIES 1–2, 6, 19–24) ─────────────────────
27
+ NB. GOLDILOCKS_PRIME = 2^64 - 2^32 + 1 = 0xFFFFFFFF00000001
28
+ GOLDILOCKS_PRIME =: 18446744069414584321x
29
+ p =: GOLDILOCKS_PRIME
30
+ NB. Fold constant EPSILON (README) / EPSILON_FOLD (J_API): 2^32 - 1
31
+ EPSILON_FOLD =: 4294967295x
32
+ TWO64 =: 18446744073709551616x
33
+ TWO32 =: 4294967296x
34
+
35
+ K_MAX =: 133144
36
+ MAX_DRIFT =: 300000000000000000x
37
+ PIRTM_MAGIC =: 2135945554x NB. 0x7F504952
38
+ PHI =: 1.618033988749895
39
+ GENESIS_HASH_SIZE=: 32
40
+
41
+ NB. First 64 primes β€” types.h P_64 / J_API noun P64
42
+ P64 =: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311
43
+ P_64 =: P64 NB. C++ name alias
44
+
45
+ NB. ── Tier (PROPERTIES 25) ────────────────────────────────────────────────────
46
+ NB. Tier atoms: 1=T1 2=T2 3=T3 4=T4
47
+ T1 =: 1
48
+ T2 =: 2
49
+ T3 =: 3
50
+ T4 =: 4
51
+
52
+ NB. tier_eps / tier_epsilon β€” T1:0.10 T2:0.05 T3:0.02 T4:0.01; default 0.10
53
+ tier_eps =: 3 : 0
54
+ select. y
55
+ case. 1 do. 0.10
56
+ case. 2 do. 0.05
57
+ case. 3 do. 0.02
58
+ case. 4 do. 0.01
59
+ case. do. 0.10
60
+ end.
61
+ )
62
+ tier_epsilon =: tier_eps
63
+
64
+ NB. Weight profile codes (WeightProfile)
65
+ WP_UNIFORM =: 0
66
+ WP_HARMONIC =: 1
67
+ WP_LOGDECAY =: 2
68
+
69
+ NB. GatePolicy (J_API)
70
+ GP_PASSTHROUGH =: 0
71
+ GP_SUPPRESS =: 1
72
+ GP_HOLD =: 2
73
+ GP_ATTENUATE =: 3
74
+
75
+ NB. CSLVerdict
76
+ CSL_PASS =: 0
77
+ CSL_FAIL_NEUTRALITY =: 1
78
+ CSL_FAIL_BENEFICENCE =: 2
79
+ CSL_FAIL_COMMUTATION =: 3
80
+
81
+ NB. Signature helpers: length-2 integer list (delta_source, delta_target)
82
+ sig_sub =: -
83
+ sig_eq =: -:
84
+
85
+ cocurrent 'base'
spec/COVERAGE_MATRIX.md ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry J contributors
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
5
+
6
+ # Coverage Matrix β€” PROPERTIES.md ↔ harness
7
+
8
+ **Target commit:** `194e588` (pure-J Foundry F1).
9
+ **Sources:** `spec/PROPERTIES.md` (56 numbered properties); `verify/PROPERTY_MAP.md` (harness Primary/Related + measured results); `verify/INVENTORY.md` (non-mathematical / ignored note).
10
+ **Measured log:** `logs/run-20261007-061701.log` β€” PROPERTY_MAP reports **8 PASS / 1 FAIL / 0 BLOCKED** (not 9/9).
11
+ **No invented numbers.** Status definitions exactly as Spec brief.
12
+
13
+ | Status | Definition |
14
+ |--------|------------|
15
+ | **covered** | Listed in PROPERTY_MAP as Primary # or Related # **and** measured **PASS** |
16
+ | **partial** | Listed as Primary/Related but measured **FAIL**; **or** harness works around Core (e.g. recurrence via `rec_step` not `rec_run`); **or** emission / CSL / AceCert / WORM props called out as non-mathematical / ignored by harness |
17
+ | **untested** | Not mentioned in PROPERTY_MAP Primary or Related columns (and not in the ignored 47–56 band) |
18
+
19
+ ---
20
+
21
+ | Prop | Short name | Status | Evidence | Notes |
22
+ |------|------------|--------|----------|-------|
23
+ | 1 | Goldilocks prime (decimal) | covered | `goldilocks_add` (Related) | PASS in PROPERTY_MAP |
24
+ | 2 | Goldilocks prime (hex / named constant) | covered | `goldilocks_add` (Related) | PASS in PROPERTY_MAP |
25
+ | 3 | Field elements are u64 reduced mod p | covered | `goldilocks_add` (Related) | PASS in PROPERTY_MAP |
26
+ | 4 | Elem construction reduces | untested | none | Not in PROPERTY_MAP Primary/Related |
27
+ | 5 | Congruence \(2^{64} \equiv 2^{32}-1 \pmod{p}\) | covered | `goldilocks_mul` (Related 5–11) | PASS in PROPERTY_MAP |
28
+ | 6 | Fold constant EPSILON | covered | `goldilocks_mul` (Related 5–11) | PASS in PROPERTY_MAP |
29
+ | 7 | 128-bit product split | covered | `goldilocks_mul` (Related 5–11) | PASS in PROPERTY_MAP |
30
+ | 8 | hi split into 32-bit halves | covered | `goldilocks_mul` (Related 5–11) | PASS in PROPERTY_MAP |
31
+ | 9 | Reduction identity (fold) | covered | `goldilocks_mul` (Related 5–11) | PASS in PROPERTY_MAP |
32
+ | 10 | Underflow handling on fold | covered | `goldilocks_mul` (Related 5–11) | PASS in PROPERTY_MAP |
33
+ | 11 | Final conditional reduction after fold | covered | `goldilocks_mul` (Related 5–11) | PASS in PROPERTY_MAP |
34
+ | 12 | Single-limb reduce | untested | none | Not in PROPERTY_MAP Primary/Related |
35
+ | 13 | Addition mod p | covered | `goldilocks_add` (Primary) | PASS in PROPERTY_MAP; `verify/tests/goldilocks.ijs` |
36
+ | 14 | Subtraction mod p | covered | `goldilocks_sub` (Primary) | PASS in PROPERTY_MAP; `verify/tests/goldilocks.ijs` |
37
+ | 15 | Multiplication via mulmod | covered | `goldilocks_mul` (Primary) | PASS in PROPERTY_MAP; `verify/tests/goldilocks.ijs` |
38
+ | 16 | Fermat inverse | partial | `goldilocks_inv` (Primary) | **covered-but-FAIL** β€” PROPERTY_MAP: `42*fp_inv(42)` β†’ `11152786313141180820` (not 1); log `run-20261007-061701` |
39
+ | 17 | Binary exponentiation | partial | `goldilocks_inv` (Related) | Listed with prop 16; same measured **FAIL** |
40
+ | 18 | Batch add/mul | untested | none | Not in PROPERTY_MAP Primary/Related |
41
+ | 19 | K_MAX | untested | none | Not in PROPERTY_MAP Primary/Related |
42
+ | 20 | MAX_DRIFT | untested | none | Not in PROPERTY_MAP Primary/Related |
43
+ | 21 | PIRTM_MAGIC | untested | none | Not in PROPERTY_MAP Primary/Related |
44
+ | 22 | PHI | untested | none | Not in PROPERTY_MAP Primary/Related; see Gaps |
45
+ | 23 | P_64 β€” first 64 primes | untested | none | Not in PROPERTY_MAP Primary/Related |
46
+ | 24 | GENESIS_HASH_SIZE | untested | none | Not in PROPERTY_MAP Primary/Related |
47
+ | 25 | Tier epsilons (contraction margins) | untested | none | Not in PROPERTY_MAP Primary/Related |
48
+ | 26 | PMat entry shape | covered | `pmat_insert` (Related) | PASS in PROPERTY_MAP |
49
+ | 27 | Insert domain checks | covered | `pmat_insert` (Primary) | PASS in PROPERTY_MAP; `verify/tests/pmat.ijs` |
50
+ | 28 | Grading condition (stated) | untested | none | Gap: `validate_grading` stub; not in harness map |
51
+ | 29 | Conservation theorem | covered | `pmat_conservation` (Primary) | PASS in PROPERTY_MAP; `verify/tests/pmat.ijs` |
52
+ | 30 | Composition preserves grading (stated) | untested | none | Not in PROPERTY_MAP Primary/Related |
53
+ | 31 | Compose monomial accumulation rule (as coded) | untested | none | Not in PROPERTY_MAP Primary/Related; see Gaps |
54
+ | 32 | Frobenius norm of PMat | untested | none | Not in PROPERTY_MAP Primary/Related |
55
+ | 33 | Gershgorin disk bound | covered | `spectral_contractive`, `spectral_expansive` (Related) | PASS in PROPERTY_MAP |
56
+ | 34 | Contractive test (Gershgorin) | covered | `spectral_contractive`, `spectral_expansive` (Related) | PASS in PROPERTY_MAP |
57
+ | 35 | Power iteration (Rayleigh) | untested | none | Not in PROPERTY_MAP Primary/Related |
58
+ | 36 | Contractive test (power iteration) | untested | none | Not in PROPERTY_MAP Primary/Related |
59
+ | 37 | Analyze fallback policy | covered | `spectral_contractive`, `spectral_expansive` (Related) | PASS in PROPERTY_MAP |
60
+ | 38 | Tested contractive / expansive examples | covered | `spectral_contractive`, `spectral_expansive` (Primary) | PASS in PROPERTY_MAP; `verify/tests/spectral.ijs` |
61
+ | 39 | Recurrence equation | partial | `recurrence_converges` (Related 39–45) | PASS measured, but PROPERTY_MAP notes harness loop via `synth_weights`+`rec_step`; Core `rec_run` still flattens StepInfo |
62
+ | 40 | Contraction condition | partial | `recurrence_converges` (Related 39–45) | Same workaround note as prop 39 |
63
+ | 41 | Unique fixed-point guarantee (narrative) | partial | `recurrence_converges` (Related 39–45) | Same workaround note as prop 39 |
64
+ | 42 | q estimate in step (as coded) | partial | `recurrence_converges` (Related 39–45) | Same workaround note as prop 39 |
65
+ | 43 | Soft projection | partial | `recurrence_converges` (Related 39–45) | Same workaround note as prop 39 |
66
+ | 44 | Weight budget split | partial | `recurrence_converges` (Related 39–45) | Same workaround note as prop 39 |
67
+ | 45 | Projector | partial | `recurrence_converges` (Related 39–45) | Same workaround note as prop 39 |
68
+ | 46 | Residual | partial | `recurrence_converges` (Primary) | PASS measured via `rec_step` loop; PROPERTY_MAP: Core `rec_run` packing still broken (`x_next ; info` flattens) |
69
+ | 47 | WORM / seal chain invariant (system-level) | partial | none (ignored) | INVENTORY: props 47–56 adjacent / gate-WORM theater, not in harness |
70
+ | 48 | Emission Suppress | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
71
+ | 49 | Emission Attenuate scale | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
72
+ | 50 | CSL neutrality | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
73
+ | 51 | CSL beneficence | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
74
+ | 52 | CSL commutation | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
75
+ | 53 | AceCertificate safety margin | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
76
+ | 54 | AceCertificate tail bound | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
77
+ | 55 | Guardian spectral legality | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
78
+ | 56 | Consensus / false-positive bound (narrative) | partial | none (ignored) | INVENTORY non-mathematical / ignored by harness |
79
+
80
+ ---
81
+
82
+ ## Summary counts
83
+
84
+ | Status | Count |
85
+ |--------|------:|
86
+ | covered | **20** |
87
+ | partial | **20** |
88
+ | untested | **16** |
89
+ | **Total** | **56** |
90
+
91
+ ### Partial breakdown (for handoff)
92
+
93
+ | Reason | Props | Count |
94
+ |--------|-------|------:|
95
+ | Measured FAIL (`goldilocks_inv`) | 16, 17 | 2 |
96
+ | Harness workaround (`rec_step` / `rec_run` packing) | 39–46 | 8 |
97
+ | Ignored / non-mathematical (INVENTORY 47–56) | 47–56 | 10 |
98
+
99
+ ### Harness measured (PROPERTY_MAP / log `run-20261007-061701`)
100
+
101
+ | Result | Count | Detail |
102
+ |--------|------:|--------|
103
+ | PASS | 8 | `goldilocks_add`, `goldilocks_mul`, `goldilocks_sub`, `pmat_insert`, `pmat_conservation`, `spectral_contractive`, `spectral_expansive`, `recurrence_converges` |
104
+ | FAIL | 1 | `goldilocks_inv` / prop **16** |
105
+ | BLOCKED | 0 | β€” |
106
+
107
+ Cite: `verify/PROPERTY_MAP.md` Summary counts; `verify/INVENTORY.md` Math count line.
spec/GAP_DECISIONS.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry J contributors
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
5
+
6
+ # Gap Decisions β€” DRAFT for Core handoff
7
+
8
+ **Status:** DRAFT. Spec rulings for Core against gaps listed in `spec/PROPERTIES.md` Β§ Gaps.
9
+ **Target commit:** `194e588`.
10
+ **Policy:** Prefer **Match C++ as coded** when README prose and implementation disagree, unless README is the only statement of a math identity (then say so). **No invented numeric constants.** Alapeno remains out of scope.
11
+
12
+ Sources for gap list: `spec/PROPERTIES.md` lines 269–276 (Gaps section).
13
+
14
+ ---
15
+
16
+ ## 1. EPSILON naming (README name vs `0xFFFFFFFFULL` literal)
17
+
18
+ **Sources**
19
+
20
+ - PROPERTIES Gaps: β€œNamed C++ identifier `EPSILON`: named only in README Key Constants; code uses literal `0xFFFFFFFFULL` in mulmod, not a `types.h` symbol.”
21
+ - Prop 6 cites: README.md Β§ β€œKey Constants” (line 320); `src/goldilocks.cpp:27,31`.
22
+ - `J_API.md` already exposes fold constant as noun `EPSILON_FOLD` (= `0xFFFFFFFF` = \(2^{32}-1\)), noting README name `EPSILON`.
23
+
24
+ **Ruling:** **Match C++ as coded** (literal fold mask in mulmod path).
25
+
26
+ **Rationale:** README supplies the name; the implementation never defines an `EPSILON` symbol in `types.h` β€” Core must implement the fold arithmetic with the same literal value, not invent a C++ identifier.
27
+
28
+ **Done for Core**
29
+
30
+ - Provide a named J noun for the fold constant (e.g. `EPSILON_FOLD` per `J_API.md`) equal to `0xFFFFFFFF` (= \(2^{32}-1\)).
31
+ - Use that value in `fp_mulmod` / fold exactly as `src/goldilocks.cpp` uses `eps` / `hi_lo` mask.
32
+ - Do not require a `types.h`-style C++ symbol named `EPSILON`; README naming is documentation alias only.
33
+
34
+ ---
35
+
36
+ ## 2. BARRITT_MU unused
37
+
38
+ **Sources**
39
+
40
+ - PROPERTIES Gaps: β€œ`BARRITT_MU`: defined equal to `P` and unused (`src/goldilocks.cpp:9–10`); no Barrett algorithm steps beyond the comment.”
41
+ - No numbered property asserts Barrett reduction; Goldilocks reduction is props 5–12 (fold / mulmod as coded).
42
+
43
+ **Ruling:** **Match C++ as coded** (define-equal-to-`P`, unused; no Barrett path).
44
+
45
+ **Rationale:** Sources define the constant and leave it unused; there is no Barrett algorithm identity to implement beyond the comment. Inventing Barrett steps would invent math not present in the cited cpp.
46
+
47
+ **Done for Core**
48
+
49
+ - May omit `BARRITT_MU` entirely, or expose a synonym equal to `GOLDILOCKS_PRIME` / `P` with no call sites.
50
+ - Do **not** implement Barrett reduction; keep reduction as fold/mulmod per props 5–12 and `src/goldilocks.cpp`.
51
+
52
+ ---
53
+
54
+ ## 3. PMat grading unchecked in `insert` / `validate_grading`
55
+
56
+ **Sources**
57
+
58
+ - PROPERTIES Gaps: β€œPMat per-entry grading vs indices: stated in `pmat.h:3` but not checked in `insert` / `validate_grading`.”
59
+ - Prop 28: header/README narrative says grading `tgt_sig - src_sig = monomial` is enforced; **Gap note** β€” `insert` does not compare signatures to row/col grades; `validate_grading` always returns `true` (`src/pmat.cpp:19–22`). Cite: `include/pmat.h:3,21–25`.
60
+
61
+ **Ruling:** **Match C++ as coded** (stub / always-true validate; insert domain checks only).
62
+
63
+ **Rationale:** The stated grading condition is narrative in the header; the coded surface that tests and callers see is domain checks on `insert` (prop 27) plus a no-op `validate_grading`. Enforcing full grading now would change observable C++ behavior Core is recreating. README/header is not a separate coded math identity here β€” the stub is the behavior.
64
+
65
+ **Done for Core**
66
+
67
+ - `pmat_insert`: fail only on `row β‰₯ rows`, `col β‰₯ cols`, or `sign βˆ‰ {1,-1}` (prop 27); do not compare signatures to row/col grades.
68
+ - `validate_grading` (or J equivalent): return success / true unconditionally, matching `src/pmat.cpp:19–22`.
69
+ - Document that prop 28 β€œstated” grading remains a future Spec upgrade, not Core F1 obligation.
70
+
71
+ ---
72
+
73
+ ## 4. Compose deltas (`a.delta_source + b.delta_target` only vs README/full both signatures)
74
+
75
+ **Sources**
76
+
77
+ - PROPERTIES Gaps: β€œCompose monomial rule vs β€˜sum of both signatures’: coded as `a.delta_source` + `b.delta_target` only (`src/pmat.cpp:54–55`), not full addition of both signatures from both factors.”
78
+ - Prop 31 (as coded): on matching `a.col == b.row`: `sign_acc *= a.sign * b.sign`; `monom_acc.delta_source += a.monomial.delta_source`; `monom_acc.delta_target += b.monomial.delta_target`. Cite: `src/pmat.cpp:51–55`.
79
+ - Prop 30 states composition preserves grading (narrative); prop 29 conservation is separately tested on entry monomials.
80
+
81
+ **Ruling:** **Match C++ as coded** (accumulate `a.delta_source` into result source and `b.delta_target` into result target only).
82
+
83
+ **Rationale:** Prop 31 already records the coded rule with a precise cite. A β€œsum of both signatures from both factors” reading is the prose disagreement; Core must reproduce the cpp accumulation, not invent a fuller bilinear sum.
84
+
85
+ **Done for Core**
86
+
87
+ - On compose match `a.col == b.row`: multiply signs; add **only** `a.monomial.delta_source` to accumulated `delta_source`; add **only** `b.monomial.delta_target` to accumulated `delta_target`.
88
+ - Do not add `a.delta_target` or `b.delta_source` into the composed monomial unless/until Spec revises prop 31 against a code change.
89
+
90
+ ---
91
+
92
+ ## 5. PHI unused in math cpp
93
+
94
+ **Sources**
95
+
96
+ - PROPERTIES Gaps: β€œPHI usage in UAC/recurrence math: constant present; no consuming identity in the cited math cpp files.”
97
+ - Prop 22: `PHI = 1.618033988749895`. Cite: `include/types.h:21`. β€œ(Sources do not state further mathematical use in the UAC/recurrence core.)”
98
+
99
+ **Ruling:** **Match C++ as coded** (constant present; unused in field / PMat / spectral / recurrence math paths).
100
+
101
+ **Rationale:** Value is sourced from `types.h`; no cited math cpp consumes it. README is not supplying a PHI identity to implement β€” absence of use is the coded fact.
102
+
103
+ **Done for Core**
104
+
105
+ - Expose noun `PHI` with the value from `include/types.h:21` / prop 22 (do not invent a different constant).
106
+ - Do not wire PHI into Goldilocks, PMat, spectral governor, or Banach recurrence steps unless a later Spec cites a consuming identity.
107
+
108
+ ---
109
+
110
+ ## Summary table
111
+
112
+ | # | Gap | Spec ruling | Done for Core (one line) |
113
+ |---|-----|-------------|---------------------------|
114
+ | 1 | EPSILON naming | Match C++ as coded | Named fold noun = `0xFFFFFFFF`; use in mulmod; no required C++ `EPSILON` symbol |
115
+ | 2 | BARRITT_MU unused | Match C++ as coded | Omit or synonym-of-P; no Barrett algorithm |
116
+ | 3 | PMat grading unchecked | Match C++ as coded | Insert domain checks only; validate always true |
117
+ | 4 | Compose deltas | Match C++ as coded | `a.delta_source` + `b.delta_target` only (prop 31) |
118
+ | 5 | PHI unused | Match C++ as coded | Expose constant; no math consumer in Core F1 |
119
+
120
+ ---
121
+
122
+ ## Handoff note
123
+
124
+ This document is **DRAFT for Core**. It does not modify `PROPERTIES.md`, `j/`, `verify/`, `include/`, `src/`, or Alapeno. Core should treat the five β€œDone for Core” bullets as the F1 obligation for these gaps; reopen Spec only if a later commit changes the cited cpp behavior.
spec/HCALC_CROSSLINKS.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry J / HCALC contributors
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
5
+
6
+ # Foundry J β†’ HCALC cross-links (Spec input)
7
+
8
+ **From:** Foundry J Spec
9
+ **For:** HCALC Spec / Alloy / Lean (via Hilbert)
10
+ **Sources:** `/workspace/foundry-j/spec/PROPERTIES.md`, `J_API.md`, `GAP_DECISIONS.md`; Foundry README Sedona Spine / PIRTM.
11
+ **HCALC abstract (as given):** \( X_{t+1}=\Xi(t,\Lambda_m\cdot C[T_p(X_t)]) \).
12
+ **Rule:** No invented \(\Lambda_m\) or \(\Xi\) definitions. Gaps flagged below.
13
+ **Note:** `/workspace/hcalc` had no prior tree when this note was written.
14
+
15
+ ---
16
+
17
+ ## 0. Shape gap (read first)
18
+
19
+ | | Foundry F1 (cited) | HCALC abstract (given) |
20
+ |--|--------------------|-------------------------|
21
+ | Step | \( x_{t+1}=\Xi_t x_t+\Lambda_t T(x_t)+g_t \) (PROPERTIES **39**) | \( X_{t+1}=\Xi(t,\Lambda_m\cdot C[T_p(X_t)]) \) |
22
+ | \(\Xi\) | Per-step **schedule weights** (length-2 vectors) | Operator/map \(\Xi(t,\cdot)\) β€” **undefined in Foundry** |
23
+ | \(\Lambda\) / \(\Lambda_m\) | \(\Lambda_t\) schedule weights (same carrier as \(\Xi_t\)) | \(\Lambda_m\) β€” **no definition in Foundry sources** |
24
+ | \(T\) / \(T_p\) | Nonlinear \(T(x)\) in recurrence; **no \(T_p\)** symbol | Prime-indexed \(T_p\) β€” **not named in Foundry math** |
25
+ | \(C\) | Not a Foundry recurrence symbol | **Undefined** in Foundry inventory |
26
+
27
+ **Spec stance:** Treat Foundry as a **candidate instantiation layer** for pieces of the HCALC pipeline (prime index set, contraction tests, Banach step), not as a definition of \(\Lambda_m\) or HCALC-\(\Xi\). Alloy/Lean must not silently equate the two step forms.
28
+
29
+ ---
30
+
31
+ ## 1. Map: what Foundry can instantiate
32
+
33
+ ### \(T_p\) candidates (prime-indexed structure)
34
+
35
+ | Foundry prop / surface | Role vs \(T_p\) | Cite |
36
+ |------------------------|----------------|------|
37
+ | **23** `P_64` (first 64 primes, length-64 list) | Discrete **prime index set** for any prime-indexed tensor/mask; strongest Foundry hook for β€œprime-indexed” | `types.h:24–30`; PROPERTIES 23 |
38
+ | `PrimeMask` / `ResonanceWord` (J_API nouns) | Bitmask / packed classβˆ₯payload over `P_64` indices β€” **representation**, not a recursive tensor law | J_API.md nouns |
39
+ | **26–32** PMAT / prime monomials (`Signature`, conservation, compose-as-coded) | Sparse **prime-monomial** linear algebra; possible skeleton for layer ops, **not** a definition of recursive tensor reps | PROPERTIES E; GAP_DECISIONS: grading stub, compose = `a.delta_source+b.delta_target` only |
40
+ | **1–17** Goldilocks \(\mathbb{F}_p\) | Finite-field **carrier** for discrete/algebraic lifts; does **not** by itself give real contraction of \(X_t\) | PROPERTIES A–C |
41
+ | **21** `PIRTM_MAGIC` / linker PIRTM | Bytecode/linker theater (Sedona Spine tooling) β€” **not** a math definition of \(T_p\) | PROPERTIES 21; README linker |
42
+
43
+ **Sedona Spine:** README names a 10-layer architecture and Triple-Lock; it does **not** define HCALC \(T_p\), \(\Lambda_m\), or \(C\). Use as architectural context only.
44
+
45
+ ### Contraction / spectral measures (layerwise contraction β†’ converged \(X\))
46
+
47
+ | Foundry prop | Measure | Cite |
48
+ |--------------|---------|------|
49
+ | **33–34** Gershgorin bound; `contractive ⟺ bound < 1-Ξ΅` | A priori row-sum spectral bound | PROPERTIES 33–34 |
50
+ | **35–37** Power iteration + fallback policy | Dominant-modulus check; recheck when Gershgorin tight | PROPERTIES 35–37 |
51
+ | **38** Contractive / expansive test matrices | Concrete witnesses (quoted in PROPERTIES; do not alter) | PROPERTIES 38 |
52
+ | **25** Tier Ξ΅: T1β†’0.10, T2β†’0.05, T3β†’0.02, T4β†’0.01 | Contraction **margin** schedule | PROPERTIES 25 |
53
+ | **39–46** Banach recurrence, \(q_t\), soft project, residual | Foundry **evolution** + projection when \(q>1-\varepsilon\) | PROPERTIES G |
54
+ | **55** Guardian spectral legality | Reject if `spectral_radius >= 1` or non-finite next state | PROPERTIES 55 |
55
+
56
+ ---
57
+
58
+ ## 2. Invariants demanded before calling HCALC β€œcoherent”
59
+
60
+ Demand these as **explicit** Spec/Alloy/Lean obligations (Foundry-backed where cited; HCALC-native where flagged):
61
+
62
+ 1. **Step-form declared** β€” Either adopt Foundry **39** as an instance, or define HCALC \(\Xi(t,\cdot)\) / \(\Lambda_m\) / \(C\) / \(T_p\) separately. **Do not mix symbols without a bridge lemma.** (Gap: HCALC defs missing.)
63
+ 2. **Prime index honesty** β€” If β€œprime-indexed” means Foundry, \(T_p\) (or its mask) is valued on **`P_64` (prop 23)** or a stated extension; no silent infinite prime stream.
64
+ 3. **Contraction predicate** β€” Layer/Jacobian (or stated linearization) satisfies Foundry-style **34/36**: modulus bound \(< 1-\varepsilon\) for a declared \(\varepsilon\) (tier **25** or other cited constant).
65
+ 4. **q-budget / soft projection** β€” If Foundry schedules are used: **40/42/43** β€” \(q=\|\Xi\|+\|\Lambda\|\cdot\|T\|\); if \(q>1-\varepsilon\), scale as coded.
66
+ 5. **Convergence witness** β€” Residual **46** (or Lean equivalent) below a declared tolerance; unique fixed-point only where Banach hypotheses **41** are discharged (not assumed from narrative alone).
67
+ 6. **PMAT conservation (if PMAT used)** β€” **29** product/sum of entry monomials equals accumulated signature sums (test vector cited in PROPERTIES).
68
+ 7. **Gap rulings respected** β€” Match C++ as coded per `GAP_DECISIONS.md` (compose deltas, grading stub, EPSILON literal, unused BARRITT_MU/PHI) until HCALC Spec overrides **in writing**.
69
+ 8. **No invented \(\Lambda_m\)** β€” Alloy/Lean may leave \(\Lambda_m\), HCALC-\(\Xi\), \(C\), \(T_p\) as **opaque symbols** or axioms with `sorry`/uninterpreted ops until HCALC Spec defines them.
70
+
71
+ ---
72
+
73
+ ## 3. Shortlist for Alloy asserts + Lean axiom candidates
74
+
75
+ ### Alloy-oriented asserts (finite, checkable)
76
+
77
+ | ID | Assert (informal) | Foundry anchor |
78
+ |----|-------------------|----------------|
79
+ | A1 | `#P_64 = 64` and elements are the listed first-64 primes | Prop **23** |
80
+ | A2 | `contractive(J,Ξ΅) iff gershgorin(J) < 1-Ξ΅` (and optional power-iter branch **37**) | **33–37** |
81
+ | A3 | Soft-project: if `q > 1-Ξ΅` then scaled weights used in the step | **43** |
82
+ | A4 | Recurrence carrier: next state is affine Foundry form **only if** instance = Foundry | **39** |
83
+ | A5 | PMAT conservation on insert-set | **29** |
84
+ | A6 | Guardian: reject when spectral radius β‰₯ 1 or non-finite | **55** |
85
+ | A7 | **Gap stub:** `Ξ›m`, HCALC-`Ξ`, `C`, `T_p` are unconstrained until defined β€” assert **presence of a definition record**, not a formula | (no Foundry cite) |
86
+
87
+ ### Lean axiom / definition candidates (prefer defs where Foundry is concrete)
88
+
89
+ | ID | Candidate | Kind | Note |
90
+ |----|-----------|------|------|
91
+ | L1 | `P64 : Fin 64 β†’ β„•` with the PROPERTIES **23** list | **definition** (data) | No axiom needed if listed |
92
+ | L2 | `gershgorinBound`, `contractiveG` | **definition** + theorem | From **33–34** |
93
+ | L3 | `FoundryStep Ξ Ξ› T g x` | **definition** | Exact **39**; β‰  HCALC abstract |
94
+ | L4 | `qEstimate` / `softProject` | **definition** | **42–43** as coded |
95
+ | L5 | Banach unique fixed point under `q < 1-Ξ΅` | **theorem** (or axiom until proof) | Narrative **41** β€” prove or mark unfinished |
96
+ | L6 | `Ξ›m`, `HCALC.Ξ`, `C`, `Tp` | **axioms / uninterpreted** | **Gaps β€” do not invent** |
97
+ | L7 | Bridge `HCALCStep = FoundryStep` (or embedding) | **axiom or theorem** | Only after HCALC Spec defines left-hand side |
98
+
99
+ ### Explicit gaps (do not invent)
100
+
101
+ - \(\Lambda_m\) β€” no Foundry definition (Foundry has \(\Lambda_t\) weights only).
102
+ - HCALC \(\Xi(t,\cdot)\) β€” not Foundry \(\Xi_t\) vectors.
103
+ - \(C[\cdot]\) β€” undefined in Foundry inventory.
104
+ - \(T_p\) β€” no Foundry symbol; closest are `P_64` + PMAT + \(T(x)\).
105
+ - Recursive tensor representation law β€” **absent** from Foundry PROPERTIES.
106
+ - `/workspace/hcalc` content beyond this note β€” none at write time.
107
+
108
+ ---
109
+
110
+ ## 4. Suggested handoff order
111
+
112
+ 1. HCALC Spec: define or explicitly leave open \(\Lambda_m\), \(\Xi\), \(C\), \(T_p\).
113
+ 2. Alloy: A1–A6 on Foundry instance; A7 gate on open symbols.
114
+ 3. Lean: L1–L4 defs first; L6 axioms for gaps; L5/L7 only with proof or labeled unfinished.
115
+ 4. Foundry Core/Verify: keep prop **16** FAIL and coverage matrix in view when claiming Goldilocks lifts into HCALC.
116
+
spec/HCALC_PRODUCTION_REVIEW.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry J contributors
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
5
+
6
+ # Foundry J Spec β€” HCALC PRODUCTION.md review (pass 3 / InstanceBridge)
7
+
8
+ **Reviewer:** Foundry J Spec
9
+ **Date:** 2026-10-07 (PT)
10
+ **Target:** `/workspace/hcalc/spec/PRODUCTION.md` @ `f5a08da`
11
+ **Focus:** Β§6 ShapeMap `InstanceBridge` vs REJECT identity; Core path `/workspace/hcalc/j/`
12
+
13
+ ---
14
+
15
+ ## Verdict (short)
16
+
17
+ | Item | Verdict |
18
+ |------|---------|
19
+ | Β§6 `InstanceBridge` (NOT rfl / NOT Foundry39≑nested) | **ACCEPT** |
20
+ | Explicit param table \(T:=C\circ T_p\), \(\Lambda:=\Lambda_m\mathbf{1}\), \(\Xi:=\xi_t\) without symbol identity | **ACCEPT** |
21
+ | Option B: implement `hcalc_step` only; `toFoundryStep` diagnostic cite-only | **ACCEPT** |
22
+ | soft_project remains Foundry-coded **42–43**; `C` is Spec wiring that *uses* the scale idea | **ACCEPT** (wording in Β§6) |
23
+ | Core path `/workspace/hcalc/j/` + verb list matching `HCALC_API_DRAFT.md` | **ACCEPT** |
24
+ | GAP_DECISIONS | **No conflict** |
25
+ | Silent identity Foundry39 ≑ nested | Still **REJECT** β€” PRODUCTION agrees |
26
+
27
+ **Overall:** **ACCEPT** PRODUCTION @ `f5a08da` for ShapeMap / implement path. Non-blocking nits below.
28
+
29
+ ---
30
+
31
+ ## Β§6 ShapeMap detail
32
+
33
+ PRODUCTION now states clearly:
34
+
35
+ - `toFoundryStep` = \(\xi_t\cdot x + \Lambda_m(C\circ T_p)(x)+g_t\) under InstanceBridge params.
36
+ - `hcalcStep` = \(\xi_t\cdot(\Lambda_m\cdot C(T_p(x)))+g_t\).
37
+ - These differ (\(\xi_t\cdot x\) only on Foundry side).
38
+ - L7 = structure + theorems about the table, **not** `FoundryStep = hcalcStep`.
39
+
40
+ This matches Foundry J Spec’s prior REJECT of identity and Hilbert’s explicit morphism (not rfl). **ACCEPT.**
41
+
42
+ ---
43
+
44
+ ## `/workspace/hcalc/j/` implement path
45
+
46
+ | Check | Result |
47
+ |-------|--------|
48
+ | Path authoritative under hcalc | **ACCEPT** |
49
+ | Verbs: `tp_from_p64`, `c_wrap`, `lam_m_from_bound`, `hcalc_xi_apply`, `hcalc_step`, `hcalc_run` | **ACCEPT** (names match draft) |
50
+ | Do not equate `hcalc_step` / `rec_step` | **ACCEPT** |
51
+ | Implementation status | **Scaffold only** (`j/README.md`); bodies still Core’s job β€” not a Spec reject |
52
+
53
+ ---
54
+
55
+ ## Non-blocking nits (optional Spec polish)
56
+
57
+ 1. **Β§3 vs Β§6 soft_project wording:** Β§3 formula still scales **state** \(x\); Foundry **43** scales **schedules** \(\Xi,\Lambda\). Β§6 correctly calls that Spec wiring. One footnote in Β§3: β€œ`softProjectScale` factor shared; Foundry `soft_project` API remains schedule-scaling when called as Foundry.”
58
+ 2. **Alloy checklist line** still says β€œFoundryAdditive” β€” align naming to `InstanceBridge` / `toFoundryStep` vs `hcalcStep`.
59
+ 3. **Β§8 Hyp under Uniform:** phrase β€œwhen using InstanceBridge” for nested Lip β€” prefer β€œwhen iterating `hcalcStep` (Option B)”; `toFoundryStep` has an extra \(\xi_t\cdot x\) term.
60
+ 4. **Ξ± law / β„“βˆž residual:** still Spec-def (not Foundry source-claim) β€” OK if provenance stays Spec-owned.
61
+
62
+ ---
63
+
64
+ ## Summary for Hilbert / HCALC Spec
65
+
66
+ **ACCEPT** InstanceBridge ShapeMap and `/workspace/hcalc/j/` Core path. Identity REJECT stands and is honored. Ready for Alloy/Lean/Core to implement Option B without further Foundry J Spec gate β€” unless they want the Β§3 soft_project footnote.
spec/J_API.md ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Foundry F1 β€” Pure-J Core API Surface
2
+
3
+ Mapping of the C++ mathematical surface to J Core verbs/nouns.
4
+ **No implementation.** Names, ranks, and domains only.
5
+ Preferred license for derivative pure-J work: **AGPL-3.0**.
6
+
7
+ Convention: J ranks β€” `0` atom, `1` list/vector, `2` table/matrix, `3` rank-3. Domains name the mathematical carrier.
8
+
9
+ ---
10
+
11
+ ## Nouns (data carriers)
12
+
13
+ | Noun | Rank | Domain | Maps from |
14
+ |------|------|--------|-----------|
15
+ | `Fp` | 0 | atom `u64` with \(0 \le v < p\) | `Goldilocks::Elem` |
16
+ | `FpVec` | 1 | list of `Fp` | batch Elem arrays |
17
+ | `Signature` | 1 | length-2 integer list `(delta_source; delta_target)` | `pmc::Signature` |
18
+ | `PMatEntry` | 1 | boxed/record: `sign (Β±1)`, `Signature`, `row`, `col` | `pmc::PMatEntry` |
19
+ | `PMat` | 1–2 | sparse list of `PMatEntry` plus shape `(rows; cols)` | `pmc::PMat` |
20
+ | `Jacobian` | 2 | real matrix \( n\times n \) | `vector<vector<double>>` spectral input |
21
+ | `State` | 1 | real vector \( x_t \) | recurrence state |
22
+ | `Weights` | 1 | length-2 (or dim) real list for Ξ / Ξ› schedule row | `xi_schedule_[t]`, `lambda_schedule_[t]` |
23
+ | `StepInfo` | 0–1 | record: `step`, `q`, `epsilon`, `n_xi`, `n_lam`, `projected`, `residual` | `pmc::StepInfo` |
24
+ | `SpectralResult` | 0–1 | record: `spectral_radius`, `contractive`, `gershgorin_bound`, `power_iter_bound`, `used_power_iteration` | `SpectralGovernor::Result` |
25
+ | `AceCert` | 0–1 | record: `lipschitz_upper`, `safety_margin`, `tail_bound`, `certified` | `pmc::AceCertificate` |
26
+ | `Tier` | 0 | enum atom T1..T4 | `pmc::Tier` |
27
+ | `GatePolicy` | 0 | enum: PassThrough / Suppress / Hold / Attenuate | `pmc::GatePolicy` |
28
+ | `P64` | 1 | length-64 list of first primes | `pmc::P_64` |
29
+ | `PrimeMask` | 0 | `u64` bitmask over `P64` indices | `pmc::PrimeMask` |
30
+ | `ResonanceWord` | 0 | `u64` packed classβˆ₯payload | `pmc::ResonanceWord` |
31
+
32
+ ### Named constant nouns (must match PROPERTIES.md)
33
+
34
+ | Noun | Rank | Value source |
35
+ |------|------|--------------|
36
+ | `GOLDILOCKS_PRIME` / `p` | 0 | `0xFFFFFFFF00000001` = 18446744069414584321 |
37
+ | `EPSILON_FOLD` | 0 | `0xFFFFFFFF` = \(2^{32}-1\) (fold; README name `EPSILON`) |
38
+ | `K_MAX` | 0 | 133144 |
39
+ | `MAX_DRIFT` | 0 | 300000000000000000 |
40
+ | `PIRTM_MAGIC` | 0 | `0x7F504952` |
41
+ | `PHI` | 0 | 1.618033988749895 |
42
+ | `tier_epsilon` | 0←0 | T1:0.10 T2:0.05 T3:0.02 T4:0.01 |
43
+
44
+ ---
45
+
46
+ ## Verbs β€” Goldilocks field
47
+
48
+ | Verb | Rank | Domain β†’ range | Meaning |
49
+ |------|------|----------------|---------|
50
+ | `fp_reduce` | 0β†’0 | `u64` β†’ `Fp` | conditional \( x-p \) if \( x\ge p \) |
51
+ | `fp_add` | 0 0β†’0 | `FpΓ—Fp` β†’ `Fp` | \( (a+b)\bmod p \) |
52
+ | `fp_sub` | 0 0β†’0 | `FpΓ—Fp` β†’ `Fp` | \( (a-b)\bmod p \) |
53
+ | `fp_mul` | 0 0β†’0 | `FpΓ—Fp` β†’ `Fp` | mulmod via reduction identity |
54
+ | `fp_mulmod` | 0 0β†’0 | `u64Γ—u64` β†’ `u64` | 128-bit product + fold \( \mathrm{lo}+\mathrm{hi\_lo}\cdot\varepsilon-\mathrm{hi\_hi} \) |
55
+ | `fp_pow` | 0 0β†’0 | `FpΓ—u64` β†’ `Fp` | square-and-multiply |
56
+ | `fp_inv` | 0β†’0 | `Fp` β†’ `Fp` | \( a^{p-2} \) (Fermat) |
57
+ | `fp_add_batch` | 1 1β†’1 | `FpVecΓ—FpVec` β†’ `FpVec` | elementwise add |
58
+ | `fp_mul_batch` | 1 1β†’1 | `FpVecΓ—FpVec` β†’ `FpVec` | elementwise mul |
59
+
60
+ ---
61
+
62
+ ## Verbs β€” PMAT
63
+
64
+ | Verb | Rank | Domain β†’ range | Meaning |
65
+ |------|------|----------------|---------|
66
+ | `pmat_new` | 0 0β†’1 | `(rows;cols)` β†’ empty `PMat` | allocate shape |
67
+ | `pmat_insert` | 1 0 0 0 1β†’1 | PMat,row,col,sign,Signature β†’ PMat\|fail | domain checks Β±1 and bounds |
68
+ | `pmat_validate_grading` | 1β†’0 | `PMat` β†’ boolean | global grading (stated identity) |
69
+ | `pmat_conservation` | 1β†’1 | `PMat` β†’ `Signature` | Ξ£ monomials |
70
+ | `pmat_compose` | 1 1β†’1 | `PMatΓ—PMat` β†’ `PMat` | sign multiply + monomial accumulate |
71
+ | `pmat_frobenius` | 1β†’0 | `PMat` β†’ real | \( \sqrt{\#entries} \) |
72
+
73
+ ---
74
+
75
+ ## Verbs β€” Spectral governor
76
+
77
+ | Verb | Rank | Domain β†’ range | Meaning |
78
+ |------|------|----------------|---------|
79
+ | `gershgorin_bound` | 2β†’0 | `Jacobian` β†’ real | max disk \( |J_{ii}|+\sum_{j\neq i}|J_{ij}| \) |
80
+ | `gershgorin_check` | 2 0β†’1 | Jacobian,Ξ΅ β†’ `SpectralResult` | contractive iff bound \( <1-\varepsilon \) |
81
+ | `power_iteration` | 2 0 0β†’0 | Jacobian,max_iters,tol β†’ real | dominant \|eigenvalue\| |
82
+ | `power_iteration_check` | 2 0 0β†’1 | Jacobian,Ξ΅,max_iters β†’ `SpectralResult` | same contractive predicate |
83
+ | `spectral_analyze` | 2 0β†’1 | Jacobian,Ξ΅ β†’ `SpectralResult` | Gershgorin then optional power iter |
84
+
85
+ ---
86
+
87
+ ## Verbs β€” Banach recurrence
88
+
89
+ | Verb | Rank | Domain β†’ range | Meaning |
90
+ |------|------|----------------|---------|
91
+ | `tier_eps` | 0β†’0 | `Tier` β†’ real | margin Ξ΅ |
92
+ | `synth_weights` | 0 0 1β†’2 | max_steps,Tier,profile,[primes] β†’ (Ξ schedule; Ξ› schedule) | Uniform/Harmonic/LogDecay; 0.7/0.3 of \( q^\star \) |
93
+ | `soft_project` | 1 1 0 0β†’1 1 | Ξ,Ξ›,q,Ξ΅ β†’ scaled Ξ,Ξ› | scale by \( (1-\varepsilon)/q \) if \( q>1-\varepsilon \) |
94
+ | `rec_step` | 1 1 1 1β†’1 1 | x, Ξ, Ξ›, g ; T ; p_op β†’ (x_next; StepInfo) | \( x'=\Xi x+\Lambda T(x)+g \) then project |
95
+ | `rec_run` | 1 0β†’2 | x0, config, T, p_op β†’ StepInfo history | until residual < tol or max_steps |
96
+ | `residual_l2` | 1 1β†’0 | x_next, x_t β†’ real | \( \|x'-x\|_2 \) |
97
+ | `q_estimate` | 1 1 1 1β†’0 | Ξ,Ξ›,x,Tx β†’ real | \( \|\Xi\|_\infty+\|\Lambda\|_\infty\cdot\|T\| \) (coded max-abs form) |
98
+
99
+ Transform `T` and projector `p_op` are rank-1β†’1 function nouns (hooks), not fixed verbs.
100
+
101
+ ---
102
+
103
+ ## Verbs β€” Emission / CSL / certify (math-adjacent)
104
+
105
+ | Verb | Rank | Domain β†’ range | Meaning |
106
+ |------|------|----------------|---------|
107
+ | `emit_apply` | 1 1 0 0β†’1 | out,prev,q,policyΓ—Ξ΅ β†’ out' | PassThrough/Suppress/Hold/Attenuate |
108
+ | `csl_neutrality` | 1 1 0β†’0 | x,Tx,Ξ΅ β†’ verdict | pairwise Lip-style bound |
109
+ | `csl_beneficence` | 1 1 0 0β†’0 | x,Tx,residual,Ξ΅ β†’ verdict | norm & residual growth |
110
+ | `csl_commutation` | 1 0β†’0 | x; T; filter; Ξ΅ β†’ verdict | filter∘T β‰ˆ T∘filter |
111
+ | `ace_safety_margin` | 0 0β†’0 | max_q,Ξ΅ β†’ real | \( (1-\varepsilon)-\max_q \) |
112
+ | `ace_tail_bound` | 0 0β†’0 | tail_norm,max_q β†’ real | \( \mathrm{tail}/(1-\max_q) \) or ∞ |
113
+ | `ace_certify` | 1 0β†’1 | StepInfo list, delta β†’ `AceCert` | margin β‰₯ delta |
114
+
115
+ ---
116
+
117
+ ## Coverage map (C++ β†’ J)
118
+
119
+ | C++ module | J surface |
120
+ |------------|-----------|
121
+ | `goldilocks.h/cpp` | `fp_*` verbs + `Fp` / `FpVec` |
122
+ | `pmat.h/cpp` | `pmat_*` + `Signature` / `PMat` |
123
+ | `spectral.h/cpp` | `gershgorin_*` / `power_*` / `spectral_analyze` |
124
+ | `recurrence.h/cpp` | `rec_*` / `synth_weights` / `soft_project` / `q_estimate` |
125
+ | `types.h` constants | constant nouns + `tier_eps` |
126
+ | `gate.h/cpp` (math) | `emit_apply` / `csl_*` |
127
+ | `certify.h/cpp` | `ace_*` |
128
+
129
+ Non-math orchestration (SHA-256 WORM bytes, linker PIRTM, audit JSON) is out of this pure-J math Core inventory except where PROPERTIES.md cites seal-chain / consensus narrative for completeness.
spec/LICENSE_NOTE.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ AGPL-3.0 preferred for pure-J recreation inventory under this directory.
2
+ Sources under /workspace/foundry-j do not ship a LICENSE file; this note records inventory policy only.
3
+ Alapeno (/workspace/alapeno) is out of scope.
spec/PROPERTIES.md ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Foundry F1 β€” Pure-J Recreation Property Inventory
2
+
3
+ Extracted from cpp-foundry sources under `/workspace/foundry-j/`.
4
+ Every claim below is required to hold in a pure-J recreation of the mathematical surface.
5
+ Citations are `file:line` or README section. **No invented numeric constants.**
6
+
7
+ Preferred license for derivative pure-J work: **AGPL-3.0** (sources do not ship a LICENSE file; this preference is inventory policy only).
8
+
9
+ ---
10
+
11
+ ## A. Goldilocks prime and field carrier
12
+
13
+ 1. **Goldilocks prime (decimal).**
14
+ \( p = 2^{64} - 2^{32} + 1 = 18446744069414584321 \).
15
+ Cite: README.md Β§ "Goldilocks Field F_p" (lines 209–210).
16
+
17
+ 2. **Goldilocks prime (hex / named constant).**
18
+ `GOLDILOCKS_PRIME = 0xFFFFFFFF00000001ULL`, meaning \( 2^{64} - 2^{32} + 1 \).
19
+ Cite: `include/types.h:17`; README.md Β§ "Key Constants" (line 315); `include/goldilocks.h:2,12`.
20
+
21
+ 3. **Field elements are u64 reduced mod p.**
22
+ Carrier is unsigned 64-bit values always reduced modulo \( p \).
23
+ Cite: README.md Β§ "Goldilocks Field F_p" (line 212); `include/goldilocks.h:14–18`.
24
+
25
+ 4. **Elem construction reduces.**
26
+ `Elem(x)` stores `reduce(x)`.
27
+ Cite: `include/goldilocks.h:18`.
28
+
29
+ ---
30
+
31
+ ## B. Reduction identity and mulmod
32
+
33
+ 5. **Congruence \( 2^{64} \equiv 2^{32} - 1 \pmod{p} \).**
34
+ Cite: README.md Β§ "Goldilocks Field F_p" (line 214); `src/goldilocks.cpp:23`.
35
+
36
+ 6. **Fold constant EPSILON.**
37
+ README names `EPSILON = 0xFFFFFFFF` as \( 2^{32} - 1 \) (Goldilocks fold constant). Implementation uses the same literal as `eps` / `hi_lo` mask.
38
+ Cite: README.md Β§ "Key Constants" (line 320); `src/goldilocks.cpp:27,31`.
39
+
40
+ 7. **128-bit product split.**
41
+ For \( a \cdot b \), form `__uint128_t product`, then `lo = product`, `hi = product >> 64`.
42
+ Cite: README.md (line 213); `src/goldilocks.cpp:20–25`.
43
+
44
+ 8. **hi split into 32-bit halves.**
45
+ `hi_lo = hi & 0xFFFFFFFF`, `hi_hi = hi >> 32`.
46
+ Cite: `src/goldilocks.cpp:27–28`.
47
+
48
+ 9. **Reduction identity (fold).**
49
+ \( x \equiv \mathrm{lo} + \mathrm{hi\_lo}\cdot(2^{32}-1) - \mathrm{hi\_hi} \pmod{p} \).
50
+ Cite: README.md Β§ "Goldilocks Field F_p" (line 216); implemented as `folded = lo + hi_lo * eps` then subtract `hi_hi` with underflow handling (`src/goldilocks.cpp:30–41`).
51
+
52
+ 10. **Underflow handling on fold.**
53
+ If `folded >= hi_hi` then `reduced = folded - hi_hi`, else `reduced = folded + P - hi_hi`.
54
+ Cite: `src/goldilocks.cpp:36–41`.
55
+
56
+ 11. **Final conditional reduction after fold.**
57
+ If `reduced >= P` then `reduced -= P`; result is `uint64_t`.
58
+ Cite: `src/goldilocks.cpp:43–48`.
59
+
60
+ 12. **Single-limb reduce.**
61
+ For \( x < 2^{64} \): `reduce(x) = (x >= P) ? x - P : x`.
62
+ Cite: `src/goldilocks.cpp:12–16`; `include/goldilocks.h:35`.
63
+
64
+ ---
65
+
66
+ ## C. Field operations
67
+
68
+ 13. **Addition mod p.**
69
+ \( r = a.v + b.v \); if \( r \ge P \) then \( r -= P \). Result is in \( \mathbb{F}_p \).
70
+ Cite: `src/goldilocks.cpp:51–55`; asserted `100+200=300` in `src/test.cpp:33–39`.
71
+
72
+ 14. **Subtraction mod p.**
73
+ Unsigned difference with conditional add of \( P \) on underflow (mask from high bit).
74
+ Cite: `src/goldilocks.cpp:57–62`; asserted `100-50=50` in `src/test.cpp:60–66`.
75
+
76
+ 15. **Multiplication via mulmod.**
77
+ `mul(a,b) = Elem(mulmod(a.v, b.v))`.
78
+ Cite: `src/goldilocks.cpp:64–66`; asserted `7*6=42` in `src/test.cpp:42–48`.
79
+
80
+ 16. **Fermat inverse.**
81
+ \( a^{-1} = a^{p-2} \pmod{p} \) via `inv(a) = pow(a, P-2)`.
82
+ Cite: `include/goldilocks.h:27`; `src/goldilocks.cpp:68–70`; README test legend (line 403); asserted `a * inv(a) = 1` for `a=42` in `src/test.cpp:51–57`.
83
+
84
+ 17. **Binary exponentiation.**
85
+ `pow(a,e)`: square-and-multiply from `result=1`, `base=a`.
86
+ Cite: `src/goldilocks.cpp:73–81`; `include/goldilocks.h:28`.
87
+
88
+ 18. **Batch add/mul.**
89
+ Elementwise `add` / `mul` over length-`n` arrays.
90
+ Cite: `include/goldilocks.h:31–32`; `src/goldilocks.cpp:84–96`.
91
+
92
+ ---
93
+
94
+ ## D. Named constants (non-field)
95
+
96
+ 19. **K_MAX.**
97
+ `K_MAX = 133144` (README: max W8A8 accumulation).
98
+ Cite: `include/types.h:18`; README.md Β§ "Key Constants" (line 316).
99
+
100
+ 20. **MAX_DRIFT.**
101
+ `MAX_DRIFT = 300000000000000000ULL` (README: \( 3\times 10^{17} \), β€œ0.3Ξ drift bound” / β€œ0.3Ξ in wei”).
102
+ Cite: `include/types.h:19`; README.md Β§ "Key Constants" (line 317).
103
+
104
+ 21. **PIRTM_MAGIC.**
105
+ `PIRTM_MAGIC = 0x7F504952` (README: `\x7FPIR` bytecode magic).
106
+ Cite: `include/types.h:20`; README.md Β§ "Key Constants" (line 318); linker test bytes `src/test.cpp:371–372`.
107
+
108
+ 22. **PHI.**
109
+ `PHI = 1.618033988749895`.
110
+ Cite: `include/types.h:21`. (Sources do not state further mathematical use in the UAC/recurrence core.)
111
+
112
+ 23. **P_64 β€” first 64 primes.**
113
+ Array of length 64:
114
+ `2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311`.
115
+ Cite: `include/types.h:24–30`; README.md Β§ "Key Constants" (line 319).
116
+
117
+ 24. **GENESIS_HASH_SIZE.**
118
+ `GENESIS_HASH_SIZE = 32`.
119
+ Cite: `include/types.h:22`.
120
+
121
+ 25. **Tier epsilons (contraction margins).**
122
+ T1β†’0.10, T2β†’0.05, T3β†’0.02, T4β†’0.01; default fallback 0.10.
123
+ Cite: `include/types.h:34–48`.
124
+
125
+ ---
126
+
127
+ ## E. PMAT / prime monomial facts
128
+
129
+ 26. **PMat entry shape.**
130
+ Sparse entry is `(sign, monomial, row, col)` with `sign ∈ {±1}` and `Signature = (delta_source, delta_target)`.
131
+ Cite: `include/pmat.h:10–15`; `include/types.h:103–112`.
132
+
133
+ 27. **Insert domain checks.**
134
+ Insert fails if `row β‰₯ rows` or `col β‰₯ cols`, or if `sign βˆ‰ {1,-1}`; else appends entry.
135
+ Cite: `src/pmat.cpp:11–16`; asserted in `src/test.cpp:71–77`.
136
+
137
+ 28. **Grading condition (stated).**
138
+ Header/README narrative: grading condition `tgt_sig - src_sig = monomial` is enforced on insertion / validated globally.
139
+ Cite: `include/pmat.h:3,21–25`.
140
+ **Gap note:** `insert` does not compare signatures to row/col grades; `validate_grading` always returns `true` (`src/pmat.cpp:19–22`). J must decide whether to enforce the stated condition or mirror the current C++ stub.
141
+
142
+ 29. **Conservation theorem.**
143
+ Product (componentwise sum) of all entry monomials equals accumulated `(Ξ£ delta_source, Ξ£ delta_target)`.
144
+ Cite: `include/pmat.h:27–28`; `src/pmat.cpp:25–33`; asserted sums `(6,8)` for monomials `{3,5}+{1,2}+{2,1}` in `src/test.cpp:80–89`.
145
+
146
+ 30. **Composition preserves grading (stated).**
147
+ Compose multiplies signs and accumulates monomials along matching mid-indices; result size `(rows_, other.cols_)`.
148
+ Cite: `include/pmat.h:30–31`; `src/pmat.cpp:36–66`.
149
+
150
+ 31. **Compose monomial accumulation rule (as coded).**
151
+ On matching `a.col == b.row`: `sign_acc *= a.sign * b.sign`; `monom_acc.delta_source += a.monomial.delta_source`; `monom_acc.delta_target += b.monomial.delta_target`.
152
+ Cite: `src/pmat.cpp:51–55`.
153
+
154
+ 32. **Frobenius norm of PMat.**
155
+ Each entry has magnitude 1; \( \|M\|_F = \sqrt{\#\mathrm{entries}} \).
156
+ Cite: `include/pmat.h:33–34`; `src/pmat.cpp:69–74`.
157
+
158
+ ---
159
+
160
+ ## F. Spectral governor (Gershgorin / contractive)
161
+
162
+ 33. **Gershgorin disk bound.**
163
+ For each row \( i \): radius \( = \sum_{j\neq i}|J_{ij}| \); disk max \( = |J_{ii}| + \mathrm{radius} \); bound = max over rows.
164
+ Cite: `src/spectral.cpp:10–24`; `include/spectral.h:36–37`.
165
+
166
+ 34. **Contractive test (Gershgorin).**
167
+ `contractive ⟺ bound < (1.0 - epsilon)`.
168
+ Cite: `src/spectral.cpp:27–36`; `include/spectral.h:17–18`.
169
+
170
+ 35. **Power iteration (Rayleigh).**
171
+ Iterate \( v \leftarrow Jv/\|Jv\| \); eigenvalue β‰ˆ \( v^\top Jv \); return absolute value; default tolerance `1e-12`, default `max_iters=100`.
172
+ Cite: `include/spectral.h:29–30,40–41`; `src/spectral.cpp:39–86`.
173
+
174
+ 36. **Contractive test (power iteration).**
175
+ Same predicate: dominant eigenvalue modulus \( < 1 - \epsilon \).
176
+ Cite: `src/spectral.cpp:88–98`.
177
+
178
+ 37. **Analyze fallback policy.**
179
+ Try Gershgorin first; if contractive but `gershgorin_bound > (1-epsilon)*0.95`, recheck with power iteration.
180
+ Cite: `src/spectral.cpp:101–111`; `include/spectral.h:32–34`.
181
+
182
+ 38. **Tested contractive / expansive examples.**
183
+ \( J=\begin{bmatrix}0.2&0.1\\0.05&0.15\end{bmatrix} \) with \( \epsilon=0.1 \) is contractive;
184
+ \( J=\begin{bmatrix}0.9&0.3\\0.3&0.95\end{bmatrix} \) with \( \epsilon=0.1 \) is not.
185
+ Cite: `src/test.cpp:94–113`.
186
+
187
+ ---
188
+
189
+ ## G. Banach recurrence
190
+
191
+ 39. **Recurrence equation.**
192
+ \( x_{t+1} = \Xi_t \cdot x_t + \Lambda_t \cdot T(x_t) + g_t \).
193
+ Cite: README.md Β§ "Banach Contraction Mapping" (lines 226–232); `include/recurrence.h:3`; `src/recurrence.cpp:105–110`.
194
+
195
+ 40. **Contraction condition.**
196
+ \( q_t = \|\Xi_t\| + \|\Lambda_t\| \cdot \|T\| < 1 - \varepsilon \).
197
+ Cite: README.md (lines 234–235, 280); `include/recurrence.h:4`; `include/types.h:119`.
198
+
199
+ 41. **Unique fixed-point guarantee (narrative).**
200
+ Strict Banach contraction β‡’ convergence to unique fixed point; spectral governor verifies a priori.
201
+ Cite: README.md Β§ "The Core Guarantee" (lines 282–284).
202
+
203
+ 42. **q estimate in step (as coded).**
204
+ \( n_\Xi, n_\Lambda \) = max-abs of schedule vectors (length 2); \( n_T \) = max-abs of \( T(x) \) scaled by max-abs of \( x \) when \( \|x\|_\infty > 10^{-15} \); \( q = n_\Xi + n_\Lambda \cdot n_T \).
205
+ Cite: `src/recurrence.cpp:66–87`.
206
+
207
+ 43. **Soft projection.**
208
+ If \( q > 1 - \mathrm{tier\_epsilon} \), scale Ξ and Ξ› by \( (1-\varepsilon)/q \).
209
+ Cite: `include/recurrence.h:60–63`; `src/recurrence.cpp:46–55,89–102`.
210
+
211
+ 44. **Weight budget split.**
212
+ `q_star = 1 - tier_epsilon(tier)`; `xi_val = q_star * factor * 0.7`; `lam_val = q_star * factor * 0.3`; Uniform/Harmonic/LogDecay factors as coded.
213
+ Cite: `src/recurrence.cpp:21–42`.
214
+
215
+ 45. **Projector.**
216
+ After affine update, apply `p_op` (example: clip to \([-1,1]\)).
217
+ Cite: `include/recurrence.h:15–16`; `src/recurrence.cpp:113–114`; test projector `src/test.cpp:133–135`.
218
+
219
+ 46. **Residual.**
220
+ \( \mathrm{residual} = \|x_{next} - x_t\|_2 \). Convergence when residual \( < \) `convergence_tol`.
221
+ Cite: `src/recurrence.cpp:116–122,159–161`; test tol `1e-6` in `src/test.cpp:125,139`.
222
+
223
+ 47. **WORM / seal chain invariant (system-level).**
224
+ \( \forall k>0:\ \mathrm{hash}(\mathrm{seal}_{k-1}) = \mathrm{seal}_k.\mathrm{prev\_hash} \) (README); Triple-Lock seals chain Guardian→Examiner→Publisher.
225
+ Cite: README.md Layer 8 (line 130), Quick Reference (line 525); `src/test.cpp:300–324`.
226
+
227
+ ---
228
+
229
+ ## H. Emission / CSL / certification math (adjacent to contraction)
230
+
231
+ 48. **Emission Suppress.**
232
+ If \( q \ge 1-\varepsilon \), emit zeros; else pass output.
233
+ Cite: `include/types.h:63`; `src/gate.cpp:21–25`; `src/test.cpp:145–150`.
234
+
235
+ 49. **Emission Attenuate scale.**
236
+ Scale by \( \max(0,\ 1-\varepsilon-q) \).
237
+ Cite: `include/types.h:65`; `src/gate.cpp:34–40`.
238
+
239
+ 50. **CSL neutrality.**
240
+ Pairwise: if \( |x_i-x_j|>10^{-15} \) and \( |T_i-T_j|/|x_i-x_j| > 1+\varepsilon \), fail neutrality.
241
+ Cite: `src/gate.cpp:50–62`; `include/gate.h:34–37`.
242
+
243
+ 51. **CSL beneficence.**
244
+ \( \|T(x)\|_2 \le (1+\varepsilon)\|x\|_2 \) and residual \( \le (1+\varepsilon)\|x\|_2 \).
245
+ Cite: `src/gate.cpp:65–86`; `include/gate.h:39–42`.
246
+
247
+ 52. **CSL commutation.**
248
+ \( \|\mathrm{filter}(T(x)) - T(\mathrm{filter}(x))\|_\infty \le \varepsilon \) (componentwise abs ≀ Ξ΅).
249
+ Cite: `src/gate.cpp:89–104`; `include/gate.h:44–48`.
250
+
251
+ 53. **AceCertificate safety margin.**
252
+ `safety_margin = (1 - epsilon) - max_q`; certified iff `margin >= delta`.
253
+ Cite: `include/types.h:133–136`; `src/certify.cpp:44–45,35`.
254
+
255
+ 54. **AceCertificate tail bound.**
256
+ If `max_q >= 1` then \( +\infty \); else `tail_norm / (1 - max_q)`.
257
+ Cite: `include/types.h:135`; `src/certify.cpp:48–50`.
258
+
259
+ 55. **Guardian spectral legality.**
260
+ Reject if `spectral_radius >= 1.0` or non-finite next state; reject status `"PROVISIONAL"`.
261
+ Cite: `src/gate.cpp:159–177`; `src/test.cpp:193–201,276–284`.
262
+
263
+ 56. **Consensus / false-positive bound (narrative).**
264
+ Every claim requires all Triple-Lock parties; \( P(\mathrm{false\ positive}) \le 2^{-256} \).
265
+ Cite: README.md Triple-Lock (lines 272–273), Implications (line 451).
266
+
267
+ ---
268
+
269
+ ## Gaps (sources silent β€” do not invent)
270
+
271
+ - **Named C++ identifier `EPSILON`:** named only in README Key Constants; code uses literal `0xFFFFFFFFULL` in mulmod, not a `types.h` symbol.
272
+ - **`BARRITT_MU`:** defined equal to `P` and unused (`src/goldilocks.cpp:9–10`); no Barrett algorithm steps beyond the comment.
273
+ - **PMat per-entry grading vs indices:** stated in `pmat.h:3` but not checked in `insert` / `validate_grading`.
274
+ - **Compose monomial rule vs β€œsum of both signatures”:** coded as `a.delta_source` + `b.delta_target` only (`src/pmat.cpp:54–55`), not full addition of both signatures from both factors.
275
+ - **PHI usage** in UAC/recurrence math: constant present; no consuming identity in the cited math cpp files.
276
+ - **Alapeno:** out of scope; left untouched (`/workspace/alapeno`).
277
+
278
+ ---
279
+
280
+ ## Count
281
+
282
+ **Numbered properties: 56**
verify/INVENTORY.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry J contributors
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
5
+
6
+ # Foundry J Verify β€” Test Inventory
7
+
8
+ Sources: `src/test.cpp`, `spec/PROPERTIES.md`, Core `j/foundry.ijs`.
9
+ Detail map: `PROPERTY_MAP.md` (all 56 properties).
10
+
11
+ ## Named mathematical tests (baseline)
12
+
13
+ | # | Test | Family | Property # | Core verbs | Measured |
14
+ |---|------|--------|------------|------------|----------|
15
+ | 1 | `goldilocks_add` | goldilocks | **13** | `fp_add` | PASS |
16
+ | 2 | `goldilocks_mul` | goldilocks | **15** | `fp_mul` | PASS |
17
+ | 3 | `goldilocks_inv` | goldilocks | **16** | `fp_inv`/`fp_mul` | PASS |
18
+ | 4 | `goldilocks_sub` | goldilocks | **14** | `fp_sub` | PASS |
19
+ | 5 | `pmat_insert` | pmat | **27** | `pmat_new`/`pmat_insert`/`pmat_entries` | PASS |
20
+ | 6 | `pmat_conservation` | pmat | **29** | `pmat_conservation` | PASS |
21
+ | 7 | `spectral_contractive` | spectral | **38** | `spectral_analyze` | PASS |
22
+ | 8 | `spectral_expansive` | spectral | **38** | `spectral_analyze` | PASS |
23
+ | 9 | `recurrence_converges` | recurrence | **46** | `rec_run`/`synth_weights` | PASS |
24
+
25
+ **Named count: 9** Β· Latest: **9 PASS / 0 FAIL** (`logs/run-20261007-075943.log`)
26
+
27
+ ## Property coverage files
28
+
29
+ | File | Props |
30
+ |------|-------|
31
+ | `tests/goldilocks.ijs` | 1–18 (+ named) |
32
+ | `tests/constants.ijs` | 19–25 |
33
+ | `tests/pmat.ijs` | 26–32 (+ named) |
34
+ | `tests/spectral.ijs` | 33–38 (+ named) |
35
+ | `tests/recurrence.ijs` | 39–46 (+ named; 41 SKIP) |
36
+ | `tests/emit_csl_ace.ijs` | 47–56 (47/55/56 SKIP; 49–50 FAIL) |
37
+
38
+ ### Load convention
39
+
40
+ ```
41
+ load '../j/foundry.ijs'
42
+ foundry_export '' NB. copies J_API names into base
43
+ ```
44
+
45
+ ## Out of scope / SKIP
46
+
47
+ - **41** narrative Banach unique fixed-point
48
+ - **47** WORM/seal / triple-lock theater
49
+ - **55** guardian (no Core verb)
50
+ - **56** consensus narrative
51
+
52
+ ## Known Core FAILs (honest)
53
+
54
+ - **49** attenuate scale (J RTL vs Spec)
55
+ - **50** `csl_neutrality` index error (J RTL loop bound)
verify/LICENSE ADDED
@@ -0,0 +1,661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
13
+
14
+ The licenses for most software and other practical works are designed
15
+ to take away your freedom to share and change the works. By contrast,
16
+ our General Public Licenses are intended to guarantee your freedom to
17
+ share and change all versions of a program--to make sure it remains free
18
+ software for all its users.
19
+
20
+ When we speak of free software, we are referring to freedom, not
21
+ price. Our General Public Licenses are designed to make sure that you
22
+ have the freedom to distribute copies of free software (and charge for
23
+ them if you wish), that you receive source code or can get it if you
24
+ want it, that you can change the software or use pieces of it in new
25
+ free programs, and that you know you can do these things.
26
+
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ TERMS AND CONDITIONS
60
+
61
+ 0. Definitions.
62
+
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
64
+
65
+ "Copyright" also means copyright-like laws that apply to other kinds of
66
+ works, such as semiconductor masks.
67
+
68
+ "The Program" refers to any copyrightable work licensed under this
69
+ License. Each licensee is addressed as "you". "Licensees" and
70
+ "recipients" may be individuals or organizations.
71
+
72
+ To "modify" a work means to copy from or adapt all or part of the work
73
+ in a fashion requiring copyright permission, other than the making of an
74
+ exact copy. The resulting work is called a "modified version" of the
75
+ earlier work or a work "based on" the earlier work.
76
+
77
+ A "covered work" means either the unmodified Program or a work based
78
+ on the Program.
79
+
80
+ To "propagate" a work means to do anything with it that, without
81
+ permission, would make you directly or secondarily liable for
82
+ infringement under applicable copyright law, except executing it on a
83
+ computer or modifying a private copy. Propagation includes copying,
84
+ distribution (with or without modification), making available to the
85
+ public, and in some countries other activities as well.
86
+
87
+ To "convey" a work means any kind of propagation that enables other
88
+ parties to make or receive copies. Mere interaction with a user through
89
+ a computer network, with no transfer of a copy, is not conveying.
90
+
91
+ An interactive user interface displays "Appropriate Legal Notices"
92
+ to the extent that it includes a convenient and prominently visible
93
+ feature that (1) displays an appropriate copyright notice, and (2)
94
+ tells the user that there is no warranty for the work (except to the
95
+ extent that warranties are provided), that licensees may convey the
96
+ work under this License, and how to view a copy of this License. If
97
+ the interface presents a list of user commands or options, such as a
98
+ menu, a prominent item in the list meets this criterion.
99
+
100
+ 1. Source Code.
101
+
102
+ The "source code" for a work means the preferred form of the work
103
+ for making modifications to it. "Object code" means any non-source
104
+ form of a work.
105
+
106
+ A "Standard Interface" means an interface that either is an official
107
+ standard defined by a recognized standards body, or, in the case of
108
+ interfaces specified for a particular programming language, one that
109
+ is widely used among developers working in that language.
110
+
111
+ The "System Libraries" of an executable work include anything, other
112
+ than the work as a whole, that (a) is included in the normal form of
113
+ packaging a Major Component, but which is not part of that Major
114
+ Component, and (b) serves only to enable use of the work with that
115
+ Major Component, or to implement a Standard Interface for which an
116
+ implementation is available to the public in source code form. A
117
+ "Major Component", in this context, means a major essential component
118
+ (kernel, window system, and so on) of the specific operating system
119
+ (if any) on which the executable work runs, or a compiler used to
120
+ produce the work, or an object code interpreter used to run it.
121
+
122
+ The "Corresponding Source" for a work in object code form means all
123
+ the source code needed to generate, install, and (for an executable
124
+ work) run the object code and to modify the work, including scripts to
125
+ control those activities. However, it does not include the work's
126
+ System Libraries, or general-purpose tools or generally available free
127
+ programs which are used unmodified in performing those activities but
128
+ which are not part of the work. For example, Corresponding Source
129
+ includes interface definition files associated with source files for
130
+ the work, and the source code for shared libraries and dynamically
131
+ linked subprograms that the work is specifically designed to require,
132
+ such as by intimate data communication or control flow between those
133
+ subprograms and other parts of the work.
134
+
135
+ The Corresponding Source need not include anything that users
136
+ can regenerate automatically from other parts of the Corresponding
137
+ Source.
138
+
139
+ The Corresponding Source for a work in source code form is that
140
+ same work.
141
+
142
+ 2. Basic Permissions.
143
+
144
+ All rights granted under this License are granted for the term of
145
+ copyright on the Program, and are irrevocable provided the stated
146
+ conditions are met. This License explicitly affirms your unlimited
147
+ permission to run the unmodified Program. The output from running a
148
+ covered work is covered by this License only if the output, given its
149
+ content, constitutes a covered work. This License acknowledges your
150
+ rights of fair use or other equivalent, as provided by copyright law.
151
+
152
+ You may make, run and propagate covered works that you do not
153
+ convey, without conditions so long as your license otherwise remains
154
+ in force. You may convey covered works to others for the sole purpose
155
+ of having them make modifications exclusively for you, or provide you
156
+ with facilities for running those works, provided that you comply with
157
+ the terms of this License in conveying all material for which you do
158
+ not control copyright. Those thus making or running the covered works
159
+ for you must do so exclusively on your behalf, under your direction
160
+ and control, on terms that prohibit them from making any copies of
161
+ your copyrighted material outside their relationship with you.
162
+
163
+ Conveying under any other circumstances is permitted solely under
164
+ the conditions stated below. Sublicensing is not allowed; section 10
165
+ makes it unnecessary.
166
+
167
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
+
169
+ No covered work shall be deemed part of an effective technological
170
+ measure under any applicable law fulfilling obligations under article
171
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
+ similar laws prohibiting or restricting circumvention of such
173
+ measures.
174
+
175
+ When you convey a covered work, you waive any legal power to forbid
176
+ circumvention of technological measures to the extent such circumvention
177
+ is effected by exercising rights under this License with respect to
178
+ the covered work, and you disclaim any intention to limit operation or
179
+ modification of the work as a means of enforcing, against the work's
180
+ users, your or third parties' legal rights to forbid circumvention of
181
+ technological measures.
182
+
183
+ 4. Conveying Verbatim Copies.
184
+
185
+ You may convey verbatim copies of the Program's source code as you
186
+ receive it, in any medium, provided that you conspicuously and
187
+ appropriately publish on each copy an appropriate copyright notice;
188
+ keep intact all notices stating that this License and any
189
+ non-permissive terms added in accord with section 7 apply to the code;
190
+ keep intact all notices of the absence of any warranty; and give all
191
+ recipients a copy of this License along with the Program.
192
+
193
+ You may charge any price or no price for each copy that you convey,
194
+ and you may offer support or warranty protection for a fee.
195
+
196
+ 5. Conveying Modified Source Versions.
197
+
198
+ You may convey a work based on the Program, or the modifications to
199
+ produce it from the Program, in the form of source code under the
200
+ terms of section 4, provided that you also meet all of these conditions:
201
+
202
+ a) The work must carry prominent notices stating that you modified
203
+ it, and giving a relevant date.
204
+
205
+ b) The work must carry prominent notices stating that it is
206
+ released under this License and any conditions added under section
207
+ 7. This requirement modifies the requirement in section 4 to
208
+ "keep intact all notices".
209
+
210
+ c) You must license the entire work, as a whole, under this
211
+ License to anyone who comes into possession of a copy. This
212
+ License will therefore apply, along with any applicable section 7
213
+ additional terms, to the whole of the work, and all its parts,
214
+ regardless of how they are packaged. This License gives no
215
+ permission to license the work in any other way, but it does not
216
+ invalidate such permission if you have separately received it.
217
+
218
+ d) If the work has interactive user interfaces, each must display
219
+ Appropriate Legal Notices; however, if the Program has interactive
220
+ interfaces that do not display Appropriate Legal Notices, your
221
+ work need not make them do so.
222
+
223
+ A compilation of a covered work with other separate and independent
224
+ works, which are not by their nature extensions of the covered work,
225
+ and which are not combined with it such as to form a larger program,
226
+ in or on a volume of a storage or distribution medium, is called an
227
+ "aggregate" if the compilation and its resulting copyright are not
228
+ used to limit the access or legal rights of the compilation's users
229
+ beyond what the individual works permit. Inclusion of a covered work
230
+ in an aggregate does not cause this License to apply to the other
231
+ parts of the aggregate.
232
+
233
+ 6. Conveying Non-Source Forms.
234
+
235
+ You may convey a covered work in object code form under the terms
236
+ of sections 4 and 5, provided that you also convey the
237
+ machine-readable Corresponding Source under the terms of this License,
238
+ in one of these ways:
239
+
240
+ a) Convey the object code in, or embodied in, a physical product
241
+ (including a physical distribution medium), accompanied by the
242
+ Corresponding Source fixed on a durable physical medium
243
+ customarily used for software interchange.
244
+
245
+ b) Convey the object code in, or embodied in, a physical product
246
+ (including a physical distribution medium), accompanied by a
247
+ written offer, valid for at least three years and valid for as
248
+ long as you offer spare parts or customer support for that product
249
+ model, to give anyone who possesses the object code either (1) a
250
+ copy of the Corresponding Source for all the software in the
251
+ product that is covered by this License, on a durable physical
252
+ medium customarily used for software interchange, for a price no
253
+ more than your reasonable cost of physically performing this
254
+ conveying of source, or (2) access to copy the
255
+ Corresponding Source from a network server at no charge.
256
+
257
+ c) Convey individual copies of the object code with a copy of the
258
+ written offer to provide the Corresponding Source. This
259
+ alternative is allowed only occasionally and noncommercially, and
260
+ only if you received the object code with such an offer, in accord
261
+ with subsection 6b.
262
+
263
+ d) Convey the object code by offering access from a designated
264
+ place (gratis or for a charge), and offer equivalent access to the
265
+ Corresponding Source in the same way through the same place at no
266
+ further charge. You need not require recipients to copy the
267
+ Corresponding Source along with the object code. If the place to
268
+ copy the object code is a network server, the Corresponding Source
269
+ may be on a different server (operated by you or a third party)
270
+ that supports equivalent copying facilities, provided you maintain
271
+ clear directions next to the object code saying where to find the
272
+ Corresponding Source. Regardless of what server hosts the
273
+ Corresponding Source, you remain obligated to ensure that it is
274
+ available for as long as needed to satisfy these requirements.
275
+
276
+ e) Convey the object code using peer-to-peer transmission, provided
277
+ you inform other peers where the object code and Corresponding
278
+ Source of the work are being offered to the general public at no
279
+ charge under subsection 6d.
280
+
281
+ A separable portion of the object code, whose source code is excluded
282
+ from the Corresponding Source as a System Library, need not be
283
+ included in conveying the object code work.
284
+
285
+ A "User Product" is either (1) a "consumer product", which means any
286
+ tangible personal property which is normally used for personal, family,
287
+ or household purposes, or (2) anything designed or sold for incorporation
288
+ into a dwelling. In determining whether a product is a consumer product,
289
+ doubtful cases shall be resolved in favor of coverage. For a particular
290
+ product received by a particular user, "normally used" refers to a
291
+ typical or common use of that class of product, regardless of the status
292
+ of the particular user or of the way in which the particular user
293
+ actually uses, or expects or is expected to use, the product. A product
294
+ is a consumer product regardless of whether the product has substantial
295
+ commercial, industrial or non-consumer uses, unless such uses represent
296
+ the only significant mode of use of the product.
297
+
298
+ "Installation Information" for a User Product means any methods,
299
+ procedures, authorization keys, or other information required to install
300
+ and execute modified versions of a covered work in that User Product from
301
+ a modified version of its Corresponding Source. The information must
302
+ suffice to ensure that the continued functioning of the modified object
303
+ code is in no case prevented or interfered with solely because
304
+ modification has been made.
305
+
306
+ If you convey an object code work under this section in, or with, or
307
+ specifically for use in, a User Product, and the conveying occurs as
308
+ part of a transaction in which the right of possession and use of the
309
+ User Product is transferred to the recipient in perpetuity or for a
310
+ fixed term (regardless of how the transaction is characterized), the
311
+ Corresponding Source conveyed under this section must be accompanied
312
+ by the Installation Information. But this requirement does not apply
313
+ if neither you nor any third party retains the ability to install
314
+ modified object code on the User Product (for example, the work has
315
+ been installed in ROM).
316
+
317
+ The requirement to provide Installation Information does not include a
318
+ requirement to continue to provide support service, warranty, or updates
319
+ for a work that has been modified or installed by the recipient, or for
320
+ the User Product in which it has been modified or installed. Access to a
321
+ network may be denied when the modification itself materially and
322
+ adversely affects the operation of the network or violates the rules and
323
+ protocols for communication across the network.
324
+
325
+ Corresponding Source conveyed, and Installation Information provided,
326
+ in accord with this section must be in a format that is publicly
327
+ documented (and with an implementation available to the public in
328
+ source code form), and must require no special password or key for
329
+ unpacking, reading or copying.
330
+
331
+ 7. Additional Terms.
332
+
333
+ "Additional permissions" are terms that supplement the terms of this
334
+ License by making exceptions from one or more of its conditions.
335
+ Additional permissions that are applicable to the entire Program shall
336
+ be treated as though they were included in this License, to the extent
337
+ that they are valid under applicable law. If additional permissions
338
+ apply only to part of the Program, that part may be used separately
339
+ under those permissions, but the entire Program remains governed by
340
+ this License without regard to the additional permissions.
341
+
342
+ When you convey a copy of a covered work, you may at your option
343
+ remove any additional permissions from that copy, or from any part of
344
+ it. (Additional permissions may be written to require their own
345
+ removal in certain cases when you modify the work.) You may place
346
+ additional permissions on material, added by you to a covered work,
347
+ for which you have or can give appropriate copyright permission.
348
+
349
+ Notwithstanding any other provision of this License, for material you
350
+ add to a covered work, you may (if authorized by the copyright holders of
351
+ that material) supplement the terms of this License with terms:
352
+
353
+ a) Disclaiming warranty or limiting liability differently from the
354
+ terms of sections 15 and 16 of this License; or
355
+
356
+ b) Requiring preservation of specified reasonable legal notices or
357
+ author attributions in that material or in the Appropriate Legal
358
+ Notices displayed by works containing it; or
359
+
360
+ c) Prohibiting misrepresentation of the origin of that material, or
361
+ requiring that modified versions of such material be marked in
362
+ reasonable ways as different from the original version; or
363
+
364
+ d) Limiting the use for publicity purposes of names of licensors or
365
+ authors of the material; or
366
+
367
+ e) Declining to grant rights under trademark law for use of some
368
+ trade names, trademarks, or service marks; or
369
+
370
+ f) Requiring indemnification of licensors and authors of that
371
+ material by anyone who conveys the material (or modified versions of
372
+ it) with contractual assumptions of liability to the recipient, for
373
+ any liability that these contractual assumptions directly impose on
374
+ those licensors and authors.
375
+
376
+ All other non-permissive additional terms are considered "further
377
+ restrictions" within the meaning of section 10. If the Program as you
378
+ received it, or any part of it, contains a notice stating that it is
379
+ governed by this License along with a term that is a further
380
+ restriction, you may remove that term. If a license document contains
381
+ a further restriction but permits relicensing or conveying under this
382
+ License, you may add to a covered work material governed by the terms
383
+ of that license document, provided that the further restriction does
384
+ not survive such relicensing or conveying.
385
+
386
+ If you add terms to a covered work in accord with this section, you
387
+ must place, in the relevant source files, a statement of the
388
+ additional terms that apply to those files, or a notice indicating
389
+ where to find the applicable terms.
390
+
391
+ Additional terms, permissive or non-permissive, may be stated in the
392
+ form of a separately written license, or stated as exceptions;
393
+ the above requirements apply either way.
394
+
395
+ 8. Termination.
396
+
397
+ You may not propagate or modify a covered work except as expressly
398
+ provided under this License. Any attempt otherwise to propagate or
399
+ modify it is void, and will automatically terminate your rights under
400
+ this License (including any patent licenses granted under the third
401
+ paragraph of section 11).
402
+
403
+ However, if you cease all violation of this License, then your
404
+ license from a particular copyright holder is reinstated (a)
405
+ provisionally, unless and until the copyright holder explicitly and
406
+ finally terminates your license, and (b) permanently, if the copyright
407
+ holder fails to notify you of the violation by some reasonable means
408
+ prior to 60 days after the cessation.
409
+
410
+ Moreover, your license from a particular copyright holder is
411
+ reinstated permanently if the copyright holder notifies you of the
412
+ violation by some reasonable means, this is the first time you have
413
+ received notice of violation of this License (for any work) from that
414
+ copyright holder, and you cure the violation prior to 30 days after
415
+ your receipt of the notice.
416
+
417
+ Termination of your rights under this section does not terminate the
418
+ licenses of parties who have received copies or rights from you under
419
+ this License. If your rights have been terminated and not permanently
420
+ reinstated, you do not qualify to receive new licenses for the same
421
+ material under section 10.
422
+
423
+ 9. Acceptance Not Required for Having Copies.
424
+
425
+ You are not required to accept this License in order to receive or
426
+ run a copy of the Program. Ancillary propagation of a covered work
427
+ occurring solely as a consequence of using peer-to-peer transmission
428
+ to receive a copy likewise does not require acceptance. However,
429
+ nothing other than this License grants you permission to propagate or
430
+ modify any covered work. These actions infringe copyright if you do
431
+ not accept this License. Therefore, by modifying or propagating a
432
+ covered work, you indicate your acceptance of this License to do so.
433
+
434
+ 10. Automatic Licensing of Downstream Recipients.
435
+
436
+ Each time you convey a covered work, the recipient automatically
437
+ receives a license from the original licensors, to run, modify and
438
+ propagate that work, subject to this License. You are not responsible
439
+ for enforcing compliance by third parties with this License.
440
+
441
+ An "entity transaction" is a transaction transferring control of an
442
+ organization, or substantially all assets of one, or subdividing an
443
+ organization, or merging organizations. If propagation of a covered
444
+ work results from an entity transaction, each party to that
445
+ transaction who receives a copy of the work also receives whatever
446
+ licenses to the work the party's predecessor in interest had or could
447
+ give under the previous paragraph, plus a right to possession of the
448
+ Corresponding Source of the work from the predecessor in interest, if
449
+ the predecessor has it or can get it with reasonable efforts.
450
+
451
+ You may not impose any further restrictions on the exercise of the
452
+ rights granted or affirmed under this License. For example, you may
453
+ not impose a license fee, royalty, or other charge for exercise of
454
+ rights granted under this License, and you may not initiate litigation
455
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
456
+ any patent claim is infringed by making, using, selling, offering for
457
+ sale, or importing the Program or any portion of it.
458
+
459
+ 11. Patents.
460
+
461
+ A "contributor" is a copyright holder who authorizes use under this
462
+ License of the Program or a work on which the Program is based. The
463
+ work thus licensed is called the contributor's "contributor version".
464
+
465
+ A contributor's "essential patent claims" are all patent claims
466
+ owned or controlled by the contributor, whether already acquired or
467
+ hereafter acquired, that would be infringed by some manner, permitted
468
+ by this License, of making, using, or selling its contributor version,
469
+ but do not include claims that would be infringed only as a
470
+ consequence of further modification of the contributor version. For
471
+ purposes of this definition, "control" includes the right to grant
472
+ patent sublicenses in a manner consistent with the requirements of
473
+ this License.
474
+
475
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
476
+ patent license under the contributor's essential patent claims, to
477
+ make, use, sell, offer for sale, import and otherwise run, modify and
478
+ propagate the contents of its contributor version.
479
+
480
+ In the following three paragraphs, a "patent license" is any express
481
+ agreement or commitment, however denominated, not to enforce a patent
482
+ (such as an express permission to practice a patent or covenant not to
483
+ sue for patent infringement). To "grant" such a patent license to a
484
+ party means to make such an agreement or commitment not to enforce a
485
+ patent against the party.
486
+
487
+ If you convey a covered work, knowingly relying on a patent license,
488
+ and the Corresponding Source of the work is not available for anyone
489
+ to copy, free of charge and under the terms of this License, through a
490
+ publicly available network server or other readily accessible means,
491
+ then you must either (1) cause the Corresponding Source to be so
492
+ available, or (2) arrange to deprive yourself of the benefit of the
493
+ patent license for this particular work, or (3) arrange, in a manner
494
+ consistent with the requirements of this License, to extend the patent
495
+ license to downstream recipients. "Knowingly relying" means you have
496
+ actual knowledge that, but for the patent license, your conveying the
497
+ covered work in a country, or your recipient's use of the covered work
498
+ in a country, would infringe one or more identifiable patents in that
499
+ country that you have reason to believe are valid.
500
+
501
+ If, pursuant to or in connection with a single transaction or
502
+ arrangement, you convey, or propagate by procuring conveyance of, a
503
+ covered work, and grant a patent license to some of the parties
504
+ receiving the covered work authorizing them to use, propagate, modify
505
+ or convey a specific copy of the covered work, then the patent license
506
+ you grant is automatically extended to all recipients of the covered
507
+ work and works based on it.
508
+
509
+ A patent license is "discriminatory" if it does not include within
510
+ the scope of its coverage, prohibits the exercise of, or is
511
+ conditioned on the non-exercise of one or more of the rights that are
512
+ specifically granted under this License. You may not convey a covered
513
+ work if you are a party to an arrangement with a third party that is
514
+ in the business of distributing software, under which you make payment
515
+ to the third party based on the extent of your activity of conveying
516
+ the work, and under which the third party grants, to any of the
517
+ parties who would receive the covered work from you, a discriminatory
518
+ patent license (a) in connection with copies of the covered work
519
+ conveyed by you (or copies made from those copies), or (b) primarily
520
+ for and in connection with specific products or compilations that
521
+ contain the covered work, unless you entered into that arrangement,
522
+ or that patent license was granted, prior to 28 March 2007.
523
+
524
+ Nothing in this License shall be construed as excluding or limiting
525
+ any implied license or other defenses to infringement that may
526
+ otherwise be available to you under applicable patent law.
527
+
528
+ 12. No Surrender of Others' Freedom.
529
+
530
+ If conditions are imposed on you (whether by court order, agreement or
531
+ otherwise) that contradict the conditions of this License, they do not
532
+ excuse you from the conditions of this License. If you cannot convey a
533
+ covered work so as to satisfy simultaneously your obligations under this
534
+ License and any other pertinent obligations, then as a consequence you may
535
+ not convey it at all. For example, if you agree to terms that obligate you
536
+ to collect a royalty for further conveying from those to whom you convey
537
+ the Program, the only way you could satisfy both those terms and this
538
+ License would be to refrain entirely from conveying the Program.
539
+
540
+ 13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
552
+
553
+ Notwithstanding any other provision of this License, you have
554
+ permission to link or combine any covered work with a work licensed
555
+ under version 3 of the GNU General Public License into a single
556
+ combined work, and to convey the resulting work. The terms of this
557
+ License will continue to apply to the part which is the covered work,
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
560
+
561
+ 14. Revised Versions of this License.
562
+
563
+ The Free Software Foundation may publish revised and/or new versions of
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
566
+ address new problems or concerns.
567
+
568
+ Each version is given a distinguishing version number. If the
569
+ Program specifies that a certain numbered version of the GNU Affero General
570
+ Public License "or any later version" applies to it, you have the
571
+ option of following the terms and conditions either of that numbered
572
+ version or of any later version published by the Free Software
573
+ Foundation. If the Program does not specify a version number of the
574
+ GNU Affero General Public License, you may choose any version ever published
575
+ by the Free Software Foundation.
576
+
577
+ If the Program specifies that a proxy can decide which future
578
+ versions of the GNU Affero General Public License can be used, that proxy's
579
+ public statement of acceptance of a version permanently authorizes you
580
+ to choose that version for the Program.
581
+
582
+ Later license versions may give you additional or different
583
+ permissions. However, no additional obligations are imposed on any
584
+ author or copyright holder as a result of your choosing to follow a
585
+ later version.
586
+
587
+ 15. Disclaimer of Warranty.
588
+
589
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597
+
598
+ 16. Limitation of Liability.
599
+
600
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
+ SUCH DAMAGES.
609
+
610
+ 17. Interpretation of Sections 15 and 16.
611
+
612
+ If the disclaimer of warranty and limitation of liability provided
613
+ above cannot be given local legal effect according to their terms,
614
+ reviewing courts shall apply local law that most closely approximates
615
+ an absolute waiver of all civil liability in connection with the
616
+ Program, unless a warranty or assumption of liability accompanies a
617
+ copy of the Program in return for a fee.
618
+
619
+ END OF TERMS AND CONDITIONS
620
+
621
+ How to Apply These Terms to Your New Programs
622
+
623
+ If you develop a new program, and you want it to be of the greatest
624
+ possible use to the public, the best way to achieve this is to make it
625
+ free software which everyone can redistribute and change under these terms.
626
+
627
+ To do so, attach the following notices to the program. It is safest
628
+ to attach them to the start of each source file to most effectively
629
+ state the exclusion of warranty; and each file should have at least
630
+ the "copyright" line and a pointer to where the full notice is found.
631
+
632
+ <one line to give the program's name and a brief idea of what it does.>
633
+ Copyright (C) <year> <name of author>
634
+
635
+ This program is free software: you can redistribute it and/or modify
636
+ it under the terms of the GNU Affero General Public License as published by
637
+ the Free Software Foundation, either version 3 of the License, or
638
+ (at your option) any later version.
639
+
640
+ This program is distributed in the hope that it will be useful,
641
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
642
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
+ GNU Affero General Public License for more details.
644
+
645
+ You should have received a copy of the GNU Affero General Public License
646
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
647
+
648
+ Also add information on how to contact you by electronic and paper mail.
649
+
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
657
+
658
+ You should also get your employer (if you work as a programmer) or school,
659
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
661
+ <https://www.gnu.org/licenses/>.
verify/PROPERTY_MAP.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry J contributors
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
5
+
6
+ # Harness ↔ PROPERTIES.md mapping + measured results
7
+
8
+ Properties: `spec/PROPERTIES.md` (56).
9
+ Core entry: `j/foundry.ijs` + `foundry_export''`.
10
+ Log: `logs/run-20261007-075943.log` (PT).
11
+
12
+ Statuses below match that log exactly. Named baseline tests are listed after the property table.
13
+
14
+ | # | Title | Status | Harness id | Log citation |
15
+ |---|-------|--------|------------|--------------|
16
+ | 1 | Goldilocks prime (decimal) | **PASS** | `prop_1` | `PASS prop_1` |
17
+ | 2 | Goldilocks prime (hex / named) | **PASS** | `prop_2` | `PASS prop_2` |
18
+ | 3 | Field elements u64 reduced mod p | **PASS** | `prop_3` | `PASS prop_3` |
19
+ | 4 | Elem construction reduces | **PASS** | `prop_4` | `PASS prop_4` |
20
+ | 5 | Congruence 2^64 ≑ 2^32βˆ’1 (mod p) | **PASS** | `prop_5` | `PASS prop_5` |
21
+ | 6 | Fold constant EPSILON | **PASS** | `prop_6` | `PASS prop_6` |
22
+ | 7 | 128-bit product split (via fp_mulmod) | **PASS** | `prop_7` | `PASS prop_7` |
23
+ | 8 | hi split into 32-bit halves | **PASS** | `prop_8` | `PASS prop_8` |
24
+ | 9 | Reduction identity (fold) | **PASS** | `prop_9` | `PASS prop_9` |
25
+ | 10 | Underflow handling on fold | **PASS** | `prop_10` | `PASS prop_10` |
26
+ | 11 | Final conditional reduction | **PASS** | `prop_11` | `PASS prop_11` |
27
+ | 12 | Single-limb reduce | **PASS** | `prop_12` | `PASS prop_12` |
28
+ | 13 | Addition mod p | **PASS** | `prop_13` | `PASS prop_13` |
29
+ | 14 | Subtraction mod p | **PASS** | `prop_14` | `PASS prop_14` |
30
+ | 15 | Multiplication via mulmod | **PASS** | `prop_15` | `PASS prop_15` |
31
+ | 16 | Fermat inverse | **PASS** | `prop_16` | `PASS prop_16` |
32
+ | 17 | Binary exponentiation | **PASS** | `prop_17` | `PASS prop_17` |
33
+ | 18 | Batch add/mul | **PASS** | `prop_18` | `PASS prop_18` |
34
+ | 19 | K_MAX | **PASS** | `prop_19` | `PASS prop_19` |
35
+ | 20 | MAX_DRIFT | **PASS** | `prop_20` | `PASS prop_20` |
36
+ | 21 | PIRTM_MAGIC | **PASS** | `prop_21` | `PASS prop_21` |
37
+ | 22 | PHI | **PASS** | `prop_22` | `PASS prop_22` |
38
+ | 23 | P_64 first 64 primes | **PASS** | `prop_23` | `PASS prop_23` |
39
+ | 24 | GENESIS_HASH_SIZE | **PASS** | `prop_24` | `PASS prop_24` |
40
+ | 25 | Tier epsilons | **PASS** | `prop_25` | `PASS prop_25` |
41
+ | 26 | PMat entry shape | **PASS** | `prop_26` | `PASS prop_26` |
42
+ | 27 | Insert domain checks | **PASS** | `prop_27` | `PASS prop_27` |
43
+ | 28 | Grading condition (C++ stub mirror) | **PASS** | `prop_28` | `PASS prop_28` |
44
+ | 29 | Conservation theorem | **PASS** | `prop_29` | `PASS prop_29` |
45
+ | 30 | Composition preserves grading/shape | **PASS** | `prop_30` | `PASS prop_30` |
46
+ | 31 | Compose monomial accumulation rule | **PASS** | `prop_31` | `PASS prop_31` |
47
+ | 32 | Frobenius norm of PMat | **PASS** | `prop_32` | `PASS prop_32` |
48
+ | 33 | Gershgorin disk bound | **PASS** | `prop_33` | `PASS prop_33` |
49
+ | 34 | Contractive test (Gershgorin) | **PASS** | `prop_34` | `PASS prop_34` |
50
+ | 35 | Power iteration (Rayleigh) | **PASS** | `prop_35` | `PASS prop_35` |
51
+ | 36 | Contractive test (power iteration) | **PASS** | `prop_36` | `PASS prop_36` |
52
+ | 37 | Analyze fallback policy | **PASS** | `prop_37` | `PASS prop_37` |
53
+ | 38 | Tested contractive / expansive examples | **PASS** | `prop_38` | `PASS prop_38` |
54
+ | 39 | Recurrence equation | **PASS** | `prop_39` | `PASS prop_39` |
55
+ | 40 | Contraction condition | **PASS** | `prop_40` | `PASS prop_40` |
56
+ | 41 | Unique fixed-point guarantee (narrative) | **SKIP** | `prop_41` | `SKIP prop_41: narrative-only Banach guarantee` |
57
+ | 42 | q estimate in step | **PASS** | `prop_42` | `PASS prop_42` |
58
+ | 43 | Soft projection | **PASS** | `prop_43` | `PASS prop_43` |
59
+ | 44 | Weight budget split | **PASS** | `prop_44` | `PASS prop_44` |
60
+ | 45 | Projector | **PASS** | `prop_45` | `PASS prop_45` |
61
+ | 46 | Residual / convergence | **PASS** | `prop_46` | `PASS prop_46` |
62
+ | 47 | WORM / seal chain invariant | **SKIP** | `prop_47` | `SKIP prop_47: WORM/seal chain / triple-lock theater out of harness scope` |
63
+ | 48 | Emission Suppress | **PASS** | `prop_48` | `PASS prop_48` |
64
+ | 49 | Emission Attenuate scale | **FAIL** | `prop_49` | `FAIL prop_49: Spec expect 0.4*out; Core got 1.4 2.8 4.2` |
65
+ | 50 | CSL neutrality | **FAIL** | `prop_50` | `FAIL prop_50: index error in csl_neutrality` |
66
+ | 51 | CSL beneficence | **PASS** | `prop_51` | `PASS prop_51` |
67
+ | 52 | CSL commutation | **PASS** | `prop_52` | `PASS prop_52` |
68
+ | 53 | AceCertificate safety margin | **PASS** | `prop_53` | `PASS prop_53` |
69
+ | 54 | AceCertificate tail bound | **PASS** | `prop_54` | `PASS prop_54` |
70
+ | 55 | Guardian spectral legality | **SKIP** | `prop_55` | `SKIP prop_55: no Core guardian verb (gate theater out of harness scope)` |
71
+ | 56 | Consensus / false-positive bound | **SKIP** | `prop_56` | `SKIP prop_56: narrative-only consensus / 2^-256 bound` |
72
+
73
+ ## Property summary (56)
74
+
75
+ | Status | Count |
76
+ |--------|------:|
77
+ | PASS | **50** |
78
+ | FAIL | **2** (`prop_49`, `prop_50`) |
79
+ | SKIP | **4** (`prop_41`, `prop_47`, `prop_55`, `prop_56`) |
80
+ | BLOCKED | **0** |
81
+
82
+ ## Named baseline tests (same log)
83
+
84
+ | Harness test | Primary # | Measured |
85
+ |--------------|-----------|----------|
86
+ | `goldilocks_add` | 13 | **PASS** |
87
+ | `goldilocks_mul` | 15 | **PASS** |
88
+ | `goldilocks_inv` | 16 | **PASS** |
89
+ | `goldilocks_sub` | 14 | **PASS** |
90
+ | `pmat_insert` | 27 | **PASS** |
91
+ | `pmat_conservation` | 29 | **PASS** |
92
+ | `spectral_contractive` | 38 | **PASS** |
93
+ | `spectral_expansive` | 38 | **PASS** |
94
+ | `recurrence_converges` | 46 | **PASS** |
95
+
96
+ Named: **PASS=9 FAIL=0 BLOCKED=0** (no regression vs `logs/run-20261007-061853.log`).
97
+
98
+ ## Full harness counters (named + prop_*)
99
+
100
+ `PASS=59 FAIL=2 SKIP=4 BLOCKED=0` Β· `exit_code=1`
101
+
102
+ ## Notes for Hilbert / Core
103
+
104
+ 1. **Measured against Core** `7cc1ba6` (BOXING.md freeze). Prop 16 / `goldilocks_inv` **PASS**. Prop 46 driven via `rec_run` (list of `<StepInfo>`).
105
+ 2. **prop_49 FAIL** β€” Spec `max(0,(1βˆ’Ξ΅)βˆ’q)`; Core `emit_apply` Attenuate uses J RTL `1 - eps - q` β†’ `1-(eps-q)`, so q=0.5 Ξ΅=0.1 yields scale 1.4 not 0.4.
106
+ 3. **prop_50 FAIL** β€” Core `csl_neutrality` loop bound `n - i - 1` is J RTL (`n-(i-1)`), causing index error for normal vector lengths. Measured FAIL (verb exists; not SKIP).
107
+ 4. Props 7–11 exercise mulmod via `fp_mulmod` identities (128-bit split internals are not separately exported).
108
+ 5. Prop 28 mirrors C++ stub (`pmat_validate_grading` always 1); Spec gap noted in PROPERTIES.md / GAP_DECISIONS.
verify/README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Copyright (C) 2026 Foundry J contributors
3
+ SPDX-License-Identifier: AGPL-3.0-or-later
4
+ -->
5
+
6
+ # Foundry J β€” Verification Harness
7
+
8
+ Pure-J checks for all 56 mathematical properties from `spec/PROPERTIES.md`.
9
+ Core is the arithmetic authority (no Python).
10
+
11
+ ## Run
12
+
13
+ ```bash
14
+ cd verify
15
+ ./run.sh
16
+ # β†’ logs/run-<timestamp>.log
17
+ ```
18
+
19
+ jconsole: `/home/box/j/j9.7/bin/jconsole` (override with `JCONSOLE`).
20
+
21
+ ## Core load
22
+
23
+ ```
24
+ load '../j/foundry.ijs'
25
+ foundry_export ''
26
+ ```
27
+
28
+ ## Verdicts
29
+
30
+ `PASS` / `FAIL <name>: reason` / `SKIP <name>: reason` / `BLOCKED <name>: missing …`
31
+
32
+ Per-property lines use ids `prop_1` … `prop_56`. Named baseline tests (`goldilocks_add`, …) are retained.
33
+
34
+ Exit non-zero on any FAIL. See `PROPERTY_MAP.md` for the authoritative table.
verify/harness.ijs ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. PASS/FAIL/SKIP/BLOCKED helpers + Foundry Core loader (foundry.ijs + foundry_export).
4
+
5
+ cocurrent 'z'
6
+
7
+ PASS_N =: 0
8
+ FAIL_N =: 0
9
+ SKIP_N =: 0
10
+ BLOCK_N =: 0
11
+ CORE_OK =: 0
12
+
13
+ FOUNDRY_IJS =: '../j/foundry.ijs'
14
+
15
+ fexists =: 3 : '0 < # 1!:0 < y'
16
+
17
+ pass =: 3 : 0
18
+ PASS_N =: PASS_N + 1
19
+ echo 'PASS ' , y
20
+ )
21
+
22
+ fail =: 4 : 0
23
+ FAIL_N =: FAIL_N + 1
24
+ echo 'FAIL ' , y , ': ' , x
25
+ )
26
+
27
+ skip =: 4 : 0
28
+ SKIP_N =: SKIP_N + 1
29
+ echo 'SKIP ' , y , ': ' , x
30
+ )
31
+
32
+ blocked =: 4 : 0
33
+ BLOCK_N =: BLOCK_N + 1
34
+ echo 'BLOCKED ' , y , ': ' , x
35
+ )
36
+
37
+ NB. Load package entrypoint and export J_API verbs into base.
38
+ NB. Returns 1 on success, 0 if foundry.ijs missing.
39
+ load_foundry =: 3 : 0
40
+ if. -. fexists FOUNDRY_IJS do.
41
+ CORE_OK =: 0
42
+ 0 return.
43
+ end.
44
+ load FOUNDRY_IJS
45
+ foundry_export ''
46
+ CORE_OK =: 1
47
+ 1
48
+ )
49
+
50
+ harness_finish =: 3 : 0
51
+ echo ''
52
+ echo '═══════════════════════════════════════'
53
+ echo 'PASS=' , (": PASS_N) , ' FAIL=' , (": FAIL_N) , ' SKIP=' , (": SKIP_N) , ' BLOCKED=' , (": BLOCK_N)
54
+ if. FAIL_N > 0 do. 2!:55 ] 1 else. 2!:55 ] 0 end.
55
+ )
verify/logs/.gitkeep ADDED
File without changes
verify/logs/run-20261007-061237.log ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j/verify
3
+ Timestamp (PT): 2026-10-07 06:12:37 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core dir: ../j/
10
+
11
+ ── goldilocks ──
12
+ FAIL goldilocks_add: |value error: gl_add
13
+ | r=.100x gl_add 200x
14
+ |[-62] /workspace/foundry-j/verify/tests/goldilocks.ijs
15
+
16
+ FAIL goldilocks_mul: |value error: gl_mul
17
+ | r=.7x gl_mul 6x
18
+ |[-62] /workspace/foundry-j/verify/tests/goldilocks.ijs
19
+
20
+ FAIL goldilocks_inv: |value error: gl_inv
21
+ | inv=. gl_inv a
22
+ |[-62] /workspace/foundry-j/verify/tests/goldilocks.ijs
23
+
24
+ FAIL goldilocks_sub: |value error: gl_sub
25
+ | r=.100x gl_sub 50x
26
+ |[-62] /workspace/foundry-j/verify/tests/goldilocks.ijs
27
+
28
+ ── pmat ──
29
+ FAIL pmat_insert: |value error: pmat_new
30
+ | m=. pmat_new 3 3
31
+ |[-51] /workspace/foundry-j/verify/tests/pmat.ijs
32
+
33
+ FAIL pmat_conservation: |value error: pmat_new
34
+ | m=. pmat_new 2 2
35
+ |[-51] /workspace/foundry-j/verify/tests/pmat.ijs
36
+
37
+ ── spectral ──
38
+ FAIL spectral_contractive: |value error: spectral_analyze
39
+ | r=. spectral_analyze J;0.1
40
+ |[-42] /workspace/foundry-j/verify/tests/spectral.ijs
41
+
42
+ FAIL spectral_expansive: |value error: spectral_analyze
43
+ | r=. spectral_analyze J;0.1
44
+ |[-42] /workspace/foundry-j/verify/tests/spectral.ijs
45
+
46
+ ── recurrence ──
47
+ BLOCKED recurrence_converges: missing ../j/recurrence.ijs
48
+
49
+ ═══════════════════════════════════════
50
+ PASS=0 FAIL=8 BLOCKED=1
51
+ ────────────────────────────────────────
52
+ exit_code=1
53
+ log=logs/run-20261007-061237.log
verify/logs/run-20261007-061352.log ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j/verify
3
+ Timestamp (PT): 2026-10-07 06:13:52 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core dir: ../j/
10
+
11
+ ── goldilocks ──
12
+ PASS goldilocks_add
13
+ PASS goldilocks_mul
14
+ FAIL goldilocks_inv: expected 1 got 11152786313141180820
15
+ PASS goldilocks_sub
16
+ ── pmat ──
17
+ PASS pmat_insert
18
+ PASS pmat_conservation
19
+ ── spectral ──
20
+ PASS spectral_contractive
21
+ PASS spectral_expansive
22
+ ── recurrence ──
23
+ FAIL recurrence_converges: rec_run present but no recurrence_converges helper β€” need Core driver
24
+
25
+ ═══════════════════════════════════════
26
+ PASS=7 FAIL=2 BLOCKED=0
27
+ ────────────────────────────────────────
28
+ exit_code=1
29
+ log=logs/run-20261007-061352.log
verify/logs/run-20261007-061501.log ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j/verify
3
+ Timestamp (PT): 2026-10-07 06:15:01 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core dir: ../j/
10
+
11
+ ── goldilocks ──
12
+ PASS goldilocks_add
13
+ PASS goldilocks_mul
14
+ FAIL goldilocks_inv: expected 1 got 11152786313141180820
15
+ PASS goldilocks_sub
16
+ ── pmat ──
17
+ PASS pmat_insert
18
+ PASS pmat_conservation
19
+ ── spectral ──
20
+ PASS spectral_contractive
21
+ PASS spectral_expansive
22
+ ── recurrence ──
23
+ FAIL recurrence_converges: |index error in rec_run, executing dyad {::
24
+ | resid=.6 {::>info
25
+ |[-53] /workspace/foundry-j/verify/tests/recurrence.ijs
26
+
27
+
28
+ ═══════════════════════════════════════
29
+ PASS=7 FAIL=2 BLOCKED=0
30
+ ────────────────────────────────────────
31
+ exit_code=1
32
+ log=logs/run-20261007-061501.log
verify/logs/run-20261007-061701.log ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j/verify
3
+ Timestamp (PT): 2026-10-07 06:17:01 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core: ../j/foundry.ijs + foundry_export
10
+
11
+ core_loaded=1
12
+
13
+ ── goldilocks ──
14
+ PASS goldilocks_add
15
+ PASS goldilocks_mul
16
+ FAIL goldilocks_inv: expected 1 got 11152786313141180820
17
+ PASS goldilocks_sub
18
+ ── pmat ──
19
+ PASS pmat_insert
20
+ PASS pmat_conservation
21
+ ── spectral ──
22
+ PASS spectral_contractive
23
+ PASS spectral_expansive
24
+ ── recurrence ──
25
+ PASS recurrence_converges
26
+
27
+ ═══════════════════════════════════════
28
+ PASS=8 FAIL=1 BLOCKED=0
29
+ ────────────────────────────────────────
30
+ exit_code=1
31
+ log=logs/run-20261007-061701.log
verify/logs/run-20261007-061836.log ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j/verify
3
+ Timestamp (PT): 2026-10-07 06:18:36 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core: ../j/foundry.ijs + foundry_export
10
+
11
+ core_loaded=1
12
+
13
+ ── goldilocks ──
14
+ PASS goldilocks_add
15
+ PASS goldilocks_mul
16
+ PASS goldilocks_inv
17
+ PASS goldilocks_sub
18
+ ── pmat ──
19
+ PASS pmat_insert
20
+ PASS pmat_conservation
21
+ ── spectral ──
22
+ PASS spectral_contractive
23
+ PASS spectral_expansive
24
+ ── recurrence ──
25
+ FAIL recurrence_converges: |domain error in run_recurrence, executing dyad <
26
+ |x is boxed
27
+ | resid <1e_6
28
+ |[-52] /workspace/foundry-j/verify/tests/recurrence.ijs
29
+
30
+
31
+ ═══════════════════════════════════════
32
+ PASS=8 FAIL=1 BLOCKED=0
33
+ ────────────────────────────────────────
34
+ exit_code=1
35
+ log=logs/run-20261007-061836.log
verify/logs/run-20261007-061847.log ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j/verify
3
+ Timestamp (PT): 2026-10-07 06:18:47 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core: ../j/foundry.ijs + foundry_export
10
+
11
+ core_loaded=1
12
+
13
+ ── goldilocks ──
14
+ PASS goldilocks_add
15
+ PASS goldilocks_mul
16
+ PASS goldilocks_inv
17
+ PASS goldilocks_sub
18
+ ── pmat ──
19
+ PASS pmat_insert
20
+ PASS pmat_conservation
21
+ ── spectral ──
22
+ PASS spectral_contractive
23
+ PASS spectral_expansive
24
+ ── recurrence ──
25
+ FAIL recurrence_converges: |value error: REC_STATE
26
+ | conv*.resid<1e_6
27
+ |[-41] /workspace/foundry-j/verify/tests/recurrence.ijs
28
+
29
+
30
+ ═══════════════════════════════════════
31
+ PASS=8 FAIL=1 BLOCKED=0
32
+ ────────────────────────────────────────
33
+ exit_code=1
34
+ log=logs/run-20261007-061847.log
verify/logs/run-20261007-061853.log ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j/verify
3
+ Timestamp (PT): 2026-10-07 06:18:53 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core: ../j/foundry.ijs + foundry_export
10
+
11
+ core_loaded=1
12
+
13
+ ── goldilocks ──
14
+ PASS goldilocks_add
15
+ PASS goldilocks_mul
16
+ PASS goldilocks_inv
17
+ PASS goldilocks_sub
18
+ ── pmat ──
19
+ PASS pmat_insert
20
+ PASS pmat_conservation
21
+ ── spectral ──
22
+ PASS spectral_contractive
23
+ PASS spectral_expansive
24
+ ── recurrence ──
25
+ PASS recurrence_converges
26
+
27
+ ═══════════════════════════════════════
28
+ PASS=9 FAIL=0 BLOCKED=0
29
+ ────────────────────────────────────────
30
+ exit_code=0
31
+ log=logs/run-20261007-061853.log
verify/logs/run-20261007-075943.log ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j-remote/verify
3
+ Timestamp (PT): 2026-10-07 07:59:43 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core: ../j/foundry.ijs + foundry_export
10
+
11
+ core_loaded=1
12
+
13
+ ── goldilocks ──
14
+ PASS goldilocks_add
15
+ PASS goldilocks_mul
16
+ PASS goldilocks_inv
17
+ PASS goldilocks_sub
18
+ PASS prop_1
19
+ PASS prop_2
20
+ PASS prop_3
21
+ PASS prop_4
22
+ PASS prop_5
23
+ PASS prop_6
24
+ PASS prop_7
25
+ PASS prop_8
26
+ PASS prop_9
27
+ PASS prop_10
28
+ PASS prop_11
29
+ PASS prop_12
30
+ PASS prop_13
31
+ PASS prop_14
32
+ PASS prop_15
33
+ PASS prop_16
34
+ PASS prop_17
35
+ PASS prop_18
36
+ ── constants ──
37
+ PASS prop_19
38
+ PASS prop_20
39
+ PASS prop_21
40
+ PASS prop_22
41
+ PASS prop_23
42
+ PASS prop_24
43
+ PASS prop_25
44
+ ── pmat ──
45
+ PASS pmat_insert
46
+ PASS pmat_conservation
47
+ PASS prop_26
48
+ PASS prop_27
49
+ PASS prop_28
50
+ PASS prop_29
51
+ PASS prop_30
52
+ PASS prop_31
53
+ PASS prop_32
54
+ ── spectral ──
55
+ PASS spectral_contractive
56
+ PASS spectral_expansive
57
+ PASS prop_33
58
+ PASS prop_34
59
+ PASS prop_35
60
+ PASS prop_36
61
+ PASS prop_37
62
+ PASS prop_38
63
+ ── recurrence ──
64
+ PASS recurrence_converges
65
+ PASS prop_39
66
+ PASS prop_40
67
+ SKIP prop_41: narrative-only Banach guarantee
68
+ PASS prop_42
69
+ PASS prop_43
70
+ PASS prop_44
71
+ PASS prop_45
72
+ PASS prop_46
73
+ ── emit/csl/ace ──
74
+ SKIP prop_47: WORM/seal chain / triple-lock theater out of harness scope
75
+ PASS prop_48
76
+ FAIL prop_49: Spec expect 0.4*out; Core got 1.4 2.8 4.2
77
+ FAIL prop_50: |index error in csl_neutrality_foundry_, executing dyad {
78
+ |x is 3; too long for y, whose length is only 3
79
+ | dx=.|(i{xv)-j {xv
80
+ |[-82] /workspace/foundry-j-remote/verify/tests/emit_csl_ace.ijs
81
+
82
+ PASS prop_51
83
+ PASS prop_52
84
+ PASS prop_53
85
+ PASS prop_54
86
+ SKIP prop_55: no Core guardian verb (gate theater out of harness scope)
87
+ SKIP prop_56: narrative-only consensus / 2^-256 bound
88
+
89
+ ═══════════════════════════════════════
90
+ PASS=59 FAIL=2 SKIP=4 BLOCKED=0
91
+ ────────────────────────────────────────
92
+ exit_code=1
93
+ log=logs/run-20261007-075943.log
verify/logs/run-20261007-080122.log ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using jconsole: /home/box/j/j9.7/bin/jconsole
2
+ Working directory: /workspace/foundry-j-repo/verify
3
+ Timestamp (PT): 2026-10-07 08:01:22 PDT
4
+ Core present: yes
5
+ ────────────────────────────────────────
6
+ Foundry J β€” Verification Harness
7
+ ═══════════════════════════════════════
8
+ jconsole: j9.7.1/j64/linux/commercial/www.jsoftware.com/2026-04-06T04:00:54/clang-14-0-0/SLEEF=0
9
+ core: ../j/foundry.ijs + foundry_export
10
+
11
+ core_loaded=1
12
+
13
+ ── goldilocks ──
14
+ PASS goldilocks_add
15
+ PASS goldilocks_mul
16
+ PASS goldilocks_inv
17
+ PASS goldilocks_sub
18
+ PASS prop_1
19
+ PASS prop_2
20
+ PASS prop_3
21
+ PASS prop_4
22
+ PASS prop_5
23
+ PASS prop_6
24
+ PASS prop_7
25
+ PASS prop_8
26
+ PASS prop_9
27
+ PASS prop_10
28
+ PASS prop_11
29
+ PASS prop_12
30
+ PASS prop_13
31
+ PASS prop_14
32
+ PASS prop_15
33
+ PASS prop_16
34
+ PASS prop_17
35
+ PASS prop_18
36
+ ── constants ──
37
+ PASS prop_19
38
+ PASS prop_20
39
+ PASS prop_21
40
+ PASS prop_22
41
+ PASS prop_23
42
+ PASS prop_24
43
+ PASS prop_25
44
+ ── pmat ──
45
+ PASS pmat_insert
46
+ PASS pmat_conservation
47
+ PASS prop_26
48
+ PASS prop_27
49
+ PASS prop_28
50
+ PASS prop_29
51
+ PASS prop_30
52
+ PASS prop_31
53
+ PASS prop_32
54
+ ── spectral ──
55
+ PASS spectral_contractive
56
+ PASS spectral_expansive
57
+ PASS prop_33
58
+ PASS prop_34
59
+ PASS prop_35
60
+ PASS prop_36
61
+ PASS prop_37
62
+ PASS prop_38
63
+ ── recurrence ──
64
+ PASS recurrence_converges
65
+ PASS prop_39
66
+ PASS prop_40
67
+ SKIP prop_41: narrative-only Banach guarantee
68
+ PASS prop_42
69
+ PASS prop_43
70
+ PASS prop_44
71
+ PASS prop_45
72
+ PASS prop_46
73
+ ── emit/csl/ace ──
74
+ SKIP prop_47: WORM/seal chain / triple-lock theater out of harness scope
75
+ PASS prop_48
76
+ PASS prop_49
77
+ PASS prop_50
78
+ PASS prop_51
79
+ PASS prop_52
80
+ PASS prop_53
81
+ PASS prop_54
82
+ SKIP prop_55: no Core guardian verb (gate theater out of harness scope)
83
+ SKIP prop_56: narrative-only consensus / 2^-256 bound
84
+
85
+ ═══════════════════════════════════════
86
+ PASS=61 FAIL=0 SKIP=4 BLOCKED=0
87
+ ────────────────────────────────────────
88
+ exit_code=0
89
+ log=logs/run-20261007-080122.log
verify/run.ijs ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. Foundry J verification suite β€” load Core via foundry.ijs + foundry_export.
4
+
5
+ echo 'Foundry J β€” Verification Harness'
6
+ echo '═══════════════════════════════════════'
7
+ echo 'jconsole: ' , 9!:14 ''
8
+ echo 'core: ../j/foundry.ijs + foundry_export'
9
+ echo ''
10
+
11
+ load 'harness.ijs'
12
+
13
+ ok =. load_foundry ''
14
+ echo 'core_loaded=' , ": ok
15
+ echo ''
16
+
17
+ echo '── goldilocks ──'
18
+ load 'tests/goldilocks.ijs'
19
+ echo '── constants ──'
20
+ load 'tests/constants.ijs'
21
+ echo '── pmat ──'
22
+ load 'tests/pmat.ijs'
23
+ echo '── spectral ──'
24
+ load 'tests/spectral.ijs'
25
+ echo '── recurrence ──'
26
+ load 'tests/recurrence.ijs'
27
+ echo '── emit/csl/ace ──'
28
+ load 'tests/emit_csl_ace.ijs'
29
+
30
+ harness_finish ''
verify/run.sh ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Copyright (C) 2026 Foundry J contributors
3
+ # SPDX-License-Identifier: AGPL-3.0-or-later
4
+ #
5
+ # Run the Foundry J verification suite and capture real stdout.
6
+ set -u
7
+ cd "$(dirname "$0")"
8
+
9
+ JCONSOLE="${JCONSOLE:-/home/box/j/j9.7/bin/jconsole}"
10
+ if [[ ! -x "$JCONSOLE" ]]; then
11
+ if [[ -x /home/box/j/j9.7/jconsole.sh ]]; then
12
+ JCONSOLE=/home/box/j/j9.7/jconsole.sh
13
+ else
14
+ echo "FAIL harness: jconsole not found at $JCONSOLE" >&2
15
+ exit 1
16
+ fi
17
+ fi
18
+
19
+ TS="$(date '+%Y%m%d-%H%M%S')"
20
+ LOG="logs/run-${TS}.log"
21
+ mkdir -p logs
22
+
23
+ echo "Using jconsole: $JCONSOLE" | tee "$LOG"
24
+ echo "Working directory: $(pwd)" | tee -a "$LOG"
25
+ echo "Timestamp (PT): $(date '+%Y-%m-%d %H:%M:%S %Z')" | tee -a "$LOG"
26
+ echo "Core present: $([[ -d ../j ]] && echo yes || echo no)" | tee -a "$LOG"
27
+ echo "────────────────────────────────────────" | tee -a "$LOG"
28
+
29
+ set +e
30
+ "$JCONSOLE" run.ijs 2>&1 | tee -a "$LOG"
31
+ RC=${PIPESTATUS[0]}
32
+ set -e
33
+
34
+ echo "────────────────────────────────────────" | tee -a "$LOG"
35
+ echo "exit_code=$RC" | tee -a "$LOG"
36
+ echo "log=$LOG" | tee -a "$LOG"
37
+ exit "$RC"
verify/tests/constants.ijs ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. Named constants props 19–25.
4
+
5
+ run_constants =: 3 : 0
6
+ if. -. CORE_OK do.
7
+ ('missing ' , FOUNDRY_IJS) blocked 'prop_19'
8
+ '' return.
9
+ end.
10
+
11
+ NB. prop_19 K_MAX
12
+ try.
13
+ if. K_MAX = 133144 do. pass 'prop_19' else. (('got ' , ": K_MAX)) fail 'prop_19' end.
14
+ catch. (13!:12 '') fail 'prop_19' end.
15
+
16
+ NB. prop_20 MAX_DRIFT
17
+ try.
18
+ if. MAX_DRIFT = 300000000000000000x do. pass 'prop_20'
19
+ else. (('got ' , ": MAX_DRIFT)) fail 'prop_20' end.
20
+ catch. (13!:12 '') fail 'prop_20' end.
21
+
22
+ NB. prop_21 PIRTM_MAGIC = 0x7F504952
23
+ try.
24
+ if. PIRTM_MAGIC = 2135945554x do. pass 'prop_21'
25
+ else. (('got ' , ": PIRTM_MAGIC)) fail 'prop_21' end.
26
+ catch. (13!:12 '') fail 'prop_21' end.
27
+
28
+ NB. prop_22 PHI
29
+ try.
30
+ if. 1e_12 > | PHI - 1.618033988749895 do. pass 'prop_22'
31
+ else. (('got ' , ": PHI)) fail 'prop_22' end.
32
+ catch. (13!:12 '') fail 'prop_22' end.
33
+
34
+ NB. prop_23 P_64 first 64 primes
35
+ try.
36
+ expect =. 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311
37
+ if. (64 = # P64) *. (P64 -: expect) *. (P_64 -: P64) do. pass 'prop_23'
38
+ else. 'P64 mismatch' fail 'prop_23' end.
39
+ catch. (13!:12 '') fail 'prop_23' end.
40
+
41
+ NB. prop_24 GENESIS_HASH_SIZE (in foundry locale; not always exported)
42
+ try.
43
+ ghs =. GENESIS_HASH_SIZE_foundry_
44
+ if. ghs = 32 do. pass 'prop_24' else. (('got ' , ": ghs)) fail 'prop_24' end.
45
+ catch. (13!:12 '') fail 'prop_24' end.
46
+
47
+ NB. prop_25 tier epsilons
48
+ try.
49
+ ok =. ((tier_eps 1) = 0.10) *. ((tier_eps 2) = 0.05) *. ((tier_eps 3) = 0.02) *. ((tier_eps 4) = 0.01) *. ((tier_eps 99) = 0.10)
50
+ if. ok do. pass 'prop_25' else. 'tier_eps mismatch' fail 'prop_25' end.
51
+ catch. (13!:12 '') fail 'prop_25' end.
52
+ ''
53
+ )
54
+
55
+ run_constants ''
verify/tests/emit_csl_ace.ijs ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. Emission / CSL / Ace props 48–54; SKIP 47,55,56.
4
+
5
+ run_emit_csl_ace =: 3 : 0
6
+ if. -. CORE_OK do.
7
+ ('missing ' , FOUNDRY_IJS) blocked 'prop_48'
8
+ '' return.
9
+ end.
10
+
11
+ NB. ── prop_47 WORM / seal chain (system-level theater) ─────────────────────
12
+ 'WORM/seal chain / triple-lock theater out of harness scope' skip 'prop_47'
13
+
14
+ NB. ── prop_48 Emission Suppress ───────────────────────────────────────────
15
+ try.
16
+ z =. (1 2 3) emit_apply (0 0 0) ; 0.95 ; GP_SUPPRESS ; 0.1
17
+ p =. (1 2 3) emit_apply (0 0 0) ; 0.5 ; GP_SUPPRESS ; 0.1
18
+ if. (z -: 0 0 0) *. (p -: 1 2 3) do. pass 'prop_48'
19
+ else. (('suppress z=' , (": z) , ' p=' , ": p)) fail 'prop_48' end.
20
+ catch. (13!:12 '') fail 'prop_48' end.
21
+
22
+ NB. ── prop_49 Emission Attenuate scale max(0,1-Ξ΅-q) ────────────────────────
23
+ try.
24
+ NB. Spec: scale = max(0, (1-Ξ΅)-q); q=0.5 eps=0.1 β†’ 0.4
25
+ NB. Core emit_apply uses J RTL `1 - eps - q` (=1.4 here) β€” mismatch β†’ FAIL if so
26
+ out =. (1 2 3) emit_apply (0 0 0) ; 0.5 ; GP_ATTENUATE ; 0.1
27
+ expect =. 0.4 * 1 2 3
28
+ if. 1e_9 > >./ | out - expect do. pass 'prop_49'
29
+ else. (('Spec expect 0.4*out; Core got ' , ": out)) fail 'prop_49' end.
30
+ catch. (13!:12 '') fail 'prop_49' end.
31
+
32
+ NB. ── prop_50 CSL neutrality ──────────────────────────────────────────────
33
+ try.
34
+ NB. identity-ish: Tx = 0.5 * x β†’ Lip 0.5 < 1+Ξ΅
35
+ v =. (1 2 3) csl_neutrality ((0.5 1 1.5) ; 0.1)
36
+ if. v = CSL_PASS do. pass 'prop_50'
37
+ else. (('neutrality=' , ": v)) fail 'prop_50' end.
38
+ catch. (13!:12 '') fail 'prop_50' end.
39
+
40
+ NB. ── prop_51 CSL beneficence ─────────────────────────────────────────────
41
+ try.
42
+ v =. (1 0) csl_beneficence ((0.5 0) ; 0.1 ; 0.1)
43
+ if. v = CSL_PASS do. pass 'prop_51'
44
+ else. (('beneficence=' , ": v)) fail 'prop_51' end.
45
+ catch. (13!:12 '') fail 'prop_51' end.
46
+
47
+ NB. ── prop_52 CSL commutation ─────────────────────────────────────────────
48
+ try.
49
+ cocurrent 'foundry'
50
+ idT =: ]
51
+ idF =: ]
52
+ cocurrent 'base'
53
+ v =. (1 2) csl_commutation ((<'idT') ; (<'idF') ; 0.1)
54
+ if. v = CSL_PASS do. pass 'prop_52'
55
+ else. (('commutation=' , ": v)) fail 'prop_52' end.
56
+ catch. (13!:12 '') fail 'prop_52' end.
57
+
58
+ NB. ── prop_53 AceCertificate safety margin ────────────────────────────────
59
+ try.
60
+ m =. 0.5 ace_safety_margin 0.1
61
+ NB. (1-0.1)-0.5 = 0.4
62
+ if. 1e_9 > | m - 0.4 do. pass 'prop_53'
63
+ else. (('margin=' , ": m)) fail 'prop_53' end.
64
+ catch. (13!:12 '') fail 'prop_53' end.
65
+
66
+ NB. ── prop_54 AceCertificate tail bound ───────────────────────────────────
67
+ try.
68
+ t =. 1 ace_tail_bound 0.5
69
+ inf =. 1 ace_tail_bound 1
70
+ if. (1e_9 > | t - 2) *. (inf = _) do. pass 'prop_54'
71
+ else. (('tail=' , (": t) , ' inf=' , ": inf)) fail 'prop_54' end.
72
+ catch. (13!:12 '') fail 'prop_54' end.
73
+
74
+ NB. ── prop_55 Guardian spectral legality ──────────────────────────────────
75
+ 'no Core guardian verb (gate theater out of harness scope)' skip 'prop_55'
76
+
77
+ NB. ── prop_56 Consensus / false-positive bound (narrative) ────────────────
78
+ 'narrative-only consensus / 2^-256 bound' skip 'prop_56'
79
+ ''
80
+ )
81
+
82
+ run_emit_csl_ace ''
verify/tests/goldilocks.ijs ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. Named tests + Goldilocks props 1–18 (where Core verbs exist).
4
+
5
+ run_goldilocks =: 3 : 0
6
+ if. -. CORE_OK do.
7
+ r =. 'missing ' , FOUNDRY_IJS
8
+ r blocked 'goldilocks_add'
9
+ r blocked 'goldilocks_mul'
10
+ r blocked 'goldilocks_inv'
11
+ r blocked 'goldilocks_sub'
12
+ '' return.
13
+ end.
14
+
15
+ NB. ── named tests (baseline) ──────────────────────────────────────────────
16
+ try. r =. 100x fp_add 200x
17
+ if. r = 300x do. pass 'goldilocks_add' else. (('expected 300 got ' , ": r)) fail 'goldilocks_add' end.
18
+ catch. (13!:12 '') fail 'goldilocks_add' end.
19
+
20
+ try. r =. 7x fp_mul 6x
21
+ if. r = 42x do. pass 'goldilocks_mul' else. (('expected 42 got ' , ": r)) fail 'goldilocks_mul' end.
22
+ catch. (13!:12 '') fail 'goldilocks_mul' end.
23
+
24
+ try. one =. 42x fp_mul (fp_inv 42x)
25
+ if. one = 1x do. pass 'goldilocks_inv' else. (('expected 1 got ' , ": one)) fail 'goldilocks_inv' end.
26
+ catch. (13!:12 '') fail 'goldilocks_inv' end.
27
+
28
+ try. r =. 100x fp_sub 50x
29
+ if. r = 50x do. pass 'goldilocks_sub' else. (('expected 50 got ' , ": r)) fail 'goldilocks_sub' end.
30
+ catch. (13!:12 '') fail 'goldilocks_sub' end.
31
+
32
+ NB. ── prop_1 Goldilocks prime (decimal) ───────────────────────────────────
33
+ try.
34
+ if. GOLDILOCKS_PRIME = 18446744069414584321x do. pass 'prop_1'
35
+ else. (('got ' , ": GOLDILOCKS_PRIME)) fail 'prop_1' end.
36
+ catch. (13!:12 '') fail 'prop_1' end.
37
+
38
+ NB. ── prop_2 hex / named constant (= decimal p) ───────────────────────────
39
+ try.
40
+ if. (p = GOLDILOCKS_PRIME) *. (p = 18446744069414584321x) do. pass 'prop_2'
41
+ else. 'p / GOLDILOCKS_PRIME mismatch' fail 'prop_2' end.
42
+ catch. (13!:12 '') fail 'prop_2' end.
43
+
44
+ NB. ── prop_3 field elements reduced mod p (carrier < p) ───────────────────
45
+ try.
46
+ r =. fp_reduce 42x
47
+ if. (r = 42x) *. (r < p) do. pass 'prop_3'
48
+ else. (('got ' , ": r)) fail 'prop_3' end.
49
+ catch. (13!:12 '') fail 'prop_3' end.
50
+
51
+ NB. ── prop_4 Elem construction reduces (fp_reduce) ────────────────────────
52
+ try.
53
+ r =. fp_reduce (p + 5x)
54
+ if. r = 5x do. pass 'prop_4'
55
+ else. (('expected 5 got ' , ": r)) fail 'prop_4' end.
56
+ catch. (13!:12 '') fail 'prop_4' end.
57
+
58
+ NB. ── prop_5 congruence 2^64 ≑ 2^32-1 (mod p) ──────────────────────────────
59
+ try.
60
+ NB. TWO64 - p = 2^32 - 1 = EPSILON_FOLD
61
+ if. (TWO64_foundry_ - p) = EPSILON_FOLD do. pass 'prop_5'
62
+ else. 'TWO64 - p != EPSILON_FOLD' fail 'prop_5' end.
63
+ catch. (13!:12 '') fail 'prop_5' end.
64
+
65
+ NB. ── prop_6 EPSILON fold constant ────────────────────────────────────────
66
+ try.
67
+ if. EPSILON_FOLD = 4294967295x do. pass 'prop_6'
68
+ else. (('got ' , ": EPSILON_FOLD)) fail 'prop_6' end.
69
+ catch. (13!:12 '') fail 'prop_6' end.
70
+
71
+ NB. ── prop_7..11 mulmod fold path (exercised via fp_mulmod / fp_mul) ──────
72
+ NB. Internal 128-bit split is not separately exported; identity a*b mod p
73
+ NB. via Goldilocks fold covers props 7–11 as a unit for harness purposes.
74
+ try.
75
+ r =. 7x fp_mulmod 6x
76
+ if. r = 42x do. pass 'prop_7'
77
+ else. (('fp_mulmod 7*6 expected 42 got ' , ": r)) fail 'prop_7' end.
78
+ catch. (13!:12 '') fail 'prop_7' end.
79
+
80
+ try.
81
+ NB. larger product exercises hi/lo split (props 8–11)
82
+ a =. 123456789x
83
+ b =. 987654321x
84
+ r =. a fp_mulmod b
85
+ expect =. p | (a * b)
86
+ if. r = expect do. pass 'prop_8'
87
+ else. (('hi_lo path mismatch got ' , (": r) , ' expect ' , ": expect)) fail 'prop_8' end.
88
+ catch. (13!:12 '') fail 'prop_8' end.
89
+
90
+ try.
91
+ a =. (p - 1x)
92
+ b =. (p - 1x)
93
+ r =. a fp_mulmod b
94
+ expect =. p | (a * b)
95
+ if. r = expect do. pass 'prop_9'
96
+ else. (('fold identity fail got ' , (": r) , ' expect ' , ": expect)) fail 'prop_9' end.
97
+ catch. (13!:12 '') fail 'prop_9' end.
98
+
99
+ try.
100
+ NB. underflow / conditional reduction path: product near multiples of p
101
+ r =. 2x fp_mulmod (p - 1x)
102
+ expect =. p | (2x * (p - 1x))
103
+ if. r = expect do. pass 'prop_10'
104
+ else. (('underflow path got ' , (": r) , ' expect ' , ": expect)) fail 'prop_10' end.
105
+ catch. (13!:12 '') fail 'prop_10' end.
106
+
107
+ try.
108
+ r =. 3x fp_mulmod 5x
109
+ if. (r < p) *. (r = 15x) do. pass 'prop_11'
110
+ else. (('final reduce got ' , ": r)) fail 'prop_11' end.
111
+ catch. (13!:12 '') fail 'prop_11' end.
112
+
113
+ NB. ── prop_12 single-limb reduce ──────────────────────────────────────────
114
+ try.
115
+ ok =. ((fp_reduce 10x) = 10x) *. ((fp_reduce p) = 0x) *. ((fp_reduce (p + 1x)) = 1x)
116
+ if. ok do. pass 'prop_12' else. 'fp_reduce cases failed' fail 'prop_12' end.
117
+ catch. (13!:12 '') fail 'prop_12' end.
118
+
119
+ NB. ── prop_13 add ─────────────────────────────────────────────────────────
120
+ try.
121
+ if. (100x fp_add 200x) = 300x do. pass 'prop_13' else. 'add != 300' fail 'prop_13' end.
122
+ catch. (13!:12 '') fail 'prop_13' end.
123
+
124
+ NB. ── prop_14 sub ─────────────────────────────────────────────────────────
125
+ try.
126
+ if. (100x fp_sub 50x) = 50x do. pass 'prop_14' else. 'sub != 50' fail 'prop_14' end.
127
+ catch. (13!:12 '') fail 'prop_14' end.
128
+
129
+ NB. ── prop_15 mul ─────────────────────────────────────────────────────────
130
+ try.
131
+ if. (7x fp_mul 6x) = 42x do. pass 'prop_15' else. 'mul != 42' fail 'prop_15' end.
132
+ catch. (13!:12 '') fail 'prop_15' end.
133
+
134
+ NB. ── prop_16 Fermat inverse ──────────────────────────────────────────────
135
+ try.
136
+ one =. 42x fp_mul (fp_inv 42x)
137
+ if. one = 1x do. pass 'prop_16' else. (('a*inv(a) got ' , ": one)) fail 'prop_16' end.
138
+ catch. (13!:12 '') fail 'prop_16' end.
139
+
140
+ NB. ── prop_17 binary exponentiation ───────────────────────────────────────
141
+ try.
142
+ r =. 7x fp_pow 3x
143
+ if. r = 343x do. pass 'prop_17' else. (('7^3 got ' , ": r)) fail 'prop_17' end.
144
+ catch. (13!:12 '') fail 'prop_17' end.
145
+
146
+ NB. ── prop_18 batch add/mul ───────────────────────────────────────────────
147
+ try.
148
+ ra =. 100 200 fp_add_batch 1 2
149
+ rm =. 7 8 fp_mul_batch 6 5
150
+ if. (ra -: 101 202) *. (rm -: 42 40) do. pass 'prop_18'
151
+ else. (('batch got add=' , (": ra) , ' mul=' , ": rm)) fail 'prop_18' end.
152
+ catch. (13!:12 '') fail 'prop_18' end.
153
+ ''
154
+ )
155
+
156
+ run_goldilocks ''
verify/tests/pmat.ijs ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. Named tests + PMAT props 26–32.
4
+
5
+ run_pmat =: 3 : 0
6
+ if. -. CORE_OK do.
7
+ r =. 'missing ' , FOUNDRY_IJS
8
+ r blocked 'pmat_insert'
9
+ r blocked 'pmat_conservation'
10
+ '' return.
11
+ end.
12
+
13
+ NB. ── named tests ─────────────────────────────────────────────────────────
14
+ try.
15
+ m =. 3 pmat_new 3
16
+ 'm ok1' =. m pmat_insert 0 0 1 1 1
17
+ 'm ok2' =. m pmat_insert 0 1 _1 0 1
18
+ c =. # pmat_entries m
19
+ if. ok1 *. ok2 *. c = 2 do. pass 'pmat_insert'
20
+ else. (('ok1=' , (": ok1) , ' ok2=' , (": ok2) , ' count=' , ": c)) fail 'pmat_insert' end.
21
+ catch. (13!:12 '') fail 'pmat_insert' end.
22
+
23
+ try.
24
+ m =. 2 pmat_new 2
25
+ 'm ok' =. m pmat_insert 0 0 1 3 5
26
+ 'm ok' =. m pmat_insert 0 1 _1 1 2
27
+ 'm ok' =. m pmat_insert 1 0 1 2 1
28
+ cons =. pmat_conservation m
29
+ if. cons -: 6 8 do. pass 'pmat_conservation'
30
+ else. (('expected 6 8 got ' , ": cons)) fail 'pmat_conservation' end.
31
+ catch. (13!:12 '') fail 'pmat_conservation' end.
32
+
33
+ NB. ── prop_26 PMat entry shape (sign, monomial ds/dt, row, col) ────────────
34
+ try.
35
+ m =. 2 pmat_new 2
36
+ 'm ok' =. m pmat_insert 0 1 _1 3 4
37
+ e =. {. pmat_entries m
38
+ NB. entry row: sign, ds, dt, row, col
39
+ if. ok *. (e -: _1 3 4 0 1) do. pass 'prop_26'
40
+ else. (('entry=' , ": e)) fail 'prop_26' end.
41
+ catch. (13!:12 '') fail 'prop_26' end.
42
+
43
+ NB. ── prop_27 insert domain checks ────────────────────────────────────────
44
+ try.
45
+ m =. 2 pmat_new 2
46
+ 'm1 ok_bad_row' =. m pmat_insert 5 0 1 0 0
47
+ 'm2 ok_bad_sign' =. m pmat_insert 0 0 2 0 0
48
+ 'm3 ok_good' =. m pmat_insert 0 0 1 1 1
49
+ if. (-. ok_bad_row) *. (-. ok_bad_sign) *. ok_good do. pass 'prop_27'
50
+ else. 'domain checks wrong' fail 'prop_27' end.
51
+ catch. (13!:12 '') fail 'prop_27' end.
52
+
53
+ NB. ── prop_28 grading stub (mirrors C++ always-true) ───────────────────────
54
+ try.
55
+ m =. 2 pmat_new 2
56
+ 'm ok' =. m pmat_insert 0 0 1 1 1
57
+ if. 1 = pmat_validate_grading m do. pass 'prop_28'
58
+ else. 'validate_grading not 1' fail 'prop_28' end.
59
+ catch. (13!:12 '') fail 'prop_28' end.
60
+
61
+ NB. ── prop_29 conservation ────────────────────────────────────────────────
62
+ try.
63
+ m =. 2 pmat_new 2
64
+ 'm ok' =. m pmat_insert 0 0 1 3 5
65
+ 'm ok' =. m pmat_insert 0 1 _1 1 2
66
+ 'm ok' =. m pmat_insert 1 0 1 2 1
67
+ if. (pmat_conservation m) -: 6 8 do. pass 'prop_29'
68
+ else. 'conservation != 6 8' fail 'prop_29' end.
69
+ catch. (13!:12 '') fail 'prop_29' end.
70
+
71
+ NB. ── prop_30 compose preserves shape (rows_A Γ— cols_B) ───────────────────
72
+ try.
73
+ a =. 2 pmat_new 3
74
+ 'a ok' =. a pmat_insert 0 1 1 1 0
75
+ b =. 3 pmat_new 2
76
+ 'b ok' =. b pmat_insert 1 0 1 0 2
77
+ c =. a pmat_compose b
78
+ if. (pmat_shape c) -: 2 2 do. pass 'prop_30'
79
+ else. (('shape=' , ": pmat_shape c)) fail 'prop_30' end.
80
+ catch. (13!:12 '') fail 'prop_30' end.
81
+
82
+ NB. ── prop_31 compose monomial rule (ds+=a.ds, dt+=b.dt; sign*=) ──────────
83
+ try.
84
+ a =. 1 pmat_new 1
85
+ 'a ok' =. a pmat_insert 0 0 1 5 0
86
+ b =. 1 pmat_new 1
87
+ 'b ok' =. b pmat_insert 0 0 _1 0 7
88
+ c =. a pmat_compose b
89
+ e =. {. pmat_entries c
90
+ NB. sign = 1*_1 = -1; ds=5; dt=7; row=0; col=0
91
+ if. e -: _1 5 7 0 0 do. pass 'prop_31'
92
+ else. (('compose entry=' , ": e)) fail 'prop_31' end.
93
+ catch. (13!:12 '') fail 'prop_31' end.
94
+
95
+ NB. ── prop_32 Frobenius = sqrt(#entries) ──────────────────────────────────
96
+ try.
97
+ m =. 2 pmat_new 2
98
+ 'm ok' =. m pmat_insert 0 0 1 1 1
99
+ 'm ok' =. m pmat_insert 0 1 1 2 3
100
+ f =. pmat_frobenius m
101
+ if. 1e_9 > | f - %: 2 do. pass 'prop_32'
102
+ else. (('frobenius=' , ": f)) fail 'prop_32' end.
103
+ catch. (13!:12 '') fail 'prop_32' end.
104
+ ''
105
+ )
106
+
107
+ run_pmat ''
verify/tests/recurrence.ijs ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. Named tests + recurrence props 39–46 (41 narrative SKIP).
4
+
5
+ run_recurrence =: 3 : 0
6
+ if. -. CORE_OK do.
7
+ ('missing ' , FOUNDRY_IJS) blocked 'recurrence_converges'
8
+ '' return.
9
+ end.
10
+
11
+ try.
12
+ cocurrent 'foundry'
13
+ verify_T =: 3 : ', (0.5 * {. y) + 0.3'
14
+ verify_proj =: 3 : '_1 >. 1 <. , y'
15
+ cocurrent 'base'
16
+
17
+ if. 0 = 4!:0 <'rec_run' do.
18
+ 'rec_run not exported' fail 'recurrence_converges'
19
+ '' return.
20
+ end.
21
+
22
+ hist =. (, 1.) rec_run 200 ; T1 ; WP_UNIFORM ; 1e_6 ; (<'verify_T') ; (<'verify_proj')
23
+ st =. REC_STATE_foundry_
24
+ conv =. > 1 { st
25
+ resid =. 99.
26
+ if. 0 < # hist do.
27
+ last =. > {: hist
28
+ resid =. > 6 { last
29
+ end.
30
+
31
+ if. conv *. resid < 1e_6 do. pass 'recurrence_converges'
32
+ else. (('converged=' , (": conv) , ' residual=' , ": resid)) fail 'recurrence_converges' end.
33
+ catch.
34
+ (13!:12 '') fail 'recurrence_converges'
35
+ end.
36
+
37
+ NB. ── prop_39 recurrence equation via rec_step ────────────────────────────
38
+ try.
39
+ cocurrent 'foundry'
40
+ verify_T =: 3 : ', 0.5 * , y'
41
+ verify_proj =: ]
42
+ cocurrent 'base'
43
+ xi =. 0.5 0
44
+ lam =. 0 0.3
45
+ g =. 0.1 0
46
+ x0 =. 1 1
47
+ pair =. x0 rec_step xi ; lam ; g ; (<'verify_T') ; (<'verify_proj') ; 0 ; T1
48
+ xn =. , > 0 { pair
49
+ NB. x'[i] = xi[i]*x[i] + lam[i]*T(x)[i] + g[i]; T=0.5*x
50
+ NB. i0: 0.5*1 + 0*0.5 + 0.1 = 0.6
51
+ NB. i1: 0*1 + 0.3*0.5 + 0 = 0.15
52
+ expect =. 0.6 0.15
53
+ if. 1e_9 > >./ | xn - expect do. pass 'prop_39'
54
+ else. (('x_next=' , ": xn)) fail 'prop_39' end.
55
+ catch. (13!:12 '') fail 'prop_39' end.
56
+
57
+ NB. ── prop_40 contraction condition q < 1-Ξ΅ after soft project ────────────
58
+ try.
59
+ cocurrent 'foundry'
60
+ verify_T =: 3 : ', 0.5 * , y'
61
+ verify_proj =: ]
62
+ cocurrent 'base'
63
+ pair =. (, 1.) rec_step (0.5 0) ; (0 0.2) ; (0) ; (<'verify_T') ; (<'verify_proj') ; 0 ; T1
64
+ info =. > 1 { pair
65
+ q =. > 1 { info
66
+ eps =. > 2 { info
67
+ if. q < 1 - eps do. pass 'prop_40'
68
+ else. (('q=' , (": q) , ' eps=' , ": eps)) fail 'prop_40' end.
69
+ catch. (13!:12 '') fail 'prop_40' end.
70
+
71
+ NB. ── prop_41 unique fixed-point guarantee (narrative) ────────────────────
72
+ 'narrative-only Banach guarantee' skip 'prop_41'
73
+
74
+ NB. ── prop_42 q_estimate coded form ───────────────────────────────────────
75
+ try.
76
+ q =. q_estimate (0.5 0) ; (0 0.2) ; (1 1) ; (0.5 0.5)
77
+ NB. n_xi=0.5, n_lam=0.2, n_T=0.5/1=0.5 β†’ q=0.5+0.2*0.5=0.6
78
+ if. 1e_9 > | q - 0.6 do. pass 'prop_42'
79
+ else. (('q=' , ": q)) fail 'prop_42' end.
80
+ catch. (13!:12 '') fail 'prop_42' end.
81
+
82
+ NB. ── prop_43 soft projection ─────────────────────────────────────────────
83
+ try.
84
+ sp =. ((0.9 0) ; (0 0.9)) soft_project 1.2 0.1
85
+ xi =. , > 0 { sp
86
+ lam =. , > 1 { sp
87
+ NB. target=0.9; scale=0.9/1.2=0.75 β†’ 0.675
88
+ if. (1e_9 > | (0 { xi) - 0.675) *. (1e_9 > | (1 { lam) - 0.675) do. pass 'prop_43'
89
+ else. (('xi=' , (": xi) , ' lam=' , ": lam)) fail 'prop_43' end.
90
+ catch. (13!:12 '') fail 'prop_43' end.
91
+
92
+ NB. ── prop_44 weight budget split 0.7/0.3 of q_star ───────────────────────
93
+ try.
94
+ sched =. synth_weights 1 ; T1 ; WP_UNIFORM
95
+ xi =. {. > 0 { sched
96
+ lam =. {. > 1 { sched
97
+ q_star =. 1 - 0.10
98
+ expect_xi =. q_star * 0.7
99
+ expect_lam =. q_star * 0.3
100
+ if. (1e_9 > | (0 { xi) - expect_xi) *. (1e_9 > | (1 { lam) - expect_lam) do. pass 'prop_44'
101
+ else. (('xi=' , (": xi) , ' lam=' , ": lam)) fail 'prop_44' end.
102
+ catch. (13!:12 '') fail 'prop_44' end.
103
+
104
+ NB. ── prop_45 projector clip [-1,1] ───────────────────────────────────────
105
+ try.
106
+ cocurrent 'foundry'
107
+ verify_T =: ]
108
+ verify_proj =: 3 : '_1 >. 1 <. , y'
109
+ cocurrent 'base'
110
+ NB. xi=1 carries x=5 through affine update; projector clips to 1
111
+ pair =. (, 5.) rec_step (1 0) ; (0 0) ; (0) ; (<'verify_T') ; (<'verify_proj') ; 0 ; T1
112
+ xn =. , > 0 { pair
113
+ if. xn = 1 do. pass 'prop_45'
114
+ else. (('projected=' , ": xn)) fail 'prop_45' end.
115
+ catch. (13!:12 '') fail 'prop_45' end.
116
+
117
+ NB. ── prop_46 residual / convergence ──────────────────────────────────────
118
+ try.
119
+ hist =. (, 1.) rec_run 200 ; T1 ; WP_UNIFORM ; 1e_6 ; (<'verify_T') ; (<'verify_proj')
120
+ st =. REC_STATE_foundry_
121
+ conv =. > 1 { st
122
+ resid =. 99.
123
+ if. 0 < # hist do. resid =. > 6 { > {: hist end.
124
+ if. conv *. resid < 1e_6 do. pass 'prop_46'
125
+ else. (('conv=' , (": conv) , ' resid=' , ": resid)) fail 'prop_46' end.
126
+ catch. (13!:12 '') fail 'prop_46' end.
127
+ ''
128
+ )
129
+
130
+ run_recurrence ''
verify/tests/spectral.ijs ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NB. Copyright (C) 2026 Foundry J contributors
2
+ NB. SPDX-License-Identifier: AGPL-3.0-or-later
3
+ NB. Named tests + spectral props 33–38.
4
+ NB. Core BOXING.md: SpectralResult producers return <fields>; open before indexing.
5
+
6
+ run_spectral =: 3 : 0
7
+ if. -. CORE_OK do.
8
+ r =. 'missing ' , FOUNDRY_IJS
9
+ r blocked 'spectral_contractive'
10
+ r blocked 'spectral_expansive'
11
+ '' return.
12
+ end.
13
+
14
+ NB. Open <SpectralResult> β€” Core sr_open is > after foundry_export
15
+ open =. ]
16
+ if. 3 = 4!:0 <'sr_open' do. open =. sr_open else. open =. > end.
17
+
18
+ Jc =. 2 2 $ 0.2 0.1 0.05 0.15
19
+ Je =. 2 2 $ 0.9 0.3 0.3 0.95
20
+
21
+ NB. ── named tests ─────────────────────────────────────────────────────────
22
+ try.
23
+ res =. open Jc spectral_analyze 0.1
24
+ if. > 1 { res do. pass 'spectral_contractive' else. 'should be contractive' fail 'spectral_contractive' end.
25
+ catch. (13!:12 '') fail 'spectral_contractive' end.
26
+
27
+ try.
28
+ res =. open Je spectral_analyze 0.1
29
+ if. -. > 1 { res do. pass 'spectral_expansive' else. 'should not be contractive' fail 'spectral_expansive' end.
30
+ catch. (13!:12 '') fail 'spectral_expansive' end.
31
+
32
+ NB. ── prop_33 Gershgorin disk bound ───────────────────────────────────────
33
+ try.
34
+ b =. gershgorin_bound Jc
35
+ if. 1e_9 > | b - 0.3 do. pass 'prop_33'
36
+ else. (('bound=' , ": b)) fail 'prop_33' end.
37
+ catch. (13!:12 '') fail 'prop_33' end.
38
+
39
+ NB. ── prop_34 contractive via Gershgorin ──────────────────────────────────
40
+ try.
41
+ res =. open Jc gershgorin_check 0.1
42
+ if. > 1 { res do. pass 'prop_34' else. 'gershgorin_check not contractive' fail 'prop_34' end.
43
+ catch. (13!:12 '') fail 'prop_34' end.
44
+
45
+ NB. ── prop_35 power iteration (Rayleigh) ──────────────────────────────────
46
+ try.
47
+ ev =. Jc power_iteration 100 1e_12
48
+ if. (ev > 0) *. (ev < 0.9) do. pass 'prop_35'
49
+ else. (('power_iteration=' , ": ev)) fail 'prop_35' end.
50
+ catch. (13!:12 '') fail 'prop_35' end.
51
+
52
+ NB. ── prop_36 power_iteration_check contractive predicate ─────────────────
53
+ try.
54
+ res =. open Jc power_iteration_check 0.1 100
55
+ if. > 1 { res do. pass 'prop_36' else. 'PI check not contractive' fail 'prop_36' end.
56
+ catch. (13!:12 '') fail 'prop_36' end.
57
+
58
+ NB. ── prop_37 analyze fallback policy (Gershgorin then optional PI) ───────
59
+ try.
60
+ res =. open Jc spectral_analyze 0.1
61
+ c =. > 1 { res
62
+ used =. > 4 { res
63
+ if. c *. (-. used) do. pass 'prop_37'
64
+ else. (('c=' , (": c) , ' used_pi=' , ": used)) fail 'prop_37' end.
65
+ catch. (13!:12 '') fail 'prop_37' end.
66
+
67
+ NB. ── prop_38 tested contractive / expansive examples ─────────────────────
68
+ try.
69
+ okc =. > 1 { open Jc spectral_analyze 0.1
70
+ oke =. -. > 1 { open Je spectral_analyze 0.1
71
+ if. okc *. oke do. pass 'prop_38'
72
+ else. 'prop_38 example matrices failed' fail 'prop_38' end.
73
+ catch. (13!:12 '') fail 'prop_38' end.
74
+ ''
75
+ )
76
+
77
+ run_spectral ''