Skip to content

wpfacts: a stream write keeps no reference to its chunk or callback - #16048

Merged
proggeramlug merged 1 commit into
mainfrom
cwn-topseedp8
Dec 4, 2026
Merged

proggeramlug merged 1 commit into
mainfrom
cwn-topseedp8

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

perry's process.stdout.write / process.stderr.write copy the chunk's bytes before they return and keep no reference to the chunk or the callback (with_write_bytes, schedule_write_callback; stdin's write does nothing). The model no longer treats the chunk and callback as "kept by the stream" (a contract escape that, beside ⊤, made the chunk ⊤).

Beside foreign code (an unseen module or another unit), the member called may be unknown code's replacement, which gets every argument. That hand-off is now a foreign-only escape (Model::foreign_only_reason). The solver's escape() / escape_at() drop it in a program with no foreign code.

Stacked on the node:diagnostics_channel PR (branch cwn-topseedp7, head c869e47).

Test changes

  • amp_loop k2d_keep_foreign_code_writes_a_contract_hand_off: the test program imports ./unseen but was compiled with that import unresolved. Rule UNRES-IMPORT (owner 2026-11-29): an unresolved import runs no code, so the program had no foreign code and the store o.f is correctly decided. The test is meant to cover an unseen module, so it now loads one (tests::foreign_code). The expectation (store undecided) is unchanged.
  • held_realm_flow: doc comment updated.
  • New fixture amp_k3 stream_write_beside_top_keeps_the_literal_store: the chunk is written from a node that also holds ⊤, with no foreign code (the skelpo src/main.ts:234 shape).

Gate (head 2ff6e0e777 vs base c869e47)

check result
wpfacts suite, each test alone (300 s, 12G scope) 5517 tests: 5274 ok, 240 FAIL, 3 TIMEOUT. 0 new nonpass by name vs the base build (every head nonpass also fails on the base)
amp_loop / amp_k3 15/15, 21/21
rows c05 / c08 / c09 / c09b identical to the base (0 removed, 0 added payloads): 6553/6834, 8455/8883, 16471/17451, 16885/17423
STOP_ON_TOP c08 / c09 0 ⊤
semver rc 0, 493/563 (same as the base)
sabotage: the chunk escape made unconditional again the new fixture fails; the clean build passes

Effect

skelpo STOP_ON_TOP gets past process.stdout.write(bytes) (main.ts:234). The next first ⊤ is the http.createServer callback at src/core/http.ts:216.

perry's stdout / stderr `write` copies the chunk's bytes before it returns
and keeps no reference to the chunk or the callback (stdin's `write` does
nothing), so neither escapes. Beside foreign code the member called may be
unknown code's replacement, which gets every argument: that hand-off is a
foreign-only escape (`Model::foreign_only_reason`), which the solver's
escape() / escape_at() drop in a program without foreign code.

Test expectation (amp_loop k2d_keep_foreign_code_writes_a_contract_hand_off):
its program imports `./unseen`, which the test compiled as an unresolved
import. Rule UNRES-IMPORT (owner 2026-11-29): an unresolved import runs no
code and writes nothing, so that program has no foreign code and the store
`o.f` is decided. The test means an unseen module: it now loads one
(`tests::foreign_code`), and the store stays undecided there.

Fixture amp_k3 stream_write_beside_top_keeps_the_literal_store: the chunk
is written from a node that also holds ⊤, without foreign code (skelpo
src/main.ts:234); the old unconditional escape fails it.
@proggeramlug
proggeramlug marked this pull request as ready for review December 4, 2026 00:59
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@proggeramlug
proggeramlug merged commit 46c8a99 into main Dec 4, 2026
@proggeramlug
proggeramlug deleted the cwn-topseedp8 branch December 4, 2026 01:01
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