Skip to content

t27b: glass_window.t27 lowers -- rem_pio2f pointer call fixed, refusals name both types, @sin/@cos f32 wired (Closes #11788) - #11813

Merged
gHashTag merged 8 commits into
masterfrom
rel-11788-extern-boundary
Oct 23, 2026
Merged

gHashTag merged 8 commits into
masterfrom
rel-11788-extern-boundary

Conversation

@gHashTag

Copy link
Copy Markdown
Collaborator

Closes #11788.

Root cause

glass_window.t27 pulls specs/tri/t27b/libm.t27 through any libm builtin; lowering the spliced module reached t27b_libm_rem_pio2f, whose large branch still called t27b_libm_rem_pio2_large as (x*, y*, e0, nx, prec) after that routine had been ported to (x0, x1, x2, e0, nx) -> (n, y0, y1). A *[1]f64 reached the f64 coercion and the reject read type mismatch at line 1730 (expected f64, found a pointer) -- a merged line that moved with nothing and named no construct. The line did not map to the source because self.line was stale: the construct lived inside the spliced libm closure.

What changed

  • libm.t27: rem_pio2f returns (n, y) by the file's own port convention; the large branch passes the x pieces as values (nx = 1 reads only x0); sinf/cosf destructure. The stray top-level return after cosf (already on master, never lowered through the splice) is deleted. New sweeps hold sinf/cosf to @sin/@cos of an f32 bit for bit across every branch, into rem_pio2f's large one.
  • libm_plan.t27: @sin/@cos of an f32 wire to __t27b_libm_sinf/__t27b_libm_cosf -- the ports existed and sat unwired behind REFUSE_NO_F32 (the why-text also claimed tanh unported; it is wired). The plan sweep now walks all twenty-one builtins where it stopped at nineteen, so SIN/TANH are covered for the first time.
  • lower.rs (+10/-10, foreign debt does not grow): the pointer arms of coerce and cond_val name the pointee -- expected f64, found a pointer to *[1]f64 -- so a refusal carries both conflicting types next to the line (t27b: glass_window.t27 fails on master -- type mismatch (expected f64, found a pointer) blocks make t27os #11788's requirement); the redundant Val::P enum special cases fold into type_name. source.rs pins the new text. Replacement plan for this glue stays on port epic epic: t27b in t27 -- port the backend and its tooling from Rust/Python into .t27 #6198.

Evidence

  • make t27os builds target/t27os/T27OS.app and t27os-pty (build 7215, ad hoc signed); the window launches.
  • libm.t27: 32/32 under t27c test-report AND under t27b test, 0 vacuous. libm_plan.t27: 18/18 both sides.
  • cargo test -p t27b: 162/162.
  • Seals re-stamped for both specs; check_seal_currency leaves only the five t27f rows master already carries; check_seal_coverage exits 0.

Follow-ups (not in this PR)

  • The fixed-bits conformance spec for the f32 trig family (specs/tri/t27b/conformance/libm_trigf.t27, in the libm_logf.t27 shape) once the reference bits are measured on the lab.
  • Owner's material rule, said 2026-10-23: matte black glass only in the compact (docked) mode; the full window is opaque #000000 -- to be isolated as the single material switch in glass_window.t27 with tests pinning it.

gHashTag and others added 4 commits October 19, 2026 10:01
…O undefined symbols + BRANCH26 (#8946)

A fn whose body is @extern("sym") imports the C symbol sym. lower names it @sym (a name t27 source
cannot declare), passes a str or slice argument as its bytes' address, and codegen emits each call's bl
as a tagged data ref that only macho.t27 resolves: one ARM64_RELOC_BRANCH26 against an undefined _sym
nlist, distinct names shared, sorted after the externals. Images without imports are byte-identical
(reloc_slot is 2*i). The Rust glue nets negative by compacting the a64.rs disassembler tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…8946)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l-11788-extern-boundary

# Conflicts:
#	gen/rust/tri/t27b/macho.rs
#	specs/tri/t27b/macho.t27
…2_large with pointers, and the reject named nothing (Closes #11788)

The chain that blocked make t27os on master: glass_window.t27 pulls
specs/tri/t27b/libm.t27 through any libm builtin; lowering the spliced
module reached t27b_libm_rem_pio2f, whose large branch still called
t27b_libm_rem_pio2_large as (x*, y*, e0, nx, prec) after that routine
had been ported to (x0, x1, x2, e0, nx) -> (n, y0, y1). A *[1]f64
reached the f64 coercion and the reject read 'type mismatch at line
1730 (expected f64, found a pointer)', naming nothing actionable.

- libm.t27: rem_pio2f returns (n, y) by the file's own port convention;
  its large branch passes the x pieces as values (nx = 1 reads only
  x0); sinf and cosf destructure. The stray top-level 'return' after
  cosf (already on master, never lowered through the splice) is gone.
  New sweeps hold sinf and cosf to @sin/@cos of an f32 bit for bit
  across every branch, into rem_pio2f's large one: 32/32 under the
  reference and under t27b, 0 vacuous.
- libm_plan.t27: @sin and @cos of an f32 wire to __t27b_libm_sinf and
  __t27b_libm_cosf -- the ports sat unwired behind REFUSE_NO_F32.
  has_f32, routine, the why text and the plan's tests follow; the plan
  sweep now walks all twenty-one builtins where it stopped at nineteen
  (18/18 both sides).
- lower.rs (+10/-10): the pointer arms of coerce and cond_val name the
  pointee ('expected f64, found a pointer to *[1]f64'), so a refusal
  carries both conflicting types next to the line, and the redundant
  Val::P enum special cases fold into type_name -- the foreign debt
  does not grow (owner rule 2026-10-09). source.rs pins the new text.

Evidence: make t27os builds T27OS.app and t27os-pty here (build 7215);
the window launches. cargo test -p t27b 162/162. Seals re-stamped for
both specs (check_seal_currency: the five stale rows left are the t27f
ones master already carries; check_seal_coverage exits 0).
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-23 12:56:37 UTC

Summary

Status Count
Total Open PRs 31
PRs with Failing Checks 27
PRs with All Checks Green 4
READY 2
FAILING 27
PENDING 0
NO CHECKS YET 0

These columns do not partition: 2 + 27 + 0 + 0 = 29, and there are 31 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=5aec047d42ec != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@tri-claw

tri-claw Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary by t27-bees

Checked by the t27 compiler

t27c parse, parse-complete and typecheck on each changed .t27 file at d9ae161. Nothing was generated, built or run. A pass means the file is well formed, not that it is right.

  • specs/t27os/profile.t27: parses and typechecks.
  • specs/tri/t27b/conformance/libm_trigf.t27: parses and typechecks.
  • specs/tri/t27b/libm.t27: parses and typechecks.
  • specs/tri/t27b/libm_plan.t27: parses and typechecks.

Read by the model

This PR fixes a rem_pio2f calling-convention mismatch that surfaced when glass_window.t27 spliced libm.t27, wires @sin/@cos for f32 in the libm plan, improves pointer-type rejection messages to show both conflicting types, and adds a conformance spec for the f32 trig family.

Worth a look

  • cli/t27b/src/lower.rs (lines 3206–3212, 3279–3286): The Val::P arms for cond_val and coerce now always print the pointee type via type_name. This removes the special LTy::Enum branch; if type_name does not render enum pointers distinctly, the new message could be less specific than the old one for enum pointers.
  • gen/rust/tri/t27b/libm_plan.rs (lines 133–135, 308–314): has_f32 now returns true for SIN, COS, and TANH (only LOG1P and MOD are excluded), and routine adds CALL_F32 entries for SIN/COS only. No CALL_F32 arm for TANH appears in the diff; if the planner selects f32 for TANH, it will have no routine to call.
  • gen/rust/tri/t27b/libm_plan.rs (line 444): The REFUSE_NO_F32 why-text drops the claim that tanh is unported, but the diff does not show a corresponding CALL_F32 routine for TANH. Verify that tanhf is actually wired elsewhere.
  • cli/t27b/tests/source.rs (line 1220): The test expectation changes from "found Dir" to "found a pointer to Dir" to match the new message format — correct for this change.
  • specs/t27os/glass_window.t27 and specs/tri/t27b/libm.t27: Not shown in the provided diff but central to the fix (rem_pio2f signature, sinf/cosf destructuring, large-branch wiring). The root-cause error originated here; verify the calling convention and value-passing in the large branch.

Read: 11 files, +516 -282, the whole diff up to 60000 characters (the rest was not read). Head d9ae161. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

…dth, opaque black #000000 in the full window and full screen

Owner, 2026-10-23, said directly: the matte glass was in the compact
(docked) mode, and in the full one black #000000 -- isolate it and do
not break it. Until today the decision lived in a full-screen bool
threaded through backdrop_alpha, tint_alpha and the surface family, so
the full 960x540 window rendered as glass.

The rule now lives in exactly one pure fn, on_glass(sw): the docked
panel is PANEL_W wide, the full window W_PT, so the scene width the
frames already carry decides, and docking resizes the window -- the
material follows the dock with no second state to keep in step (a
module var is impossible here: the Mach-O object has no writable data
section, VarDecl(module, object file)). The readers are backdrop_alpha,
backdrop_clears, tint_alpha, surface_alpha_with and draw_ground's
frost; every draw path that needed the width now carries sw (the card
chain, the side rows, the lane tail, the plate and the page fns) --
t27b typechecks the whole file, no decision left outside on_glass.

Tests pin the mapping both ways: glass at PANEL_W (backdrop 0.0, tint
0.55, surfaces their tints, frost on), opaque #000000 at W_PT (backdrop
1.0, tint 1.0, every surface 1.0, the same as the frame and the layer).
62/62 under t27b test. The reference test-report block on this file is
master's (the master text blocks the same way at spec.zig:217) -- the
window's gate is t27b, and make t27os builds and launches (build 7216).
… (owner, 2026-10-23)

The avatar picture and the name come from the GitHub user after the
sign-in that already exists (share.t27's device flow): the host fetches
the signed-in user and writes both through the existing atomic
profile.t27p / avatar.png contract. Nothing manual. The recorded
decision lives in profile.t27's header with what stays as the fallback
until the sign-in slice of #11560 is wired.
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-23 13:27:16 UTC

Summary

Status Count
Total Open PRs 28
PRs with Failing Checks 25
PRs with All Checks Green 3
READY 3
FAILING 25
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=5aec047d42ec != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

…ncy, the reference boundary

- libm_trigf.t27 (conformance, the libm_logf shape): @sin and @cos of an
  f32 held to the reference bit for bit -- 3000+2990-point sweeps over
  both bit patterns (every exponent, both signs), 300 points inside
  rem_pio2f's large branch, dense near one, the kernel bands, fixed
  reference bits extracted from this repository's own reference via the
  assert_eq prelude, signed zero on the bits, inf/NaN held to 'is a NaN'
  per side. 5/5 under t27c test-report and under t27b test, 0 vacuous.
- seal currency: compiler/cli/git.t27 and the three t27f page specs
  re-sealed where master's merge train moved the specs after sealing --
  check_seal_currency reports 0 STALE again; check_seal_coverage 0 with
  the new spec's seal (3046 seals).
- glass_window.t27 header: the reference block on this file is by
  construction -- gen-zig renders @extern verbatim and Zig takes two
  arguments (master's text blocks the same way). The gates that hold it
  are t27b and make t27os; the extern-stub slice for gen-zig is filed
  with evidence on #5980.
…aster's copy

# Conflicts:
#	.trinity/seals/cli_git_commands.json
#	.trinity/seals/git_commands.json
#	.trinity/seals/t27f_T27fWorkGraph.json
#	.trinity/seals/t27f_display_list.json
#	.trinity/seals/t27f_export_video.json
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-23 13:44:47 UTC

Summary

Status Count
Total Open PRs 27
PRs with Failing Checks 23
PRs with All Checks Green 4
READY 3
FAILING 23
PENDING 0
NO CHECKS YET 0

These columns do not partition: 3 + 23 + 0 + 0 = 26, and there are 27 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=5aec047d42ec != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag enabled auto-merge October 23, 2026 13:45
@gHashTag
gHashTag merged commit f69b8a2 into master Oct 23, 2026
27 of 32 checks passed
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.

t27b: glass_window.t27 fails on master -- type mismatch (expected f64, found a pointer) blocks make t27os

1 participant