Skip to content

feat(ring-0): frozen stage-0 + first green parse [SEED-0] - #3

Merged
gHashTag merged 1 commit into
masterfrom
ring/0-const-literal
Apr 4, 2026
Merged

gHashTag merged 1 commit into
masterfrom
ring/0-const-literal

Conversation

@gHashTag

@gHashTag gHashTag commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Closes #2

Ring-0 of the oak. Ghuloum step 1+2.

Changes

  • Fixed 10 bugs in bootstrap/src/compiler.rs:
    • Bug 1: lexer.tokenize() consumed all tokens before Parser could use them
    • Bug 2: No // line comment support
    • Bug 3: No string literal "..." support
    • Bug 4: No module statement parsing (with hyphenated names)
    • Bug 5: No use/using statement handling
    • Bug 6: Hex literals missing a-f/A-F digit support
    • Bug 7: Function/test/invariant/bench bodies crash on complex expressions (now brace-skip)
    • Bug 8: const = enum(...), const = struct { }, array types not handled
    • Bug 9: Semicolon at column 1 incorrectly treated as comment
    • Bug 10: Negative numbers like -1 not combined in const parsing
  • Fixed main.rs async main to respect server feature flag
  • t27c parse tests/ring0_trivial.t27 → SUCCESS
  • t27c parse specs/base/types.t27 → SUCCESS
  • Created stage0/FROZEN_HASH
  • Created docs/SEED-RINGS.md

phi^2 + 1/phi^2 = 3 | TRINITY

- Fix lexer: // comments, hex/binary/string literals, semicolons
- Fix parser: module, use, const forms, fn headers, brace-skip bodies
- Fix critical bug: lexer.tokenize() exhaustion before Parser
- Create tests/ring0_trivial.t27
- Create stage0/FROZEN_HASH
- Create docs/SEED-RINGS.md

Closes #2
@gHashTag
gHashTag merged commit 0bf7bbb into master Apr 4, 2026
1 check passed
gHashTag added a commit that referenced this pull request May 15, 2026
Closes #646
Refs gHashTag/trinity-fpga#114

* Extend coq/IGLA/RMarker.v holo_op alphabet with OP_SPARSE_SKIP
  (TRI-27 ISA 0xE1, Wave-33 Lever #3 TENET sparsity-aware LUT skip).
* Add new Lemma tenet_no_star : rtl_uses_star OP_SPARSE_SKIP = false.
* Introduce trios-coq/IGLA/Tenet.v with depth-5 alphabet chain proof
  Theorem tenet_safe (5 ops: LUT, BitROM, SPARSE_SKIP, NoC, MUX_1x2).
* All proven by 'reflexivity' / 'apply holographic_no_star'.
* Register Tenet.v in trios-coq/_CoqProject.
* Local coqc 8.20.1 verification: RMarker.vo + Tenet.vo build clean.

Strategic ref: trios docs/strategic/TOPS-LEVERS-2026-05-16-001.md
Anchor: phi^2 + phi^-2 = 3 · DOI 10.5281/zenodo.19227877
R5-HONEST · R7 falsifier W-102-A (BitNet b1.58-3B sparsity >= 25%)
R15 sacred-synth-gate · R18 LAYER-FROZEN (purely additive)

Signed-off-by: Vasilev Dmitrii <admin@t27.ai>
gHashTag added a commit that referenced this pull request May 15, 2026
…#645)

Closes #646
Refs gHashTag/trinity-fpga#114

* Extend coq/IGLA/RMarker.v holo_op alphabet with OP_SPARSE_SKIP
  (TRI-27 ISA 0xE1, Wave-33 Lever #3 TENET sparsity-aware LUT skip).
* Add new Lemma tenet_no_star : rtl_uses_star OP_SPARSE_SKIP = false.
* Introduce trios-coq/IGLA/Tenet.v with depth-5 alphabet chain proof
  Theorem tenet_safe (5 ops: LUT, BitROM, SPARSE_SKIP, NoC, MUX_1x2).
* All proven by 'reflexivity' / 'apply holographic_no_star'.
* Register Tenet.v in trios-coq/_CoqProject.
* Local coqc 8.20.1 verification: RMarker.vo + Tenet.vo build clean.

Strategic ref: trios docs/strategic/TOPS-LEVERS-2026-05-16-001.md
Anchor: phi^2 + phi^-2 = 3 · DOI 10.5281/zenodo.19227877
R5-HONEST · R7 falsifier W-102-A (BitNet b1.58-3B sparsity >= 25%)
R15 sacred-synth-gate · R18 LAYER-FROZEN (purely additive)

Signed-off-by: Vasilev Dmitrii <admin@t27.ai>
Co-authored-by: Vasilev Dmitrii <admin@t27.ai>
gHashTag added a commit that referenced this pull request Jun 1, 2026
feat(ring-0): frozen stage-0 + first green parse [SEED-0]
gHashTag added a commit that referenced this pull request Jun 1, 2026
…#645)

Closes #646
Refs gHashTag/trinity-fpga#114

* Extend coq/IGLA/RMarker.v holo_op alphabet with OP_SPARSE_SKIP
  (TRI-27 ISA 0xE1, Wave-33 Lever #3 TENET sparsity-aware LUT skip).
* Add new Lemma tenet_no_star : rtl_uses_star OP_SPARSE_SKIP = false.
* Introduce trios-coq/IGLA/Tenet.v with depth-5 alphabet chain proof
  Theorem tenet_safe (5 ops: LUT, BitROM, SPARSE_SKIP, NoC, MUX_1x2).
* All proven by 'reflexivity' / 'apply holographic_no_star'.
* Register Tenet.v in trios-coq/_CoqProject.
* Local coqc 8.20.1 verification: RMarker.vo + Tenet.vo build clean.

Strategic ref: trios docs/strategic/TOPS-LEVERS-2026-05-16-001.md
Anchor: phi^2 + phi^-2 = 3 · DOI 10.5281/zenodo.19227877
R5-HONEST · R7 falsifier W-102-A (BitNet b1.58-3B sparsity >= 25%)
R15 sacred-synth-gate · R18 LAYER-FROZEN (purely additive)

Signed-off-by: Vasilev Dmitrii <admin@t27.ai>
Co-authored-by: Vasilev Dmitrii <admin@t27.ai>
gHashTag added a commit that referenced this pull request Jun 1, 2026
…#645)

Closes #646
Refs gHashTag/trinity-fpga#114

* Extend coq/IGLA/RMarker.v holo_op alphabet with OP_SPARSE_SKIP
  (TRI-27 ISA 0xE1, Wave-33 Lever #3 TENET sparsity-aware LUT skip).
* Add new Lemma tenet_no_star : rtl_uses_star OP_SPARSE_SKIP = false.
* Introduce trios-coq/IGLA/Tenet.v with depth-5 alphabet chain proof
  Theorem tenet_safe (5 ops: LUT, BitROM, SPARSE_SKIP, NoC, MUX_1x2).
* All proven by 'reflexivity' / 'apply holographic_no_star'.
* Register Tenet.v in trios-coq/_CoqProject.
* Local coqc 8.20.1 verification: RMarker.vo + Tenet.vo build clean.

Strategic ref: trios docs/strategic/TOPS-LEVERS-2026-05-16-001.md
Anchor: phi^2 + phi^-2 = 3 · DOI 10.5281/zenodo.19227877
R5-HONEST · R7 falsifier W-102-A (BitNet b1.58-3B sparsity >= 25%)
R15 sacred-synth-gate · R18 LAYER-FROZEN (purely additive)

Signed-off-by: Vasilev Dmitrii <admin@t27.ai>
Co-authored-by: Vasilev Dmitrii <admin@t27.ai>
gHashTag added a commit that referenced this pull request Jun 13, 2026
…) (#1065)

* fix(codegen): handle bias formulas in numeric format SSOT (closes #1064)

The bias field in formats_catalog.t27 can carry either a literal int or
a rule-derived formula like 2^N-1. Two formats use the formula form:

  gf512:  bias = 2^194-1
  gf1024: bias = 2^390-1

Both were added by PR #1051 as limit-of-ladder phi-aligned formats. The
parser did int(bias_str) unconditionally, which raised ValueError, so
both rows were silently dropped with a "malformed CATALOG line" warning.

This is why count drifted: committed gen/ JSON shipped 77 (pre-#1051),
post-#1051 SSOT carries 83 raw lines, codegen yielded 81 even after a
fresh re-run, paper #3 (arXiv:2606.09686) claims 84. Four sources of
truth, none matching. See issue #1064 for the full audit.

Fix:
- parse_bias(s) helper: tries int(); falls back to evaluating simple
  2^N+offset forms within int64 range; otherwise returns sentinel -2
  with the raw string in a new bias_formula field
- Format dataclass: adds bias_formula: str (preserves the raw SSOT
  string for every row, including the literal-int cases for symmetry)
- All existing emitters (Rust struct, C header, TS interface, Python,
  Markdown table, etc.) continue to render the int bias field as
  before; bias_formula appears only in JSON and python emitter where
  asdict() picks it up automatically -- non-breaking for the typed
  emitters that hardcode their Format schema.

Verification after fix:
  $ python3 tools/gen_formats_catalog.py specs/numeric/formats_catalog.t27 gen/numeric/
  $ python3 -c "import json; print(json.load(open('gen/numeric/formats_catalog.json'))['count'])"
  83

gf512 and gf1024 now appear in the JSON with bias=-2 and the formula
preserved in bias_formula. Downstream tools that need the actual i64
value can carry the string forward and evaluate at use-site (mpmath
or big-int arithmetic) without losing provenance.

This does NOT yet reconcile SSOT 83 vs paper #3 claim of 84; that
delta is the MXFP6 split + standalone E8M0 in Table 1 vs the SSOT's
collapsed mxfp6 row + Microscaling cluster layout. See #1064 for the
follow-up plan. The CI invariant (raw line count == JSON count) will
land in a separate PR.

Refs: #1051 (GF ladder expansion), #1063 (HF Discovery thread), #1064

* fix(codegen): revert auto-generated gen/ artefacts, add NOW.md entry

PR #1065 originally committed regenerated gen/numeric/* outputs alongside
the source fix in tools/gen_formats_catalog.py. Per L2 generation rules,
gen/ artefacts must be auto-regenerated post-merge by ./scripts/tri gen,
not committed in source PRs.

This commit:
- reverts gen/numeric/* back to master state
- keeps the source fix (tools/gen_formats_catalog.py) intact
- adds docs/NOW.md entry per NOW Sync Gate

Closes #1064

---------

Co-authored-by: gHashTag <playra@trinity-s3ai.org>
Co-authored-by: gHashTag <admin@t27.ai>
@gHashTag
gHashTag deleted the ring/0-const-literal branch June 16, 2026 13:44
gHashTag added a commit that referenced this pull request Aug 5, 2026
feat(lang): wrapping arithmetic operators -% and *% (R7-loop #3, supersedes #1660)
gHashTag added a commit that referenced this pull request Aug 21, 2026
The 'build' check owned by .github/workflows/coq-kernel.yml has failed on
every master run since it was added (run #3, 2026-04-06 .. run #173).
Steps 5-9 of the job have never executed once. This is a different check
from cli-tri.yml's 'build', which shares the name and masks it in the
check-runs API.

Cause 1: the job runs coqorg/coq:8.19 with --user root, but the image's
initialised opam root belongs to the coq user at /home/coq/.opam. As root
HOME=/root has no .opam, so opam exited 50. Set job-level OPAMROOT rather
than running opam init, which would rebuild Coq into an empty root while
coqc/coqchk on PATH still came from the image switch.

Cause 2, latent behind cause 1: 'cd bootstrap && cargo build --release'
then './target/release/t27c' resolves to bootstrap/target/release/t27c,
but bootstrap is a member of the root cargo workspace, so the binary
lands in the repo-root target/. Build with -p t27c from the root.

The step is not weakened: coq-flocq is still installed and no failure is
suppressed. coq/Kernel/PhiFloat.v has a hard Flocq import.

Closes #2320
gHashTag added a commit that referenced this pull request Oct 9, 2026
…s.t27 (Closes #8270) (#8272)

Measured 2026-10-09: the swarm's first release (job #3, t27c 0.5.2) spent
about 90 of 92 minutes at step 3, release-workflow, waiting for a runner.
That WAIT step is asked again by every round: one GitHub read and one log
entry per round, about 180 of each for one wait, and the wait moves only
while a process runs rounds. A Queen deploy drains for 1800 s.

New card specs/queen/waits.t27 (module QueenWaits, 22 pub fns):
- states WAITING/RESOLVED/EXPIRED/CANCELLED; state_after, transition_allowed,
  is_terminal: only a waiting row moves.
- wake rule: wake_action (resolution first, then expiry, then the wake time;
  a keyed row's wake time is a CHECK, a keyless row's is its answer) and
  due_in_seconds, which agrees with it on a 72-row grid.
- expiry cap: expiry_seconds (one day), job_wait_seconds (a job step keeps
  its first deadline).
- checks of a key: check_after_seconds 30 s doubling to 240 s,
  recheck_in_seconds never past the expiry, check_event. The 90-minute wait
  costs 24 reads instead of about 180.
- fencing: epoch_after_claim, write_lands; delivers_wake only for the write
  that landed; more_now for a full batch.
- poll and NOTIFY: poll_seconds ignores whether the host listens,
  beat_after_seconds, pass_on_hint (coalesced).
- deploy: DEPLOY_WRITES_WAITS false, pickup_after_seconds (a claimed row
  waits out its 60 s claim, any other is taken at once).
- jobs: round_visits_job (a parked job is not visited), step_outcome.

Checks (this commit):
- t27c parse, typecheck, gen-rust, gen-verilog, gen-c, gen-js: exit 0 each.
- t27c test-report: 12 tests, 12 pass, 0 FAIL, 2 invariants proved at
  comptime, vacuous passes 0 of 12.
- gen-c + zig 0.16.0 wasm32-wasi, every fn exported: two builds, one hash
  (sha256 5068962a983f229fb4c472a1f29a62366de8afd0b16abb50dacdcb19877ea32c).
- 25 negative controls (each rule broken once, then restored): 22 make a
  named test FAIL, 3 constant changes block compilation at the invariant.
- t27c seal --save: .trinity/seals/queen_QueenWaits.json.

Not established here: the runtime. It is a separate issue in gHashTag/trios
(part of trios#1712, branch actors-next).

Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SEED-0] Ring-0: Frozen stage-0 + first green parse (Ghuloum step 1)

1 participant