feat(vqt6/vipermath/vipersimd/w32/requests): 自绘 Canvas/Graph3D/ChartView 与 Qt6 Charts、新增 gzip 与 torch-lite 模块, 修包装类悬垂指针与中文路径/exp/大文件下载

- vqt6: 包装类统一补 __new__ 堆分配, 修"创建函数栈帧 alloca"被存进字段/跨帧返回后 _ptr 悬垂(传给 QLayout::addWidget 等即崩溃); 菜单类按依赖顺序前移, menuBar()/statusBar() 改返回裸指针; 接入 Qt6 Charts 并新增 _bridge_canvas(Canvas 手绘板 / Graph3D 软件 3D 网络图 / ChartView 折线图); 新增自绘 QRadioButton(圆环+内点, 过渡动画)、剪贴板、应用级字体族 API
- 新增模块: gzip.vp(RFC1952/1951 解码器)、torch/(torch-lite 稠密张量 + conv/pool 前反向)
- vipersimd: 新增 scalar_fma/add/mul/sqrt_array 未向量化对照内核(与对应 SIMD 版逐位一致)
- w32: 新增 UTF-8/UTF-16 路径转换, CreateFile/CreateDirectory 走 W 系列, 修中文路径被按 GBK 误读; read_all 参数 max_count -> buf_size 并文档化"容量含终止符"契约
- requests: https 响应缓冲按需翻倍扩容(上限 256MB), 修 MB 级正文(如 MNIST .gz)被 4KB 静默截断
- vipermath: 重写 exp 为范围归约 + 短泰勒, 修负值发散(x=-30 得 3.7e10)与 NaN 触发 2^31 次缩放导致的卡死
- builtins: 新增 sizet/uzt 别名; stdarg: va_arg 参数 CType -> CPtr
- chore: 删除 vendored jpeg change.log
This commit is contained in:
TermiNexus committed 2026-09-10 23:09:05 +08:00
1 parent 7d092f25b1
commit 728d090815
22 files changed
+3921 -761

No files matched your search

+25 -5
View File
@@ -431,8 +431,9 @@ def _HttpsRequest(method: str, url: str, verify: bool, ca_file: str, data: str,
requests._mbuddy.free(req_buf)
# ---- 接收响应 ----
resp_buf: str = requests._mbuddy.alloc(requests.HTTP_BUFSIZ)
# ---- 接收响应(缓冲自动翻倍增长, 支持 MB 级正文, 如 MNIST .gz 下载) ----
resp_cap: INT = requests.HTTP_BUFSIZ
resp_buf: str = requests._mbuddy.alloc(t.CSizeT(resp_cap))
if resp_buf is None:
_RecordErrorText("alloc response buffer failed")
openssl.SSL_free(ssl)
@@ -443,9 +444,28 @@ def _HttpsRequest(method: str, url: str, verify: bool, ca_file: str, data: str,
return None
total: INT = 0
while total < requests.HTTP_BUFSIZ - 1:
n: INT = openssl.SSL_read(ssl, resp_buf + total, requests.HTTP_BUFSIZ - 1 - total)
if n <= 0: break
while True:
room: INT = resp_cap - 1 - total
if room <= 0:
# 缓冲已满仍可能有数据: 翻倍扩容(硬上限 256MB, 防失控流)
if resp_cap >= 268435456:
break
resp_cap = resp_cap * 2
nb: t.CVoid | t.CPtr = requests._mbuddy.realloc(resp_buf, t.CSizeT(resp_cap))
if nb is None:
_RecordErrorText("realloc response buffer failed")
requests._mbuddy.free(resp_buf)
openssl.SSL_free(ssl)
openssl.SSL_CTX_free(ctx)
sock.close()
requests._mbuddy.free(errmsg)
requests.release(resp)
return None
resp_buf = t.CChar(t.CUInt64T(nb), t.CPtr)
room = resp_cap - 1 - total
n: INT = openssl.SSL_read(ssl, resp_buf + total, room)
if n <= 0:
break
total += n
resp_buf[total] = 0