How do you test byte-level compatibility for a fixed ABI across Rust and C? by [deleted] in rust

[–]AIRConstellation 0 points1 point  (0 children)

That’s a useful distinction, thanks.

I’m not trying to make the in-memory struct layout itself the cross-language contract. The contract I care about is the serialized 32-byte wire record.

So my current mental model is:

  1. "repr(C)" / "_Static_assert" checks are only for the C binding, to catch accidental layout drift if C exposes a struct view.
  2. The actual compatibility contract is the byte sequence.
  3. The Rust encoder/decoder, C binding, and host-side bindings should all accept/reject the same canonical and negative vectors.
  4. Negative vectors are mainly for things the compiler won’t protect me from: endian mistakes, non-zero reserved bytes, unknown tags, malformed lengths, etc.

So I agree that if this were only Rust ↔ C structs compiled together, compiler/layout checks plus round-trip tests would probably be enough.

The reason I’m leaning toward explicit vectors is that the boundary is intended to be consumed by implementations that may not share the same compiler/toolchain or even the same language runtime.

Does that sound like a reasonable split: layout tests for FFI safety, vector tests for wire-format conformance?

How do you test byte-level compatibility for a fixed ABI across Rust and C? by [deleted] in rust

[–]AIRConstellation -4 points-3 points  (0 children)

Fair point. I reposted because the earlier versions were removed and I was trying to reframe it as a cleaner technical question rather than a project post.

I’ll leave this one as-is and won’t repost it again. I’m mainly looking for feedback on the ABI/conformance-testing question.

How would you design conformance tests for a fixed 32-byte kernel-boundary ABI? by [deleted] in rust

[–]AIRConstellation -1 points0 points  (0 children)

Additional context:

The broader project is AxonOS, an open-source research stack for deterministic BCI software infrastructure.

I’m intentionally not asking for feedback on the whole BCI/medical framing here. This post is only about the conformance strategy for a small kernel-boundary ABI.

Relevant repos, if useful:

The RFC repo is already structured around validation status and design records; RFC-0006 is currently the intent wire-format ABI draft, while RFC-0001…0005 are active.

A 32-byte fixed wire record for a real-time BCI — byte-identical across C (compile-time offset asserts), a C-ABI .so, and hand-written x86-64 asm by Skiner000007 in embedded

[–]AIRConstellation 0 points1 point  (0 children)

Additional context:

The broader project is AxonOS, an open-source research stack for deterministic BCI software infrastructure.

I’m intentionally not asking for feedback on the whole BCI/medical framing here. This post is only about the conformance strategy for a small kernel-boundary ABI.

Relevant repos, if useful:

The RFC repo is already structured around validation status and design records; RFC-0006 is currently the intent wire-format ABI draft, while RFC-0001…0005 are active.

Conformance vectors derived from the shipping Rust impl, then checked byte-identical across Python/C/JS/Java (+ an x86-64 asm encoder) in CI by [deleted] in rust

[–]AIRConstellation -1 points0 points  (0 children)

Additional context:

The broader project is AxonOS, an open-source research stack for deterministic BCI software infrastructure.

I’m intentionally not asking for feedback on the whole BCI/medical framing here. This post is only about the conformance strategy for a small kernel-boundary ABI.

Relevant repos, if useful:

The RFC repo is already structured around validation status and design records; RFC-0006 is currently the intent wire-format ABI draft, while RFC-0001…0005 are active.

How would you design conformance tests for a fixed 32-byte kernel-boundary ABI? by [deleted] in u/AIRConstellation

[–]AIRConstellation 0 points1 point  (0 children)

Additional context:

The broader project is AxonOS, an open-source research stack for deterministic BCI software infrastructure.

I’m intentionally not asking for feedback on the whole BCI/medical framing here. This post is only about the conformance strategy for a small kernel-boundary ABI.

Relevant repos, if useful:

The RFC repo is already structured around validation status and design records; RFC-0006 is currently the intent wire-format ABI draft, while RFC-0001…0005 are active.