Skip to content

feat: what a client can ask a decoder and a context - #156

Merged
with-developer merged 1 commit into
mainfrom
feat/152-reception-and-context-info
Oct 31, 2026
Merged

with-developer merged 1 commit into
mainfrom
feat/152-reception-and-context-info

Conversation

@with-developer

Copy link
Copy Markdown
Owner

Purpose

The additive items of #152:

  • A transport that reports its losses, or sets the share of frames drawn in part from them, could not ask how many blocks of a frame had arrived.
  • A program could learn a context's GPU only from a string meant for people.

Changes

  • Reception counts.
    • Rust: Decoder::received_blocks and total_blocks.
    • The browser player: received_blocks and total_blocks, which scripts/check_web.mjs checks.
    • The C API: emberwave_decoder_reception fills an EmberwaveReception with the received and total blocks, and whether the start of frame header arrived.
  • Context info. emberwave_context_info fills an EmberwaveContextInfo: the backend, the kind of device (EMBERWAVE_DEVICE_*), the PCI vendor and device, and which call made the context (EMBERWAVE_CONTEXT_KIND_*).
  • Both structs carry struct_size (D69). The test of first sizes pins them: 24 and 16 bytes.
  • Docs: the C API table and the browser player section of ARCHITECTURE.md, the C README, and CHANGELOG.md.

Testing

  • Reception. A new C API test splits a frame into packets. The counts start at 0, the header arrives with the first packet, and the counts rise to the total. A short struct_size is refused.
  • Context info. The same test checks a context's backend, device type and kind, and a NULL context. The Metal test checks that a context on the app's queue says Metal and kind Metal.
  • Suite. cargo test --release --workspace on the M3 Max.
  • Lints. Clippy for the workspace, wasm32 and Windows.
  • Browser. scripts/build_web.sh and node scripts/check_web.mjs.

Benchmark impact

None.

Review

A small additive change built on the struct helpers reviewed in #153, so it was not sent to the review agent.

Related issue

#152 (items 20 and 22).

The additive half of #152's list: a transport that reports its losses, or
sets the share of frames drawn in part from them, could not ask how many
blocks of a frame had arrived; and a program could learn a context's GPU
only from a string meant for people.

- Decoder::received_blocks and total_blocks in Rust, the browser player's
  received_blocks and total_blocks, and emberwave_decoder_reception in
  the C API, which also says whether the start of frame header arrived.
- emberwave_context_info: the backend, the kind of device, the PCI vendor
  and device, and which call made the context, with EMBERWAVE_DEVICE_* and
  EMBERWAVE_CONTEXT_KIND_* constants.

Both C calls fill structs that carry their size (D69), whose first sizes
the test of them pins.

Claude-Session: https://claude.ai/code/session_019fJGoCTvP5e7n599q3ZQ42
@with-developer
with-developer merged commit 9c2df63 into main Oct 31, 2026
7 checks passed
@with-developer
with-developer deleted the feat/152-reception-and-context-info branch October 31, 2026 01:46
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.

1 participant