codecin 5.8.0__tar.gz → 5.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. {codecin-5.8.0 → codecin-5.9.0}/CHANGELOG.md +143 -0
  2. {codecin-5.8.0/codecin.egg-info → codecin-5.9.0}/PKG-INFO +122 -234
  3. {codecin-5.8.0 → codecin-5.9.0}/README.md +121 -233
  4. {codecin-5.8.0 → codecin-5.9.0}/codecin/__init__.py +1 -1
  5. {codecin-5.8.0 → codecin-5.9.0}/codecin/aot.py +39 -13
  6. {codecin-5.8.0 → codecin-5.9.0}/codecin/cin.py +57 -7
  7. {codecin-5.8.0 → codecin-5.9.0}/codecin/cli.py +70 -58
  8. {codecin-5.8.0 → codecin-5.9.0}/codecin/config.py +12 -26
  9. codecin-5.9.0/codecin/cpu.py +273 -0
  10. codecin-5.9.0/codecin/crom.py +275 -0
  11. codecin-5.9.0/codecin/disasm.py +145 -0
  12. {codecin-5.8.0 → codecin-5.9.0}/codecin/environment.py +4 -4
  13. {codecin-5.8.0 → codecin-5.9.0}/codecin/errors.py +1 -5
  14. {codecin-5.8.0 → codecin-5.9.0}/codecin/isa.py +32 -2
  15. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/codec.cin +2 -2
  16. codecin-5.9.0/codecin/lib/ffi.cin +163 -0
  17. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/gostd.cin +12 -3
  18. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/gui.cin +1 -1
  19. codecin-5.9.0/codecin/lib/net.cin +171 -0
  20. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/path.cin +1 -1
  21. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/text.cin +1 -1
  22. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/token.cin +1 -1
  23. codecin-5.9.0/codecin/memory.py +306 -0
  24. codecin-5.9.0/codecin/native/aot/aot.go +110 -0
  25. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/aot/stub_main.go.txt +5 -4
  26. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/compiler/codegen.go +54 -2
  27. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/compiler/syscalls.go +21 -0
  28. codecin-5.9.0/codecin/native/engine/ffi_nocgo.go +20 -0
  29. codecin-5.9.0/codecin/native/engine/ffi_registry.go +69 -0
  30. codecin-5.9.0/codecin/native/engine/ffi_unix.go +109 -0
  31. codecin-5.9.0/codecin/native/engine/ffi_windows.go +117 -0
  32. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/hostnet.go +50 -0
  33. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/isa_gen.go +184 -1
  34. codecin-5.9.0/codecin/native/engine/netsock.go +321 -0
  35. codecin-5.9.0/codecin/native/engine/ops_ext.go +515 -0
  36. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/version_gen.go +1 -1
  37. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/vm.go +341 -45
  38. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/main.go +196 -0
  39. {codecin-5.8.0 → codecin-5.9.0}/codecin/native.py +72 -40
  40. {codecin-5.8.0 → codecin-5.9.0}/codecin/stats.py +2 -7
  41. {codecin-5.8.0 → codecin-5.9.0}/codecin/stdlib.py +4 -5
  42. {codecin-5.8.0 → codecin-5.9.0}/codecin/version.py +4 -18
  43. {codecin-5.8.0 → codecin-5.9.0/codecin.egg-info}/PKG-INFO +122 -234
  44. {codecin-5.8.0 → codecin-5.9.0}/codecin.egg-info/SOURCES.txt +11 -12
  45. {codecin-5.8.0 → codecin-5.9.0}/examples/args_demo.cin +4 -4
  46. {codecin-5.8.0 → codecin-5.9.0}/script/gen_native_isa.py +7 -1
  47. {codecin-5.8.0 → codecin-5.9.0}/tests/test_aggregate_and_const.py +11 -59
  48. {codecin-5.8.0 → codecin-5.9.0}/tests/test_all_libs_together.py +8 -12
  49. {codecin-5.8.0 → codecin-5.9.0}/tests/test_aot.py +1 -34
  50. {codecin-5.8.0 → codecin-5.9.0}/tests/test_assembler_ext.py +1 -13
  51. {codecin-5.8.0 → codecin-5.9.0}/tests/test_cin_host.py +15 -50
  52. {codecin-5.8.0 → codecin-5.9.0}/tests/test_cin_host_ext.py +7 -60
  53. {codecin-5.8.0 → codecin-5.9.0}/tests/test_cin_new_features.py +4 -24
  54. {codecin-5.8.0 → codecin-5.9.0}/tests/test_cin_syntax.py +2 -24
  55. {codecin-5.8.0 → codecin-5.9.0}/tests/test_cin_syntax_ext.py +12 -28
  56. {codecin-5.8.0 → codecin-5.9.0}/tests/test_cin_system.py +5 -11
  57. {codecin-5.8.0 → codecin-5.9.0}/tests/test_cli.py +10 -25
  58. {codecin-5.8.0 → codecin-5.9.0}/tests/test_compiler_errors.py +0 -8
  59. {codecin-5.8.0 → codecin-5.9.0}/tests/test_environment.py +3 -7
  60. {codecin-5.8.0 → codecin-5.9.0}/tests/test_examples.py +0 -3
  61. {codecin-5.8.0 → codecin-5.9.0}/tests/test_features_ab.py +0 -14
  62. {codecin-5.8.0 → codecin-5.9.0}/tests/test_features_import.py +1 -20
  63. {codecin-5.8.0 → codecin-5.9.0}/tests/test_features_importloc.py +0 -5
  64. codecin-5.9.0/tests/test_ffi_net.py +426 -0
  65. {codecin-5.8.0 → codecin-5.9.0}/tests/test_gui.py +14 -28
  66. {codecin-5.8.0 → codecin-5.9.0}/tests/test_index_subscript_type.py +6 -20
  67. {codecin-5.8.0 → codecin-5.9.0}/tests/test_isa_single_source.py +0 -7
  68. codecin-5.9.0/tests/test_issue_regress.py +210 -0
  69. {codecin-5.8.0 → codecin-5.9.0}/tests/test_keyboard.py +12 -31
  70. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_bigint.py +18 -37
  71. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_bitset.py +2 -6
  72. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_codec.py +6 -22
  73. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_combin.py +4 -12
  74. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_compat.py +20 -57
  75. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_csv.py +4 -11
  76. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_dp.py +2 -6
  77. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_fmt.py +4 -11
  78. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_frac.py +12 -25
  79. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_graph.py +4 -12
  80. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_heap.py +4 -12
  81. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_path.py +5 -15
  82. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_set.py +2 -6
  83. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_text.py +12 -25
  84. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_token.py +8 -17
  85. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_tree.py +2 -6
  86. {codecin-5.8.0 → codecin-5.9.0}/tests/test_lib_unionfind.py +2 -6
  87. {codecin-5.8.0 → codecin-5.9.0}/tests/test_libs.py +3 -15
  88. {codecin-5.8.0 → codecin-5.9.0}/tests/test_libs_ext.py +0 -8
  89. {codecin-5.8.0 → codecin-5.9.0}/tests/test_literals_and_bom.py +3 -16
  90. {codecin-5.8.0 → codecin-5.9.0}/tests/test_native_hardening.py +8 -21
  91. {codecin-5.8.0 → codecin-5.9.0}/tests/test_native_lib_lookup.py +0 -4
  92. {codecin-5.8.0 → codecin-5.9.0}/tests/test_nested_subscript_codegen.py +3 -12
  93. {codecin-5.8.0 → codecin-5.9.0}/tests/test_no_go_cli.py +0 -4
  94. {codecin-5.8.0 → codecin-5.9.0}/tests/test_p0_fixes.py +31 -78
  95. {codecin-5.8.0 → codecin-5.9.0}/tests/test_packaging.py +0 -9
  96. {codecin-5.8.0 → codecin-5.9.0}/tests/test_paths_consistency.py +0 -1
  97. codecin-5.9.0/tests/test_sparse_memory.py +167 -0
  98. {codecin-5.8.0 → codecin-5.9.0}/tests/test_struct_value_semantics.py +12 -82
  99. {codecin-5.8.0 → codecin-5.9.0}/tests/test_switch_semantics.py +6 -22
  100. {codecin-5.8.0 → codecin-5.9.0}/tests/test_version.py +2 -36
  101. {codecin-5.8.0 → codecin-5.9.0}/tests/test_workflows.py +0 -13
  102. codecin-5.8.0/codecin/cache.py +0 -71
  103. codecin-5.8.0/codecin/cpu.py +0 -1673
  104. codecin-5.8.0/codecin/crom.py +0 -222
  105. codecin-5.8.0/codecin/debugger.py +0 -691
  106. codecin-5.8.0/codecin/disasm.py +0 -86
  107. codecin-5.8.0/codecin/jit.py +0 -276
  108. codecin-5.8.0/codecin/memory.py +0 -365
  109. codecin-5.8.0/codecin/native/aot/aot.go +0 -59
  110. codecin-5.8.0/tests/test_cache.py +0 -40
  111. codecin-5.8.0/tests/test_cpu_interpreted.py +0 -89
  112. codecin-5.8.0/tests/test_debugger.py +0 -82
  113. codecin-5.8.0/tests/test_features_crom_mmu.py +0 -82
  114. codecin-5.8.0/tests/test_features_mmu.py +0 -123
  115. codecin-5.8.0/tests/test_features_remote.py +0 -152
  116. codecin-5.8.0/tests/test_isa_dispatch.py +0 -68
  117. codecin-5.8.0/tests/test_memory_protection.py +0 -62
  118. codecin-5.8.0/tests/test_three_paths.py +0 -86
  119. {codecin-5.8.0 → codecin-5.9.0}/LICENSE +0 -0
  120. {codecin-5.8.0 → codecin-5.9.0}/MANIFEST.in +0 -0
  121. {codecin-5.8.0 → codecin-5.9.0}/codecin/assembler.py +0 -0
  122. {codecin-5.8.0 → codecin-5.9.0}/codecin/console.py +0 -0
  123. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/array.cin +0 -0
  124. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/bigint.cin +0 -0
  125. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/bits.cin +0 -0
  126. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/bitset.cin +0 -0
  127. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/combin.cin +0 -0
  128. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/conv.cin +0 -0
  129. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/cppstd.cin +0 -0
  130. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/cstd.cin +0 -0
  131. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/csv.cin +0 -0
  132. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/dp.cin +0 -0
  133. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/fmt.cin +0 -0
  134. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/frac.cin +0 -0
  135. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/graph.cin +0 -0
  136. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/hash.cin +0 -0
  137. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/heap.cin +0 -0
  138. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/io.cin +0 -0
  139. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/json.cin +0 -0
  140. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/key.cin +0 -0
  141. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/math.cin +0 -0
  142. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/matrix.cin +0 -0
  143. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/queue.cin +0 -0
  144. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/rand.cin +0 -0
  145. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/set.cin +0 -0
  146. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/sort.cin +0 -0
  147. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/stat.cin +0 -0
  148. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/str.cin +0 -0
  149. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/termux.cin +0 -0
  150. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/test.cin +0 -0
  151. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/time.cin +0 -0
  152. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/tree.cin +0 -0
  153. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/unionfind.cin +0 -0
  154. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/validate.cin +0 -0
  155. {codecin-5.8.0 → codecin-5.9.0}/codecin/lib/vec.cin +0 -0
  156. {codecin-5.8.0 → codecin-5.9.0}/codecin/logger.py +0 -0
  157. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/build.ps1 +0 -0
  158. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/build.sh +0 -0
  159. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/compiler/compile_test.go +0 -0
  160. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/compiler/parser.go +0 -0
  161. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/compiler/tokenizer.go +0 -0
  162. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/compiler/types.go +0 -0
  163. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/args.go +0 -0
  164. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/audio.go +0 -0
  165. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/audio_other.go +0 -0
  166. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/audio_test.go +0 -0
  167. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/audio_windows.go +0 -0
  168. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/canvas.go +0 -0
  169. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/console_other.go +0 -0
  170. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/console_windows.go +0 -0
  171. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/crom.go +0 -0
  172. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/encode.go +0 -0
  173. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/engine_test.go +0 -0
  174. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/gui.go +0 -0
  175. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/gui_stub.go +0 -0
  176. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/gui_test.go +0 -0
  177. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/gui_windows.go +0 -0
  178. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/gui_x11.go +0 -0
  179. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/host_test.go +0 -0
  180. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/hostcrypto.go +0 -0
  181. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/hostdesktop.go +0 -0
  182. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard.go +0 -0
  183. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard_other.go +0 -0
  184. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard_stub.go +0 -0
  185. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard_termios_darwin.go +0 -0
  186. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard_termios_linux.go +0 -0
  187. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard_test.go +0 -0
  188. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard_windows.go +0 -0
  189. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/keyboard_windows_test.go +0 -0
  190. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/mem_other.go +0 -0
  191. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/mem_windows.go +0 -0
  192. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/stdin.go +0 -0
  193. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/stdin_other.go +0 -0
  194. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/stdin_windows.go +0 -0
  195. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/system.go +0 -0
  196. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/engine/termux.go +0 -0
  197. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/go.mod +0 -0
  198. {codecin-5.8.0 → codecin-5.9.0}/codecin/native/ir/ir.go +0 -0
  199. {codecin-5.8.0 → codecin-5.9.0}/codecin/registers.py +0 -0
  200. {codecin-5.8.0 → codecin-5.9.0}/codecin.egg-info/dependency_links.txt +0 -0
  201. {codecin-5.8.0 → codecin-5.9.0}/codecin.egg-info/entry_points.txt +0 -0
  202. {codecin-5.8.0 → codecin-5.9.0}/codecin.egg-info/requires.txt +0 -0
  203. {codecin-5.8.0 → codecin-5.9.0}/codecin.egg-info/top_level.txt +0 -0
  204. {codecin-5.8.0 → codecin-5.9.0}/examples/asm_constants.asm +0 -0
  205. {codecin-5.8.0 → codecin-5.9.0}/examples/bitwise_builtins.cin +0 -0
  206. {codecin-5.8.0 → codecin-5.9.0}/examples/control_flow.cin +0 -0
  207. {codecin-5.8.0 → codecin-5.9.0}/examples/enum_range_for.cin +0 -0
  208. {codecin-5.8.0 → codecin-5.9.0}/examples/gui_demo.cin +0 -0
  209. {codecin-5.8.0 → codecin-5.9.0}/examples/literals_types.cin +0 -0
  210. {codecin-5.8.0 → codecin-5.9.0}/examples/local_audio.cin +0 -0
  211. {codecin-5.8.0 → codecin-5.9.0}/examples/modules_demo.cin +0 -0
  212. {codecin-5.8.0 → codecin-5.9.0}/examples/stdlib_demo.cin +0 -0
  213. {codecin-5.8.0 → codecin-5.9.0}/examples/system_interaction.cin +0 -0
  214. {codecin-5.8.0 → codecin-5.9.0}/misc/vim/ftdetect/codecin.vim +0 -0
  215. {codecin-5.8.0 → codecin-5.9.0}/misc/vim/syntax/cin.vim +0 -0
  216. {codecin-5.8.0 → codecin-5.9.0}/misc/vim/syntax/codecinasm.vim +0 -0
  217. {codecin-5.8.0 → codecin-5.9.0}/misc/vscode-cin/.vscodeignore +0 -0
  218. {codecin-5.8.0 → codecin-5.9.0}/misc/vscode-cin/README.md +0 -0
  219. {codecin-5.8.0 → codecin-5.9.0}/misc/vscode-cin/build.bat +0 -0
  220. {codecin-5.8.0 → codecin-5.9.0}/misc/vscode-cin/language-configuration.json +0 -0
  221. {codecin-5.8.0 → codecin-5.9.0}/misc/vscode-cin/package.json +0 -0
  222. {codecin-5.8.0 → codecin-5.9.0}/misc/vscode-cin/snippets/cin.json +0 -0
  223. {codecin-5.8.0 → codecin-5.9.0}/misc/vscode-cin/syntaxes/cin.tmLanguage.json +0 -0
  224. {codecin-5.8.0 → codecin-5.9.0}/pyproject.toml +0 -0
  225. {codecin-5.8.0 → codecin-5.9.0}/script/bump_version.py +0 -0
  226. {codecin-5.8.0 → codecin-5.9.0}/script/check_paths.py +0 -0
  227. {codecin-5.8.0 → codecin-5.9.0}/script/gen_isa_docs.py +0 -0
  228. {codecin-5.8.0 → codecin-5.9.0}/setup.cfg +0 -0
  229. {codecin-5.8.0 → codecin-5.9.0}/setup.py +0 -0
@@ -5,6 +5,149 @@
5
5
 
6
6
  ---
7
7
 
8
+ ## [5.9.0] - 2026-10-05
9
+
10
+ 一次「单引擎 + 大内存 + 系统能力」的架构发布:**纯 Python 解释器与 JIT
11
+ 被移除**,全部程序统一由 Go 原生引擎执行;内存默认从 64 KB 提升到
12
+ **1 GiB(稀疏分页, 按需提交)**;新增 **FFI 动态库调用**与**完整网络**
13
+ (HTTP 扩展 / TCP / UDP / DNS)系统调用。持久化格式升级为段式
14
+ (CROM v4 / BIN v3),只保存实际使用的内存页。
15
+
16
+ ### 变更 (Changed)
17
+
18
+ #### 删除 Python 解释器与 JIT (native-only)
19
+ - **`jit.py` / `debugger.py` / `cache.py` 整体删除**,`CPU` 重构为
20
+ native-only 执行编排:编译/装载 (.cin/.asm/.pl/.bin/.crom) + 结果回传。
21
+ 动态库缺失时抛 `CPUSimulatorError` 并附重建指引(不再有解释器回退)。
22
+ - 引擎 ABI 升级为 **v2**(`codecin_run_v2`):一次调用回传寄存器/向量/
23
+ NZCV/脏内存段/输出,Python 侧无逐条解释开销。
24
+ - 相关 CLI 选项与配置项(`use_native` / JIT 统计 / 调试器等)随之移除,
25
+ `--stats` 只保留原生引擎数据。
26
+ - 新 ABI 下原生库版本不匹配(缺 `codecin_run_v2` 导出)会被识别并提示
27
+ 重建,而非静默失败。
28
+
29
+ #### 内存默认 64 KB -> 1 GiB (动态分配)
30
+ - **逻辑 1 GiB, 4 KiB 稀疏分页**:Python 侧 `FastMemory` 重写为按需分配页
31
+ 的稀疏字典,`resident_bytes` 只统计已触碰页——1 GiB 地址空间常驻内存
32
+ 只有实际写入的几 KB。
33
+ - Go 引擎侧配合 `make([]byte, memSize)`(OS 懒提交)+ **脏页位图**:执行
34
+ 结束只回传被写过的 4 KiB 页(段式),整程序执行后写回稀疏内存。
35
+ - 大数组/大缓冲不再需要 `--mem-size`:默认即可 `int a[1000000]`。
36
+
37
+ #### 持久化格式: 段式 CROM v4 / BIN v3
38
+ - CROM v4(16 B 头 + zlib 可选压缩段表)与 BIN v3(50 B 头 + 段表 +
39
+ bytecode)只保存已分配页;`.pytest_tmp` 内 1 GiB 镜像实测仅数 KB。
40
+ - 旧 BIN v2(34 B 头)仍可读;反汇编器(`disasm.py`)同步支持两种头。
41
+
42
+ ### 新增 (Added)
43
+
44
+ #### FFI: 动态库调用 (SYS 140-144)
45
+ - `ffi_load(path)` / `ffi_find(handle, symbol)` / `ffi_call(fn, argbuf, n)` /
46
+ `ffi_callf(fn, argbuf, n)` / `lib_close(handle)`:Windows
47
+ (LoadLibrary/GetProcAddress) 与 Unix (dlopen/dlsym) 双实现,最多 8 个
48
+ int64/IEEE754 位参数(浮点经 Windows x64 XMM0-3 / SysV XMM0-7 正确传参)。
49
+ - 标准库 `lib/ffi.cin`:`ffi_call0..ffi_call8` / `ffi_callf1..ffi_callf4`
50
+ 便捷封装(局部数组作参数缓冲)。
51
+ - 无效句柄/参数越界报明确错误信息;`dlopen`/`dlsym` 失败返回 0 不抛异常。
52
+
53
+ #### 网络: HTTP 扩展 / TCP / UDP / DNS (SYS 145-157)
54
+ - **HTTP**:`http_req(method, url, headers, body)`(自定义方法与
55
+ `Key: Value\n` 头)+ `http_code()` 状态码查询;既有 `http_get`/`http_post`
56
+ 同样记录状态码。15 s 超时,响应体上限 8 MiB。
57
+ - **TCP**:`tcp_dial` / `tcp_send` / `tcp_recv` / `tcp_close` /
58
+ `tcp_listen` / `tcp_accept`(10 s 连接超时;收发上限 4/8 MiB)。
59
+ - **UDP**:`udp_open` / `udp_sendto` / `udp_recvfrom`(源地址回填
60
+ "ip:port")/ `udp_close`。
61
+ - **DNS**:`dns_lookup(host)` 返回 IP 字符串(偏好 IPv4 —— Windows 下
62
+ `localhost` 常先返回 ::1,对端只听 IPv4 时不再丢包)。
63
+ - 主机名参数统一支持(`tcp_dial("example.com", 80)`、
64
+ `udp_sendto(fd, "localhost", ...)`)。
65
+ - 标准库 `lib/net.cin`:字符串收发(`tcp_send_str`/`tcp_recv_line`/
66
+ `udp_send_str` 等)、`http_get_headers`/`http_post_headers`/`http_ok`、
67
+ `tcp_roundtrip`/`tcp_server`、`dns_resolve`/`dns_ok`。
68
+
69
+ ### 修复 (Fixed)
70
+ - **`http_get`/`http_post` 不记录状态码**:`http_code()` 此前对这两个内建
71
+ 恒返回 0(只有 `http_req` 更新 `lastHTTPSt`),现在三者语义一致。
72
+ - **FFI 浮点传参走错寄存器**:C 桥此前把函数指针声明为整型参数,Windows
73
+ x64/SysV 下目标函数从 XMM 读到垃圾——`ffi_callf2(pow, 3.0, 4.0)` 实际算出
74
+ `pow(x, 0) = 1`。现按 double 类型传参(位模式经 memcpy 保持不变)。
75
+ - `udp_sendto` 主机名解析只取第一个地址(可能为 IPv6),现偏好 IPv4。
76
+
77
+ ### 移除 (Removed)
78
+ - `codecin/jit.py`、`codecin/debugger.py`、`codecin/cache.py` 及对应测试
79
+ (9 个废弃测试文件删除;`use_native` 参数化全部收敛为单路径)。
80
+ - `PageFaultError`(并入 `MemoryAccessError`)。
81
+ - 沙箱语义不变:`--sandbox` 下仅放行 ALLOCFRAME/TIMEUS/TIMENS,
82
+ 其余宿主 SYS(网络/FFI/音频/画布等)报
83
+ `Host capability disabled in sandbox mode`。
84
+
85
+ ---
86
+
87
+ ## [5.8.2] - 2026-10-04
88
+
89
+ 一次以「真实压测程序暴露的错误信息与栈安全」为主线的修复发布。核心结论:
90
+ 5.5.3 的浮点下标修复在三条执行路径均有效(`a[(n * p) / 100]` 一类变量参与
91
+ 的浮点表达式同样覆盖);用户在 Termux 上报告的 `address ffffffffffffc6f8
92
+ out of bounds` 实为**局部大数组把栈推成负地址**——`int lat[10000]` 需要
93
+ 80 KB 局部空间,超过默认 64 KB 内存后 SP 绕回,越界检查检查的是绕回后的
94
+ 地址。为此新增带防护的帧分配系统调用(SYS 137),并全面改进运行时/编译期
95
+ 错误信息、补齐 CLI 直传参数与高精度计时。
96
+
97
+ ### 修复 (Fixed)
98
+
99
+ #### 局部大数组撑爆栈(静默生成负地址)
100
+ - **函数序言的帧分配改为带防护的系统调用**。此前 prologue 用裸 `ADDI sp, sp,
101
+ -frame_bytes` 递减栈指针,局部数组总大小超过可用内存时 SP 绕回为巨大无符号
102
+ 值(如 0xFFFFFFFFFFFFC6F8),后续所有访问都指向"负地址",报错只看到一句
103
+ out of bounds,看不出真因。现在两侧编译器(`cin.py` / `codegen.go`)改为
104
+ `SYS ALLOCFRAME`:VM 侧用**有符号比较**在分配前检查栈余量(含 4 KB 警戒
105
+ 线),不足时直接报
106
+ `Stack overflow: frame needs N bytes, stack headroom only M bytes (...)
107
+ Try --mem-size (default 65536) or smaller local arrays`,
108
+ 不再让绕回地址流入访存路径。Python 解释器、JIT、Go 原生三条路径语义一致。
109
+ - **负地址越界提示兜底**:地址 >= 2^63 的越界报错(Python `memory.py` 与
110
+ Go `checkAddr`)追加
111
+ `(negative address: stack overflow or bad pointer?)`,把"看起来像随机大数"
112
+ 的地址翻译成可排查的方向。
113
+
114
+ #### 错误信息补全(问题 2/4/5)
115
+ - **Heap exhausted 附用量与建议**:三处堆耗尽点(malloc / 字符串拼接 / 字符串
116
+ 操作)在 Python 与 Go 两侧逐字一致地报
117
+ `Heap exhausted: need N bytes, free M bytes (heap 0x...0x...).
118
+ Try --mem-size (default 65536) or reduce allocations`。
119
+ - **非常量数组长度的编译期报错附 hint**:
120
+ `array lengths must be compile-time constants; declare it as
121
+ \`const int NAME = ...\`; variable-length arrays are not supported —
122
+ use a fixed-size array plus a count variable`。
123
+ - **`float(x)` / `int(x)` 报错附替代写法**:提示使用 `to_float(x)` / `to_int(x)`
124
+ 或依赖混合表达式的隐式提升。
125
+
126
+ #### 兼容层与文档
127
+ - `gostd.cin` 头注释明确列出当前覆盖的包(strings / strconv / math / slices /
128
+ os.Args)与**未覆盖项**(time、os 文件读写、net/http、sync),并指向对应
129
+ 内建(`time_ms/time_us/time_ns`、`file_*` 函数族),避免"Go 标准库兼容层"
130
+ 的命名让人误以为常用包会逐步全覆盖。
131
+
132
+ ### 新增 (Added)
133
+
134
+ #### CLI 程序名后直传参数
135
+ - `codecin 压测.cin https://example.com 24` 现在可用:程序文件之后的裸参数
136
+ 原样传给 CIN 程序(`arg_count()` / `arg(i)`),已知 CLI 选项放在程序之前或
137
+ 之后均可识别;形如选项的直传参数给出 stderr 提示并用 `--` 显式分隔。
138
+ `--` 分隔符行为不变且优先级最高,`--help` 新增 Program arguments 说明段。
139
+
140
+ #### 高精度计时 `time_us()` / `time_ns()`(SYS 138/139)
141
+ - 微秒 / 纳秒级单调计时,补齐 `time_ms()` 只能测毫秒的短板(压测与微基准
142
+ 基础设施)。两侧编译器同步登记,解释器 / JIT / 原生三条路径均可用;
143
+ 与 ALLOCFRAME 同属核心 VM 机制,不触发沙箱门禁与原生路径限定。
144
+
145
+ #### 显式类型转换 `to_int()` / `to_float()`
146
+ - 数值类型(int/float/bool)间的显式转换,语义与隐式转换一致(float→int 向零
147
+ 截断)。非数值参数在编译期报错并说明。
148
+
149
+ ---
150
+
8
151
  ## [5.8.0] - 2026-10-04
9
152
 
10
153
  一次「图形、媒体与跨平台兼容」发布:新增 **GUI 窗口**(Windows Win32 /