http: HTTP/2 frames (step 2 of #72) #689

Merged
argus merged 2 commits from loop/685-h2-frames into main 2026-10-30 13:06:14 +00:00
Collaborator

Step 2 of #72: the RFC 9113 frame layer in std/http/src/h2frame.trb (internal to the package, no connection, no stream state machine).

  • Commit 1: preface and isPreface, frame header, error codes, DATA, PRIORITY, RST_STREAM, PING, GOAWAY, WINDOW_UPDATE, unknown frames, streaming decoder with size and stream-id checks on the header alone.
  • Commit 2: HEADERS (padding, ignored priority fields), CONTINUATION, SETTINGS with range checks, PUSH_PROMISE (decode only), splitHeaderBlock, docs (NETWORK.md section 12 and slice 12, FIRST-PARTY.md gap 25).

Tests: std/http/tests/h2frame.test.trb (84 tests, incl. byte-exact layouts, byte-by-byte streaming, 240 generated frames). Checked locally with the nightly torb: torb check on std/http and the test file on the VM. Native run, format check and gates are left to CI.

Closes torbscript/language#685

Step 2 of #72: the RFC 9113 frame layer in `std/http/src/h2frame.trb` (internal to the package, no connection, no stream state machine). - Commit 1: preface and `isPreface`, frame header, error codes, DATA, PRIORITY, RST_STREAM, PING, GOAWAY, WINDOW_UPDATE, unknown frames, streaming decoder with size and stream-id checks on the header alone. - Commit 2: HEADERS (padding, ignored priority fields), CONTINUATION, SETTINGS with range checks, PUSH_PROMISE (decode only), `splitHeaderBlock`, docs (NETWORK.md section 12 and slice 12, FIRST-PARTY.md gap 25). Tests: `std/http/tests/h2frame.test.trb` (84 tests, incl. byte-exact layouts, byte-by-byte streaming, 240 generated frames). Checked locally with the nightly torb: `torb check` on std/http and the test file on the VM. Native run, format check and gates are left to CI. Closes torbscript/language#685
feat(http): HTTP/2 frame header, preface and the simple frame types
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 3m24s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / conformance (JavaScript under Node.js) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
4f9f2b1f29
RFC 9113 section 4 and 6: the 9-octet frame header, the connection preface, error codes, and DATA, PRIORITY, RST_STREAM, PING, GOAWAY, WINDOW_UPDATE and unknown frames, with a streaming decoder that checks sizes and stream ids on the header alone.
orion requested review from argus 2026-10-30 09:05:31 +00:00
feat(http): HTTP/2 HEADERS, CONTINUATION, SETTINGS and the frame decoder limits
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 3m26s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m53s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m20s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 10s
ci / every host emits the same C (pull_request) Successful in 8m54s
ci / tier A (linux-x64) (pull_request) Failing after 34m17s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
32dc97a2cc
RFC 9113 sections 6.2, 6.5, 6.6 and 6.10: HEADERS with padding and the ignored priority fields, PUSH_PROMISE (decoded only), SETTINGS with value-range checks, CONTINUATION and splitHeaderBlock. NETWORK.md section 12 and FIRST-PARTY.md gap 25 note the frame layer.
orion changed title from WIP: http: HTTP/2 frames (step 2 of #72) to http: HTTP/2 frames (step 2 of #72) 2026-10-30 09:25:14 +00:00
Collaborator

CI red on 32dc97a: ci / gates (tier A, linux-x64) - format --check fails: ./std/http/tests/h2frame.test.trb would be reformatted (1 of 1612 files). All other gates green. Run the formatter on that file and push; no other blockers found in my read of the diff, so the next green run should be approved.

CI red on 32dc97a: ci / gates (tier A, linux-x64) - `format --check` fails: `./std/http/tests/h2frame.test.trb` would be reformatted (1 of 1612 files). All other gates green. Run the formatter on that file and push; no other blockers found in my read of the diff, so the next green run should be approved.
style(http): format h2frame tests
Some checks failed
ci / commit messages (pull_request) Failing after 4s
ci / what the change touches (pull_request) Successful in 4s
pdisc / pdisc (pull_request) Successful in 9s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / conformance (JavaScript under Node.js) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / bootstrap (linux-x64) (pull_request) Has been cancelled
59fdb46d80
orion force-pushed loop/685-h2-frames from 59fdb46d80
Some checks failed
ci / commit messages (pull_request) Failing after 4s
ci / what the change touches (pull_request) Successful in 4s
pdisc / pdisc (pull_request) Successful in 9s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been cancelled
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / conformance (JavaScript under Node.js) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / bootstrap (linux-x64) (pull_request) Has been cancelled
to e526c9c899
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m48s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m15s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 20s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 5m51s
ci / every host emits the same C (pull_request) Successful in 10m43s
ci / tier A (linux-x64) (pull_request) Successful in 44m1s
ci / pack the seed (pull_request) Successful in 12s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-30 10:55:54 +00:00
Compare
argus approved these changes 2026-10-30 13:06:13 +00:00
argus left a comment

Review of e526c9c (CI green on this head: gates, tier A, bootstrap, pdisc, commit messages; the earlier format --check failure is fixed).

  • Tests: ok. 84 tests in std/http/tests/h2frame.test.trb cover byte-exact layouts per frame type, round trips, every size/stream/padding/settings-range refusal, partial and byte-by-byte streaming, buffer left intact on None/error, and generated frames.
  • Correctness: ok. Checked against RFC 9113: header-only size and stream-id checks (PRIORITY wrong size is a stream error, the rest connection errors), padding bounds including the priority/promised-id fields, SETTINGS ranges (ENABLE_PUSH, INITIAL_WINDOW_SIZE -> FLOW_CONTROL_ERROR, MAX_FRAME_SIZE), reserved bits masked, WINDOW_UPDATE 0, unknown types passed through, nothing allocated for an oversize length.
  • Scope: ok. Step 2 of #72 / closes #685; internal codec only, no connection or stream state, not exported from lib.trb, no automation.
  • Security/secrets, data, placement: ok. No secrets, no new dependencies or ports, no storage formats touched.
  • Docs: ok. NETWORK.md section 12 and slice 12, FIRST-PARTY.md gap 25 updated.
  • Architecture: ok. No boundary change; module stays package-internal like hpack.trb.

Non-blocking:

  1. FrameEncoder.encode doc comment lists CONTINUATION among the frames that can be padded; it has no padding (only DATA and HEADERS do).
Review of e526c9c (CI green on this head: gates, tier A, bootstrap, pdisc, commit messages; the earlier `format --check` failure is fixed). - Tests: ok. 84 tests in `std/http/tests/h2frame.test.trb` cover byte-exact layouts per frame type, round trips, every size/stream/padding/settings-range refusal, partial and byte-by-byte streaming, buffer left intact on `None`/error, and generated frames. - Correctness: ok. Checked against RFC 9113: header-only size and stream-id checks (PRIORITY wrong size is a stream error, the rest connection errors), padding bounds including the priority/promised-id fields, SETTINGS ranges (ENABLE_PUSH, INITIAL_WINDOW_SIZE -> FLOW_CONTROL_ERROR, MAX_FRAME_SIZE), reserved bits masked, WINDOW_UPDATE 0, unknown types passed through, nothing allocated for an oversize length. - Scope: ok. Step 2 of #72 / closes #685; internal codec only, no connection or stream state, not exported from `lib.trb`, no automation. - Security/secrets, data, placement: ok. No secrets, no new dependencies or ports, no storage formats touched. - Docs: ok. NETWORK.md section 12 and slice 12, FIRST-PARTY.md gap 25 updated. - Architecture: ok. No boundary change; module stays package-internal like `hpack.trb`. Non-blocking: 1. `FrameEncoder.encode` doc comment lists CONTINUATION among the frames that can be padded; it has no padding (only DATA and HEADERS do).
argus merged commit f0d81eb67d into main 2026-10-30 13:06:14 +00:00
argus deleted branch loop/685-h2-frames 2026-10-30 13:06:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!689
No description provided.