Commit Graph

364 Commits

Author SHA1 Message Date
Brummel 6047b38b5c iter architect-iron-law.2: extend ailang-architect with sweep-script invocation + lockstep-checklist for two known cross-file pairings 2026-05-10 20:02:29 +02:00
Brummel 67223c8487 iter architect-iron-law.1: bench/architect_sweeps.sh runs the four design-md-consolidation sweeps against DESIGN.md 2026-05-10 20:01:47 +02:00
Brummel 1f5689a952 plan: architect-iron-law extension — sweep script + lockstep-checklist 2026-05-10 20:00:40 +02:00
Brummel 1de300ed2c fieldtest close: Floats — B1 fixed, F1+G1 documented, architect-checklist queued 2026-05-10 17:14:09 +02:00
Brummel 6be5abf23a fix: Pattern::Lit::Float typecheck-reject is unreachable through check_module 2026-05-10 17:10:31 +02:00
Brummel 23b625f326 test: red for Pattern::Lit::Float not rejected through full check pipeline
Pins fieldtest finding B1 (docs/specs/2026-05-10-fieldtest-floats.md).
DESIGN.md and JOURNAL Floats.3 promise that pattern-matching on a
Float literal is hard-rejected at typecheck via
CheckError::FloatPatternNotAllowed, but the rejection only fires when
typecheck is reached directly. The full check pipeline runs
ailang_core::desugar::desugar_module first, and build_eq rewrites
Pattern::Lit { Literal::Float } arms into (== scrutinee 1.5_FLOAT)
before typecheck — so the existing iter-3.4 reject arm at lib.rs:2316
is unreachable on input flowing through check / check_module /
check_workspace.

The existing reject_float_pattern_in_match test in builtins.rs calls
synth(...) directly on a hand-built Term::Match, bypassing desugar; it
passes today but does not protect the spec'd property. This new test
exercises check(&m) end-to-end and asserts the FloatPatternNotAllowed
error — currently fails because check returns Ok(CheckedModule).

GREEN side handed off to skills/implement mini-mode.
2026-05-10 17:04:12 +02:00
Brummel 1ce2ff42dc fieldtest follow-up: G1 (DESIGN.md NaN-print Unspecified) + F1 roadmap entry 2026-05-10 16:59:18 +02:00
Brummel 2052f4dfcc fieldtest: floats — 4 examples, 6 findings (1 bug, 1 friction, 1 spec_gap, 3 working) 2026-05-10 16:57:38 +02:00
Brummel 741f3bbf08 audit close: Floats milestone — clean (architect/bench/rustdoc all green; carry-on) 2026-05-10 16:47:10 +02:00
Brummel 41dd2ddc1b floats iter 5: JOURNAL — iter-5 close + Floats milestone close 2026-05-10 16:40:37 +02:00
Brummel 965e628c52 floats iter 5.4: roadmap — mark Floats [x] + unblock Post-22 Prelude 2026-05-10 16:38:45 +02:00
Brummel 47b32bff3d floats iter 5.3: DESIGN.md — new §Float semantics subsection (A5 determinism contract) 2026-05-10 16:38:24 +02:00
Brummel 2d2646afa7 floats iter 5.2: DESIGN.md — Float in primitive types + refreshed builtins list 2026-05-10 16:37:42 +02:00
Brummel ea8988b529 floats iter 5.1: prose renders Float literals (finite + NaN/Inf) 2026-05-10 16:36:12 +02:00
Brummel fd287c9740 plan: floats iter 5 — prose + DESIGN.md + milestone close 2026-05-10 16:33:35 +02:00
Brummel 73d65baa81 floats iter 4: JOURNAL — iteration close (codegen + E2E) 2026-05-10 16:28:10 +02:00
Brummel 9764b616ce floats iter 4.6: codegen io/print_float + examples/floats.ail.json E2E fixture 2026-05-10 16:25:25 +02:00
Brummel bde5aafb03 floats iter 4.5: codegen Float constants nan/inf/neg_inf as hex-double SSA values 2026-05-10 16:20:37 +02:00
Brummel 613aa39f0f floats iter 4.4 fixup: float_to_str returns CodegenError::Internal instead of panic 2026-05-10 16:18:39 +02:00
Brummel 581144a4f9 floats iter 4.4: codegen neg/int_to_float/float_to_int_truncate/is_nan + float_to_str-deferred 2026-05-10 16:15:39 +02:00
Brummel 3869641a31 floats iter 4.3: codegen Float comparison arms (fcmp olt/ole/ogt/oge/UNE) + lower_eq Float 2026-05-10 16:10:13 +02:00
Brummel 2a290704df floats iter 4.2 fixup: 3-tuple return for builtin_binop_typed + classifier helper 2026-05-10 16:07:11 +02:00
Brummel 8044a4d98c floats iter 4.2: codegen arithmetic dispatch on arg type — fadd/fsub/fmul/fdiv double 2026-05-10 16:01:35 +02:00
Brummel ac5e17e541 floats iter 4.1: codegen primitive registration + Float literal hex-double lowering 2026-05-10 15:54:20 +02:00
Brummel 0c514e034b plan: floats iter 4 — codegen + runtime (Float lowering paths + E2E fixture) 2026-05-10 15:51:20 +02:00
Brummel dbec90cefd floats iter 3: JOURNAL — iteration close (typecheck + builtins) 2026-05-10 15:43:31 +02:00
Brummel d6da5c26b1 floats iter 3.4: typecheck rejects Pattern::Lit Float with FloatPatternNotAllowed 2026-05-10 15:40:33 +02:00
Brummel fd3f74cfa0 floats iter 3.3: install Float constants nan/inf/neg_inf + io/print_float effect op 2026-05-10 15:35:19 +02:00
Brummel 60a4c687b3 floats iter 3.2: install neg/int_to_float/float_to_int_truncate/float_to_str/is_nan 2026-05-10 15:31:14 +02:00
Brummel 6890aa244f floats iter 3.1 fixup: correct stale ==-comparison comment + asymmetric Float test args + drop spec-section reference 2026-05-10 15:28:55 +02:00
Brummel 0981804dd3 floats iter 3.1: widen +/-/*/// and !=/</<=/>/>= to polymorphic forall a 2026-05-10 15:24:13 +02:00
Brummel 00a1c5f0e7 plan: floats iter 3 — typecheck + builtins (widen + install + Pattern::Lit::Float reject) 2026-05-10 15:20:09 +02:00
Brummel 4ccf1f25c1 floats iter 2: JOURNAL — iteration close (surface layer) 2026-05-10 15:14:02 +02:00
Brummel c619697a76 floats iter 2.3: surface print emits shortest round-trippable decimal with .0 fallback 2026-05-10 15:11:31 +02:00
Brummel f62bff08a3 floats iter 2.2: parser accepts Tok::Float in term and pat-lit positions 2026-05-10 15:07:39 +02:00
Brummel f960e39f8b floats iter 2.1 fixup: drop task-tags + refresh stale prose + uppercase-E + leading-dot tests 2026-05-10 15:04:50 +02:00
Brummel d0c9133ae4 floats iter 2.1: Tok::Float + LexError::InvalidFloat + spec-A2 grammar validator 2026-05-10 15:00:46 +02:00
Brummel 6664af4995 plan: floats iter 2 — surface lex + parse + print (round-trip property) 2026-05-10 14:57:34 +02:00
Brummel f227cce846 floats iter 1: JOURNAL — iteration close (schema layer) 2026-05-10 14:50:42 +02:00
Brummel b2d31824a1 floats iter 1.4 fixup: drop intra-doc-links to private hex_u64 (rustdoc baseline preservation) 2026-05-10 14:49:21 +02:00
Brummel 1a4e2f04b7 floats iter 1.4: refresh canonical.rs 'no floats' doc comment 2026-05-10 14:47:43 +02:00
Brummel 7c95a69780 floats iter 1.3: bit-stability tests for Literal::Float 2026-05-10 14:45:34 +02:00
Brummel 93bae2d02a floats iter 1.2 fixup: replace iter-N comment with durable rationale for explicit assertions 2026-05-10 14:44:14 +02:00
Brummel aa5b88e8d4 floats iter 1.2: register Float as a primitive type name 2026-05-10 14:42:23 +02:00
Brummel 93fe2da33c floats iter 1.1 fixup: trim form_a.md FLOAT bullet to match neighbour style 2026-05-10 14:40:16 +02:00
Brummel ec2811194b floats iter 1.1: Literal::Float variant + canonical hex serde + drift-test anchors 2026-05-10 14:36:08 +02:00
Brummel cdc9d64169 plan: floats iter 1 — schema layer (Literal::Float + canonical hex serde + primitive registration) 2026-05-10 14:26:17 +02:00
Brummel e37366f8dd spec: floats LLVM-IR fixes — fcmp une for !=, synth.rs sites, container-slot precision
Three classes of fix from the LLVM-IR audit:

1. != on Float: fcmp une, NOT fcmp one. one is 'ordered and not
   equal' (false for nan!=nan, breaks IEEE / user-fixed constraint).
   une is 'unordered or not equal' (true for nan!=nan, matches IEEE
   and Rust f64::ne).

2. crates/ailang-codegen/src/synth.rs touches the Float primitive at
   five sites the original spec missed: llvm_type, builtin_ail_type,
   builtin_effect_op_ret, type_descriptor (descriptor 'Fl' to avoid
   collision with ADT-name F-prefix), builtin_binop (becomes a
   transitional artefact, replaced by type-dispatched helper).

3. Float literals lower as LLVM hex-float syntax (double 0x4014...);
   nan/inf/neg_inf as direct SSA double constants at use site (NOT
   via the __unreachable__ analogue, which is a terminator
   instruction not a value); container slot layout precision
   (monomorphisation vs bitcast).
2026-05-10 14:14:54 +02:00
Brummel f7e2c3ee7a spec: floats — operators polymorphic over {Int, Float} + NaN/Inf constants + is_nan
Mainstream-aligns the Float surface: + - * / < <= > >= become
forall-quantified with codegen-dispatch on Int|Float (parallel to
today's == path), instead of the original draft's wort-style
fadd/flt/etc. Adds nan/inf/neg_inf as builtin constants and
is_nan : (Float) -> Bool. % stays Int-only (no fmod yet).

Iteration plan now flags iter 3 and iter 4 as widening passes
that must hold the no-Int-regression line.
2026-05-10 14:08:35 +02:00
Brummel 406bde0efc spec: floats milestone — Float as IEEE-754 binary64 primitive 2026-05-10 13:54:55 +02:00