Skip to content

add string search example and benchmark#18

Merged
cs01 merged 1 commit intomainfrom
examples/string-search
Feb 19, 2026
Merged

add string search example and benchmark#18
cs01 merged 1 commit intomainfrom
examples/string-search

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Feb 19, 2026

No description provided.

@cs01 cs01 merged commit 4ec7c4a into main Feb 19, 2026
13 checks passed
@cs01 cs01 deleted the examples/string-search branch February 19, 2026 18:53
cs01 added a commit that referenced this pull request Apr 19, 2026
…verything to double)

closes dapweb NOTES #18 (blocker) and #19.

root cause: both function-generator.ts and calls.ts had 'if (funcIsAsync)
{...} else if (hasParamTypes) {...}' — the async branch set returnType to
%Promise* and exclusively skipped the param-type resolution. Async funcs
fell through to the fallback loop that pushes 'double' for every param.

symptoms:
  - (#18) async function with mixed string+number+array params received
    every arg as double in the caller. string arg ended up passed as i64
    to strlen → IR type mismatch or segfault.
  - (#19) module-level 'dispatch();' on an async fn emitted spurious
    double args because the caller built paramTypes from the fallback
    rather than func.paramTypes.

fix: restructure so async sets returnType first, then FALLS THROUGH to
the param-type resolution block. Guard the returnType write inside that
block so async's %Promise* isn't overwritten.

verified:
  - async function send(id: string, seq: number, body: string): Promise<string>
    callable with all three arg types, returns the concatenated string
  - async function dispatch(): Promise<void> callable at module level
    without extra args
cs01 added a commit that referenced this pull request Apr 19, 2026
…verything to double) (#566)

closes dapweb NOTES #18 (blocker) and #19.

root cause: both function-generator.ts and calls.ts had 'if (funcIsAsync)
{...} else if (hasParamTypes) {...}' — the async branch set returnType to
%Promise* and exclusively skipped the param-type resolution. Async funcs
fell through to the fallback loop that pushes 'double' for every param.

symptoms:
  - (#18) async function with mixed string+number+array params received
    every arg as double in the caller. string arg ended up passed as i64
    to strlen → IR type mismatch or segfault.
  - (#19) module-level 'dispatch();' on an async fn emitted spurious
    double args because the caller built paramTypes from the fallback
    rather than func.paramTypes.

fix: restructure so async sets returnType first, then FALLS THROUGH to
the param-type resolution block. Guard the returnType write inside that
block so async's %Promise* isn't overwritten.

verified:
  - async function send(id: string, seq: number, body: string): Promise<string>
    callable with all three arg types, returns the concatenated string
  - async function dispatch(): Promise<void> callable at module level
    without extra args

Co-authored-by: cs01 <cs01@users.noreply.github.com>
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