v0.19: add HTTP/1.1 spec compliance tests and benchmark #1499

Merged
vyzo merged 7 commits from jay/gerbil:v0.19-http into v0.19-staging 2026-09-15 08:02:56 +00:00
Member

Adds a 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.

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`.
jay changed title from WIP: v0.19: add HTTP benchmark and h1spec tools to WIP: v0.19: add HTTP/1.1 spec compliance tests and benchmark 2026-09-15 05:41:25 +00:00
jay requested reviews from vyzo, fare 2026-09-15 05:41:38 +00:00
jay changed title from WIP: v0.19: add HTTP/1.1 spec compliance tests and benchmark to v0.19: add HTTP/1.1 spec compliance tests and benchmark 2026-09-15 05:41:44 +00:00
vyzo approved these changes 2026-09-15 08:02:19 +00:00
vyzo left a comment

great work, thank you!

do you think it is worth strengthening the server checks to respond according to spec on client errors?

great work, thank you! do you think it is worth strengthening the server checks to respond according to spec on client errors?
vyzo merged commit 94b87422fb into v0.19-staging 2026-09-15 08:02:56 +00:00
Owner

we can fix the failing parts in a separate pr, i am going to merge it as is.

we can fix the failing parts in a separate pr, i am going to merge it as is.
vyzo deleted branch v0.19-http 2026-09-15 08:04:20 +00:00
Sign in to join this conversation.
No description provided.