Repository navigation
Conversation
…s, arrays, and calls
…lar slot ops (#474)
通用逐步循环每步 ~100ns(PC 串构建/写、status 读、operand_load、派发、
Emit、WriteBody)。新增 kvcpu_fast.c:对可快行(goto/br、copy_plain 的 =、
int64/float64 typed 算术/比较)直接在 shm 指针上紧循环执行。语义不变:
每步仍先写值后原地写 PC 尾 [n,0]、每步查 ‥status==running;除零/溢出/
移位越界/None/kind 不符等一律无副作用 bail 回通用路径。无 ABI/格式改动。
KVLANG_NOFAST=1 关闭(A/B 用);debug 日志时自动关闭。
A/B(shm,min of 3,fast vs NOFAST):
iops N=2000 0.314ms vs 1.155ms (3.7x)
quicksort N=128 0.994ms vs 1.596ms (1.6x)
matmul N=8 0.685ms vs 0.858ms (1.25x)
binary_trees d=6 1.692ms vs 1.930ms (1.14x)
hash_table N=200 1.344ms vs 1.545ms (1.15x)
prime_sieve N=100 3.534ms vs 4.155ms (1.18x)
fib / nqueens 持平(call/return 主导,未覆盖)
大规模:iops N=2e6 191ms(python 83ms,2.3x);
prime_sieve N=3000 152ms vs NOFAST 550ms(python 26ms)。
验证:tutorial shm 226/226;ctest 与 NOFAST 结果一致(param_address_* 在
HEAD 基线 lib 上同样失败,既有问题);pause/resume + SIGKILL 续跑不变式通过。
Keep one binding ctx per park target set at each depth so alternating call sites (fib(a)/fib(b)) no longer flip operand keys on every call and kill read views. fib(20) 93ms -> 70ms (shm). Tutorial 229/229.
冲突解决:快核保留 + compactarray 命名迁移 + kvspaceXvalueBodyView ABI。 - #513 = #474 C runtime 快核(kvcpu_fast.c / warm frame / fk_state) - scatterarray/compactarray 命名迁移 - kvspaceSlotView → kvspaceXvalueBodyView ABI 适配 验证(coding3):C runtime + runtimec2 + json 编译通过;tutorial runtimec2 154/78(master 基线,无回归);benchmark shm 30/30 valid;C runtime 加载通过。 Co-Authored-By: Claude Code <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.
将 #513(原 #474 C runtime 快核)合并进最新 master,冲突已解决:
runtime/src/kvcpu_fast.c、warm frame、fk_state等kvspaceSlotView→kvspaceXvalueBodyView验证(coding3):C runtime + runtimec2 + json 编译通过;tutorial runtimec2 154/78(master 基线,无回归);benchmark shm 30/30 valid;C runtime 加载通过。
参考说明:快核实测在部分环境无收益(iops −12.5%),按用户裁决作为参考臂保留。C runtime 的 array 旧名是 #540 遗留,已开 #544 跟踪。
🤖 Generated with Claude Code