Repository navigation
conformance: the two IO divergences the shutdown-flush work left behind - #52
Merged
Merged
Conversation
ruby#948 merged today and closed ruby#643: a file written and not closed reaches disk at interpreter teardown, like MRI's. Measured over 16 differential cases against MRI 4.0.7, 0 diverge. What it did NOT make go away is two residual divergences, and this page listed neither. Both have the same root as the `File#stat` row above them: a stream is buffered by PATH and holds no descriptor. - `IO#pwrite`'s bytes are not on disk until a flush, where MRI's `rb_io_pwrite` calls `pwrite(2)` and they are there the moment it returns. They are no longer LOST — teardown flushes them — so only the immediacy differs. ruby#949. - An unflushed file whose DIRECTORY is removed before the program ends loses its bytes, because teardown re-opens the path to flush it and gets `ENOENT`. MRI, holding a descriptor to an unlinked file, still writes them. Teardown reports nothing, as MRI's shutdown ignores a failing `fflush`. Same root as ruby#635. ⛔ The second one is a COST the fix accepted, not an oversight: the first version of the flush re-raised that `Errno`, which turned two EXISTING tests red (`Dir.mktmpdir` removes the directory under them). An error path added to teardown has nobody left to rescue it, so it has to fail silently — the one place where "a silent failure is worse than a loud one" is false. Stating it here is the whole point of the row. Gates run locally: gofmt clean, `go test ./...` green (6 packages), `conformancefigure --root content/en` reads 5 claims / 2 version claims at Ruby 4.0.9. No figure, example or method name changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Two rows in the "how it differs from MRI" table on the conformance page, both about
IO, both with the same root as theFile#statrow they sit under: a stream is buffered by path and holds no descriptor.Why now
ruby#948 merged today and closed ruby#643 — a file written and not closed now reaches disk at interpreter teardown, like MRI's
ruby_cleanupdoes through its object-space finalizer. Measured over 16 differential cases against MRI 4.0.7: 0 diverge. The companion change in the interpreter's own README landed in that PR; per "every user-visible change updates README, landing, docs", this is the docs half.What the fix did not make go away is two residual divergences, and this page listed neither:
IO#pwrite's bytes are not on disk until a flush, where MRI'srb_io_pwritecallspwrite(2)and they are there the moment it returns. No longer lost — teardown flushes them — so only the immediacy differsENOENT. MRI, holding a descriptor to an unlinked file, still writes themThe second row is a cost the fix accepted, not an oversight
The first version of the teardown flush re-raised that
Errno, and two existing tests went red —Dir.mktmpdirremoves the directory under them, so the re-open could not succeed. An error path added to teardown has nobody left to rescue it, which makes it the one place where "a silent failure is worse than a loud one" is false; MRI's own shutdown ignores a failingfflushfor exactly that reason. Writing the consequence down on this page is the whole point of the row — the alternative is a user discovering it.Gates
Run in this worktree, not recalled:
gofmt -l .— prints nothinggo test ./...— green, 6 packages (includestools/wired, the test that fails when a guard is called by no workflow)go run ./tools/conformancefigure --root content/en—5 total claim(s), 2 version claim(s) and 6 stubbed-helper mention(s) checked against the gate's 23672 at Ruby 4.0.9No figure, no example answer and no method name changed, so
docexample,numericsurfaceandupstreamlinkshave nothing new to judge; CI runs them regardless.Dispositions
Refs go-embedded-ruby/ruby#643, go-embedded-ruby/ruby#949, go-embedded-ruby/ruby#635
All three stay as they are.
ruby#643is already closed byruby#948;ruby#949andruby#635stay open on purpose — they are the two divergences this page now states, and documenting a gap does not close it.🤖 Generated with Claude Code