Skip to content

Autoresearch heapsort bench 2026 03 13#147

Closed
ceifa wants to merge 9 commits intonew-apis-2from
autoresearch-heapsort-bench-2026-03-13
Closed

Autoresearch heapsort bench 2026 03 13#147
ceifa wants to merge 9 commits intonew-apis-2from
autoresearch-heapsort-bench-2026-03-13

Conversation

@ceifa
Copy link
Owner

@ceifa ceifa commented Mar 14, 2026

No description provided.

ceifa added 9 commits March 13, 2026 20:54
…sh state + loadstring + execute returned function)\n\nResult: {"status":"keep","wasmoon_heapsort_avg_ms":14.775872}
…ct UTF-8 buffer path instead of generic ccall string marshaling\n\nResult: {"status":"keep","wasmoon_heapsort_avg_ms":13.135759}
…vailable, bypassing ccall on hot numeric-only call paths\n\nResult: {"status":"keep","wasmoon_heapsort_avg_ms":12.001671}
… UTF-8 buffer, avoiding ccall overhead on the hot chunk-load path\n\nResult: {"status":"keep","wasmoon_heapsort_avg_ms":11.751988}
…ebuilt from scratch, then focused heapsort benchmark\n\nResult: {"status":"keep","wasmoon_heapsort_avg_ms":12.639066}
…d time, and wasm size on the heapsort workload\n\nResult: {"status":"keep","wasmoon_heapsort_avg_ms":11.794092}
@ceifa ceifa changed the base branch from main to new-apis-2 March 14, 2026 01:30
@ceifa ceifa closed this Mar 14, 2026
@chatgpt-codex-connector
Copy link

💡 Codex Review

wasmoon/bin/wasmoon

Lines 143 to 146 in f5982c8

const bytesRead = fs.readSync(inputFD, buffer, current, buffer.length - current)
if (bytesRead > 0) {
const charcode = buffer[current++]
if (charcode === 127) {

P1 Badge Consume all bytes returned by tty readSync

When Lua reads stdin in TTY mode, fs.readSync may return an entire line at once, but this loop only processes buffer[current++] (one byte) per read and discards the rest of the bytes that were already consumed from the fd. In canonical terminal mode this truncates input to the first character and can make io.read() appear to hang waiting for more data; iterate over bytesRead bytes from each call instead of a single byte.


wasmoon/bin/wasmoon

Lines 76 to 79 in f5982c8

case '-':
scriptFile = '-'
i++
break

P2 Badge Preserve first script argument after - sentinel

The - option branch increments i inside the switch, and then the for loop increments i again, so the first positional argument after - is skipped before scriptArgs is computed. For example, wasmoon - foo drops foo from Lua's arg table; stop incrementing twice when handling this sentinel.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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