Skip to content

feat(simple_doip): build an entity as a static, its discovery started later - #92

Merged
FelicianoAngulo2 merged 4 commits into
mainfrom
feat/doip-entity-static
Nov 5, 2026
Merged

FelicianoAngulo2 merged 4 commits into
mainfrom
feat/doip-entity-static

Conversation

@FelicianoAngulo2

@FelicianoAngulo2 FelicianoAngulo2 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

An entity can now be built as a static, with its vehicle discovery started once the sockets exist, so an embedded image keeps the entity out of a task's stack. Discovery starts once (AlreadyStarted on a second call); such an entity is a .data image, and its constructor is const only with a const-built static acceptor.

Issue URL

Towards https://github.com/luminartech/halo/issues/5100

Testing

Run on this branch with the commits of the PRs below it, each commit alone and on the stack's top:

  • tool self-tests, validate, governance, the Sphinx needs build, and prose (plain and CI's --strict crates/uds_c)
  • cargo test --workspace --all-features; clippy on the host and for thumbv7em-none-eabihf
  • just embedded builds on 1.91 for both targets and the size check (matches the baseline)
  • cargo doc with -D warnings; pre-commit run --all-files
  • On the stack's top also the uds_c Miri job from ci.yml and cargo package -p uds_c --no-verify

@JustinKovacich JustinKovacich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stack review of #92–#96, this PR's part: 2 Required, 1 Optional.

Gate: fmt clean; clippy --workspace --all-targets --all-features -W clippy::pedantic 0 hits, and clean for simple_doip on thumbv7em-none-eabihf; cargo test --workspace --all-features passes; cargo hack powerset clean (workspace at depth 2, simple_doip on thumbv7em); cargo doc with -D missing_docs clean; just embedded and the size check match the baseline.

This PR is only usable together with #93: until entity_mut exists, nothing can call start_discovery on an entity inside a DoIpTransport.

Skills run for this review: rust-quality-gate, rust-principles, rust-api-design, rust-embedded, rust-design-review (change-scoped), /code-review, writing-for-customers.

Comment thread crates/simple_doip/src/entity/mod.rs Resolved
Comment thread crates/simple_doip/src/entity/mod.rs Resolved
Comment thread crates/simple_doip/src/entity/mod.rs Resolved

@JustinKovacich JustinKovacich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every point from the first round is fixed: a second start_discovery is refused with AlreadyStarted and tested, new_discovery_later's doc states the flash cost and that the acceptor must be a const-built static, and replace_discovery leaves one field list beside assemble.

No comments.

Gates at this head, run locally: cargo fmt --check, clippy pedantic on the workspace (0 hits), cargo test --workspace --all-features, the cargo hack powerset (depth 2), cargo doc with -D missing_docs and broken links denied, and just embedded with both size baselines. All clean.

Skills: rust-quality-gate, rust-principles, rust-api-design, rust-embedded, rust-design-review (change-scoped) and writing-for-customers. /code-review not run: the fixups are small, and I read each line by hand.

Security Audit is red on main too (RUSTSEC-2026-0110 and RUSTSEC-2026-0386), so its failure here is not this PR's.

@FelicianoAngulo2
FelicianoAngulo2 enabled stacked auto-merge (squash) November 5, 2026 00:46
… later

Entity::new_discovery_later is a const fn, so a target whose stack cannot hold an entity builds it as a static's initializer, and start_discovery starts its discovery once the interface has an address and the identity is known. Both constructors share one private const fn. Entity::new keeps its run-time slot table: built from a constant, the table is an image of every buffer in flash, 7 KB more text on the embedded probe. EntityAddress::new becomes a const fn.
@FelicianoAngulo2
FelicianoAngulo2 merged commit 984b510 into main Nov 5, 2026
31 checks passed
@FelicianoAngulo2
FelicianoAngulo2 deleted the feat/doip-entity-static branch November 5, 2026 02:28
FelicianoAngulo2 added a commit that referenced this pull request Nov 5, 2026
…tween events (#93)

A server's transport can be reached mutably between events
(`Server::transport_mut`, `None` while a response awaits its
confirmation), and `DoIpTransport::start_discovery` starts the discovery
of an entity built as a static, so an application can start discovery on
the server it already owns. `start_discovery` sits behind `uds_on_ip`'s
new off-by-default `connection` feature. The embedded probe also
measures a server built at run time, against its own size baseline.

Depends on #92.

## Issue URL

Towards luminartech/halo#5100

## Testing

Run on this branch with the commits of the PRs below it, each commit
alone and on the stack's top:
- tool self-tests, `validate`, `governance`, the Sphinx needs build, and
prose (plain and CI's `--strict crates/uds_c`)
- `cargo test --workspace --all-features`; clippy on the host and for
`thumbv7em-none-eabihf`
- `just embedded` builds on 1.91 for both targets and the size check
(matches the baseline)
- `cargo doc` with `-D warnings`; `pre-commit run --all-files`
- On the stack's top also the uds_c Miri job from `ci.yml` and `cargo
package -p uds_c --no-verify`
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.

2 participants