Skip to content

Repin the two backends, which fixed a defect this suite could not see - #21

Merged
Sunrisepeak merged 1 commit into
mainfrom
chore/repin-backends-0.7.1-0.6.1
Aug 29, 2026
Merged

Repin the two backends, which fixed a defect this suite could not see#21
Sunrisepeak merged 1 commit into
mainfrom
chore/repin-backends-0.7.1-0.6.1

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

openkal-linux 0.7.1 and openkal-macos 0.6.1 correct kal_timeout_read and kal_timeout_write, which decoded a borrowed kal_stream handle with okl::unpack / okm::unpack — the decoder for an owned handle. Those backends pack an owned handle as (generation << 32) | (fd + 1), so a bare descriptor N has exactly the shape of a packed handle naming N-1 and the decode succeeded. The wait was performed upon descriptor N-1 and the transfer upon N.

Five lines here: README.md, examples/portable/mcpp.toml, kit/mcpp.toml. What a reader copies first is the line in a README, and these move with the release rather than after it.

And the suite could not have caught it

conformance/src/sections/timeout.cpp states three observations of the two operations, and each is a disjunction the defect satisfies:

observe(kind::behaviour,
        r >= 0 || r == -kal_err_again || r == -kal_err_not_supported,
        "a bounded read reports success, an expiry, or a refusal");

A bounded read of the standard input is permitted to expire, so an implementation that expires because it waited upon the wrong object is indistinguishable here from one that is right.

That is not carelessness in those lines. The section imports openkal.stream and openkal.timeout and nothing else, and there is no stream it can be sure has bytes waiting — so the honest observation is not expressible with what it has.

Both backends now carry it in their own suites, where a channel can be made: sixteen channels, each written to, each read with a bound, and the count reported rather than the first failure. Measured against the old implementation, 0 of 16 bounded reads transferred.

Whether this suite should gain the same observation is left to a change of its own. It would have to import openkal.process and be conditional on it, since that interface is optional, and folding an optional-interface question into a repin would make both harder to review.

Index entries: mcpplibs/mcpp-index#283.

… suite could not see

openkal-linux 0.7.1 and openkal-macos 0.6.1 correct `kal_timeout_read` and
`kal_timeout_write`, which decoded a borrowed `kal_stream` handle with the
decoder for an owned one and so waited upon the descriptor below the one they
transferred upon.

Five lines: `README.md`, `examples/portable/mcpp.toml` and `kit/mcpp.toml`. What
a reader copies first is the line in a README, and these had to move with the
release rather than after it.

--- and the suite could not have caught it ----------------------------------

`conformance/src/sections/timeout.cpp` states three observations and each is a
disjunction that the defect satisfies:

    r >= 0 || r == -kal_err_again || r == -kal_err_not_supported

A bounded read of the standard input is permitted to expire, so an
implementation that expires because it waited on the wrong object is
indistinguishable there from one that is right. That is not an oversight in
those lines -- there is no stream the suite can be sure has bytes waiting, and
inventing one requires an interface the section does not import.

Both backends now carry the observation in their own suites, where a channel can
be made: sixteen channels, each written to, each read with a bound, and the
count reported. Whether the suite here should gain the same observation --
`openkal.process` is optional, so it would have to be conditional -- is left to
a change of its own rather than folded into a repin.
@Sunrisepeak
Sunrisepeak merged commit 1baa713 into main Aug 29, 2026
12 checks passed
@Sunrisepeak
Sunrisepeak deleted the chore/repin-backends-0.7.1-0.6.1 branch August 29, 2026 18:18
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