Repository navigation
Conversation
|
Thanks for picking this up so quickly! I ran it here, on the same machine as the issue, with the issue's two files: this branch (24d6523) against main (dbb3157),
|
|
Thanks for the independent same-machine qualification and for exercising the erased-quantity build at both &1 and &2 with a genuinely copied Data result. I will keep the conservative generic sealing and existing ctr_take behavior exactly as qualified; removing the remaining match cost is not part of this PR. Head24d6523e is unchanged. Your measurements and platform qualification remain attributed to your run. |
|
Thanks @oxura, and thanks @aldeni for the issue and the numbers. We're holding this one for now. The fix looks sound for safe code: a value whose type is literally What we're not sure about is how often this slowdown actually matters. On our 17 perf benchmarks, the emitted C is byte-for-byte the same with and without this PR. The 2x comes from a micro-benchmark built to trigger the slowdown. Meanwhile the PR changes behavior: an @aldeni, could you measure this PR on the server you mentioned (the one where counting and freeing took 28–33% of CPU)? A real program that gets noticeably faster would make the case. If it does, two changes before merging:
|
…ain' into review/1566-maintainer-20261015-1112
Restore the existing layout helpers and constructor-local spelling; leave GUIDE wording to maintainers. Keep the literal-affine rule and generic conservative sealing unchanged. Repository cap gate 54/54; seven interpreted/C1/C4/JS ownership consumers passed. Production workload benefit and unsafe-rule sign-off remain pending. AI-assisted follow-up: GPT-6.1 Sol (openai-codex/gpt-6.1-sol).
|
Pushed Local check on the new head: repo cap gate 54/54; Understood that this remains held: I have not measured the server workload, and the reported |
|
Measured, as asked. Short version: on this program the PR is neutral, and the emitted C says why. Setup. Same machine as #1559 (Linux x86-64, 4 cores). Compilers: main
* the first cell of the run (main itself measured 4,070 there and 3,965 in its second pass). I read all four as a tie. An equality check over every route of the program printed the same output on both binaries, so nothing here hit the new stop on an Why. The two emitted C files have the same line count; the PR removes 57 of 2,816 So the fix is sound and the micro gain is real, but this program isn't the "noticeably faster real app". If you have a workload in mind that builds affine lists in volume on its hot path, I'm happy to measure it the same way. |
|
Thanks, that answers the app question: this service is neutral. I won't count it as a production speedup, and I've updated the PR body to say so. The remaining hold is the compiled-C |
|
Thanks @oxura for the fix, and @aldeni for the measurements. I'm closing this one. The rule is sound for safe code: a node built at a literal With this PR, that stops holding when the elements are affine. Forking an Since the server measurements came out neutral, I'd rather keep |
|
Agreed. I'll keep the existing @unsafe copy behavior. This optimization needs that reachability proof before it can be safe. |
Fixes #1559.
A constructor built at a known literal
Kind(&1)now keeps its fields raw, even when another instantiation makes that constructor hot. Generic quantities still use conservative sealing. Matches still go through the existingctr_take; keep and drop behavior is unchanged.The regression mixes literal-affine construction with a generic constructor used at both
&1and&2, then consumes the Data result twice. It prints499500, 999000, 499500in the interpreter, native C (1 and 4 threads), and emitted JS on Bun. Seven ownership programs pass those lanes; the repository cap gate passes.I merged main and removed the unrelated layout and GUIDE changes in
7896a14e.The issue author's server measurements are now in: neutral. Almost all of that program's data is shared, so this literal-affine rule does not change its hot request path. The earlier microbenchmarks are not evidence of a production speedup, and no real-app speedup is claimed here.
Still on hold: this changes compiled-C behavior for an
@unsafecopy ofKind(&1), including the reported BaseArray.forkcase. That needs @VictorTaelin or @nicolas-abril to sign off.Not tested: macOS, Metal, CUDA, or the mini-cluster corpus.
AI-assisted with GPT-6.1 Sol; no subagents on this PR.