v0.19 Staging #1430

Open
vyzo wants to merge 63 commits from v0.19-staging into master
Owner

Staging Branch for v0.19 development

Staging Branch for v0.19 development
This started as a rework of the logging system, but it has expanded to
touch some other aspects... to the point that it kickstarted the v0.19
development branch.

Lot's of things changing, this is just the base

---------

Co-authored-by: François-René Rideau <fare@tunes.org>
Co-authored-by: Francois-Rene Rideau <fare@tunes.org>
Reviewed-on: #1431
basic format writer implementation and all its dependencies..
also introduces some important changes in the mop as far as interface repr is concerned and a couple of fixes.

Reviewed-on: #1432
improve the handling of lifted contract checks in the compiler

Reviewed-on: #1433
implement format as generic serde serializer

Reviewed-on: #1434
Implement a reader that can read format output

Co-authored-by: vyzo <vyzo@hackzen>
Reviewed-on: #1435
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
binary serialization protocol

Reviewed-on: #1440
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
fare force-pushed v0.19-staging from 8491b86258 to e704976993 2026-06-04 09:50:19 +00:00 Compare
Reviewed-on: #1443
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
Resolves implicit declaration build errors on FreeBSD by including the required header.

Reviewed-on: #1447
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
Resolves an unbound identifier error in socket.ss on FreeBSD by exporting FD_CLOEXEC.

Reviewed-on: #1448
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
brings the ssl lib to v19... and this pulls in a whole lot of things just to run the tests

Co-authored-by: Francois-Rene Rideau <fare@tunes.org>
Reviewed-on: #1446
Reviewed-on: #1451
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
Reviewed-on: #1455
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
A bug was introduced were the compiler failed to match opt/kw lambda names after genident started prefixing fresh identifiers.

Reviewed-on: #1456
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
regenerate bootstrap, it was faulty

Reviewed-on: #1457
Reviewed-on: #1454
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
Reviewed-on: #1458
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
Reviewed-on: #1461
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
so that handlers can easily log at the right place

Reviewed-on: #1463
closes #1462

Reviewed-on: #1464
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
Reviewed-on: #1465
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
new database interface and port of sqlite

Reviewed-on: #1468
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
The C4 linearization algorithm, updated:

C3 linearization (which we were already using)
support for "suffix" vs "infix" specifications (i.e. struct vs classes, which we had of late)
Better O(dn) instead of O(d²n²) asymptotic performance
Support for the local order being an arbitrary partial order, not necessarily total.
Helpers:

move the old v0.18 std/misc/hash to std/hash/misc (instead of std/hash) and std/hash-tables becomes std/hash/types
implement a new with-id, in between the old with-id (of std/sugar) and the new with-identifiers

Reviewed-on: #1467
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
Reviewed-on: #1470
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
- Fixes bugs
- Adds tests (imported from my CL fare-quasiquote, where applicable)
- Works with match in cases where ,@ is always in tail position

Reviewed-on: #1473
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
Co-authored-by: Francois-Rene Rideau <fare@tunes.org>
Reviewed-on: #1459
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
(cooked with Claude)

Co-authored-by: vyzo <vyzo@hackzen.org>
Reviewed-on: #1469
[RFC 9112 section 7.1](https://datatracker.ietf.org/doc/html/rfc9112#section-7.1) requires the chunked response body to end with `0\r\n\r\n`. The writer previously emitted only `0\r\n`, which strict clients treated as an incomplete response. Chunked responses now include the final CRLF after the zero-size chunk.

Reviewed-on: #1476
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
Co-authored-by: vyzo <vyzo@hackzen.org>
Co-authored-by: Jay Bonthius <jay@noreply.git.cons.io>
Reviewed-on: #1475
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
First pass at an AGENTS.md for stdlib to aid clankers when working with stdlib. We can add additional agents files in top and core later,  once we want to use clankers there.

Reviewed-on: #1480
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
`system-logger-thread` copies `sys.sources` into a local table at startup. Sources registered afterward exist only in `sys.sources`, so their records are rejected as unknown and dropped.

This adds a private `!UPDATE:add-source` message to synchronize the local table, and also adds some tests for `std/log/system.ss`.

Reviewed-on: #1477
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
HTTP server shutdown can hang because listener `EBADF` errors are retried and condition-variable timeout results are ignored. Peer disconnects during server-owned response closing are also logged as unhandled handler failures.

This PR makes `EBADF` terminal, enforces the shutdown deadline, caches listener addresses before closure, and contains only `EPIPE`/`ECONNRESET` from response finalization.

Reviewed-on: #1478
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
ports websockets to v0.19.

Done entirely with opencode with inference on the spark.

Reviewed-on: #1481
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
Ports the remaining UTF-16 and UTF-32 codecs to v0.19 under `:std/encoding`. Also fixes UTF-32 native-endian encoding and UTF-16 malformed-surrogate recovery.

> [!WARNING]
> LLM-assisted with `gerbil-mcp`

Reviewed-on: #1482
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
assisted by ds4 flash on the spark and chatgpt sol.

Reviewed-on: #1483
i am sure my new best friend astra approves. written by hand.

Reviewed-on: #1487
Ports the remaining signal-handling modules to v0.19 under `:std/os`, including `signal`, `signalfd`, `signal-handler`, and `kqueue`.

> [!WARNING]
> LLM-assisted with `gerbil-mcp`

Reviewed-on: #1484
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
ports std/os modules flock, pipe and inotify.

done with sol with assistance from gerbilosaurus rex.

Reviewed-on: #1485
Ports std/instance, std/net/rep, std/net/s3 (with synthetic server tests) and std/net/smtp (with synthetic server tests).

Done with sol/astra with oversight by the gerbilosaurus rex.

Reviewed-on: #1486
Ports `gxtags` to v0.19 for Emacs and Vim tag generation. Also fixes `make-tags` format handling and default `current-directory` traversal, with regression tests for both formats and command-line behavior.

> [!WARNING]
> LLM-assisted with `gpt-6-astra` and `gerbil-mcp`

Reviewed-on: #1488
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
this has been bugging me for a long time; diagnosed and fixed by astra.

Reviewed-on: #1494
Fixes portability and correctness bugs introduced in `:std/os` signal handling by #1484:

- `kqueue` FFI declarations used invalid C type identifiers.
- Oversized `kill` arguments could truncate and select unintended targets.
- Concurrent initialization could route Linux signals to an unused dispatcher.

Focused Linux tests pass. Paired benchmarks found no statistically significant registration or callback-latency regression. Restored `kill` checks add approximately 13 ns in a zero-signal probe; synthetic burst throughput was approximately 1% lower.

Native BSD/macOS `kqueue` smoke testing remains pending.

> [!WARNING]
> LLM-assisted with `gpt-6-astra` and `gerbil-mcp`.

Reviewed-on: #1492
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
fare added 13 commits 2026-09-12 18:28:51 +00:00
... and ##min-fixnum ==> (##least-fixnum)
The real meaning of equal: is to give a list of slots that must be
equal (all of them by default). opaque? means you must (also) test
the address, at which point equal? becomes just eq? -- for the class
and all its descendants.
... and ##min-fixnum ==> (##least-fixnum)
The real meaning of equal: is to give a list of slots that must be
equal (all of them by default). opaque? means you must (also) test
the address, at which point equal? becomes just eq? -- for the class
and all its descendants.
Reviewed-on: #1495
fare force-pushed v0.19-staging from e37f60db57 to 2817daa4fb 2026-09-12 19:07:29 +00:00 Compare
@Fare's recent commit 2817daa4fb names [Gambit:`dcd677c`](dcd677c) (Sep 7 2026) but pins [Gambit: `64f4d369`](64f4d369) (Aug 17 2025), so I think it was a typo. This PR pins Gambit to `dcd677c`.

Reviewed-on: #1497
This has been pending for a long while, ever since the introduction of the :? type annotation sigils coz it was quite tricky and hairy... but not for astra. It is now a reality, the compiler now natively understands nullable types and does not do unsafe shit because you forgot to check a nullable reference, and you can use (Maybe T) to declare a nullable type return.

also updates the gambit pin which was broken and includes unwind-protect! and fixes a type bug,  cherry picked ,from my wip branch on ensembles.

Implemented by astra with guidance and oversight from the gerbilosaurus rex.

Reviewed-on: #1496
Adds a [Vegeta](https://github.com/tsenart/vegeta)-powered HTTP server benchmark at `src/std/net/http/benchmarks/http-benchmark.ss` and native HTTP/1.1 tests in `src/std/net/http/server/server-test.ss`. The benchmark requires Vegeta and GNU `timeout`; build/run instructions are in its source.

### Test results

**43 cases: 29 passed, 14 failed**, in both source and optimized execution.

Fixing the failing HTTP behavior is TODO in an upcoming PR.

#### Failing tests:

- Request without HTTP version rejects before dispatch.
- POST `Expect: 100-continue` precedes body and final echo.
- Mixed-case Host, tab whitespace, and empty field are accepted.
- Invalid field-name token rejects before dispatch.
- Missing Host rejects before waiting for the declared body.
- Different duplicate Host authorities reject before dispatch.
- Case-insensitive duplicate Host rejects before dispatch.
- Arbitrarily large negative Content-Length rejects before dispatch.
- Negative Content-Length rejects before dispatch.
- Nondecimal Content-Length rejects before dispatch.
- Field value control byte rejects before dispatch.
- Invalid request prefix rejects before dispatch.
- Bare carriage return before another field rejects before dispatch.
- Case-varied Transfer-Encoding and Content-Length conflict rejects.

### Benchmark results

Linux, Ryzen 9 7940HS, Vegeta v12.13.0

Latencies in milliseconds.

| Workload | Mean | Median | p95 | p99 | Max |
|---|---:|---:|---:|---:|---:|
| Simple | 0.979 | 0.656 | 3.118 | 4.319 | 28.538 |
| Chunked | 0.846 | 0.785 | 1.257 | 2.358 | 3.949 |
| Small echo, 12 bytes | 0.865 | 0.774 | 1.430 | 2.960 | 3.519 |
| Large echo, 1 MiB | 4.042 | 4.043 | 4.806 | 6.037 | 8.046 |

AI-assisted with `gpt-6-astra`.

Reviewed-on: #1499
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
Also importantly update the default_gambit_tag

Reviewed-on: #1498
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
also adds some goodies to use gerbil-mcp with a local build when working on gerbil itself.

Reviewed-on: #1501
the optimizer incorrectly assumed incompatible types for mixins.

diagnosed and fixed by astra

Reviewed-on: #1500
Bug fixes for HTTP std module:

- Validate request-line syntax, header names/values and line endings; normalize header case and whitespace. Return `400` for request-head protocol errors without reclassifying application errors.
- Require one `Host` for HTTP/1.1 and reject duplicate Host fields. Validate decimal `Content-Length` values and agreement between duplicates. Reject `Transfer-Encoding`/`Content-Length` conflicts and unsupported transfer codings; only a single `chunked` coding is supported.
- Send `100 Continue` before body reads for HTTP/1.1 requests with a single case-insensitive `Expect: 100-continue` field and positive `Content-Length` or chunked framing. Invalid heads receive no acknowledgment; other Expect forms remain ignored.
- In a separate commit, fix the client to consume interim `100 Continue` responses and return the final response. Preserve WebSocket `101` handling.

Public request/response structures are unchanged.

## Tests

- Server: **29/43 before → 110/110 after**, fixing all 14 existing failures and adding 67 regression cases.
- HTTP client, chunked I/O and WebSocket: **8/8 before → 10/10 after**, including two new client regressions for fixed-length and chunked final responses.
- After: **120/120 in both source and optimized modes**.

## Benchmark

One sequential before/after pair: `f0badc77` without this PR’s fixes versus current `b9892378`. Verified prebuilt executables were reused; no rebuild was performed for this rerun.

- Ryzen 9 7940HS/Linux host
- Vegeta 12.13.0
- 50 requests/s
- four workers/connections
- keepalive disabled
- 5 seconds of warmup, 30 seconds of measurement

Latencies are milliseconds; p95/p99 are the 95th/99th percentiles.

| Workload | Before median / p95 / p99 | After median / p95 / p99 | Requests/s before → after |
|---|---:|---:|---:|
| Simple GET | 0.677 / 1.092 / 1.865 | 0.635 / 1.047 / 1.341 | 50.031 → 50.033 |
| Chunked GET | 0.766 / 1.192 / 1.662 | 0.772 / 1.198 / 1.514 | 50.032 → 50.032 |
| 12-byte echo | 0.757 / 1.171 / 1.886 | 0.774 / 1.160 / 1.575 | 50.031 → 50.032 |
| 1 MiB echo | 4.019 / 4.454 / 5.461 | 4.070 / 4.384 / 5.055 | 50.027 → 50.027 |

All **14,000 requests**, including warmups, returned HTTP 200 with no errors or timeouts. Median latency changes ranged from -6.2% to +2.3% in this pair; p99 decreased across all four workloads. Mean CPU utilization was 5.75% before and 5.70% after. This single fixed-load comparison is not a capacity test or proof of performance neutrality.

Reviewed-on: #1503
Reviewed-by: vyzo <vyzo@noreply.git.cons.io>
- variadic signatures with no required argument were broken
- interface-out was broken

fixed with astra.

Reviewed-on: #1506
Reviewed-by: François-René Rideau <fare@noreply.git.cons.io>
This is the first part of the v0.19 ensembles; complete network implementation.
It is industrial strength with excellent coverage and performance; interaction diagrams for humans included in the documentation.

codesigned and implemented with astra, with oversight from the gerbilosaurus rex 🦖.

Reviewed-on: #1493
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin v0.19-staging:v0.19-staging
git switch v0.19-staging
Sign in to join this conversation.
No description provided.