Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b2352dc
feat(ir): type sparse logical construction policies
moluopro Jul 19, 2026
e0f8d62
feat(ir): preserve logical sparse lifecycle types
moluopro Jul 19, 2026
b24d5b4
feat(javascript): implement logical sparse CSC lifecycle
moluopro Jul 19, 2026
8d92115
feat(cpp): implement logical sparse CSC lifecycle
moluopro Jul 19, 2026
a6d3c55
test(matlab): cover logical sparse CSC lifecycle
moluopro Jul 19, 2026
f7accd4
fix(cpp): count dense logical vectors safely
moluopro Jul 19, 2026
253d5d5
test(matlab): execute logical sparse differential corpus
moluopro Jul 19, 2026
4c4815f
test(generated): reject logical sparse shape corruption
moluopro Jul 19, 2026
d832f12
refactor(backends): serialize sparse calls from target LIR
moluopro Jul 19, 2026
51a2870
test(lir): reject logical sparse ABI corruption
moluopro Jul 19, 2026
811369c
test(architecture): enforce logical sparse layer ownership
moluopro Jul 19, 2026
c20d92b
test(performance): gate logical sparse compilation
moluopro Jul 19, 2026
72f3bd8
docs(matlab): document logical sparse lifecycle
moluopro Jul 19, 2026
96bcc85
docs(architecture): specify typed sparse target ABI
moluopro Jul 19, 2026
0f70a7a
docs(testing): record logical sparse gates
moluopro Jul 19, 2026
13c4984
docs(changelog): remove internal validation metrics
moluopro Jul 19, 2026
aaa854e
build(release): reject internal changelog metadata
moluopro Jul 19, 2026
6a0b55e
fix(javascript): preserve sparse solve value domain
moluopro Jul 19, 2026
6859bcd
fix(runtime): align sparse assignment diagnostics
moluopro Jul 19, 2026
2e3f795
perf(benchmark): avoid logical sparse string temporaries
moluopro Jul 19, 2026
524b3ed
docs(changelog): publish logical sparse 0.6.9 notes
moluopro Jul 19, 2026
25e3548
build(version): advance project to 0.6.9
moluopro Jul 19, 2026
a602e8a
docs(version): align 0.6.9 release identity
moluopro Jul 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions CHANGELOG-ZH.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 0.6.9

- Matlab `sparse(A)` 现可接受静态 shape 的 logical rank-2 数组,并产生类型化 logical CSC 矩阵。
- 推断 shape、显式 shape 与 `nzmax` 三类 R2024 triplet 构造形式现均支持 logical value。
- 重复 logical triplet 坐标按照 Matlab 语义使用 `any` 聚合,不再执行数值加法。
- false logical value 不会作为显式 entry 保留在 canonical CSC 存储中。
- 稀疏普通转置与共轭转置现可保持 logical 值类型。
- scalar、linear 与 Cartesian submatrix selection 会在适用结果上保持 logical sparse 存储和类型。
- indexed assignment、扩容与删除会保持 logical CSC;写入 false 会删除对应存储项。
- sparse reshape 会保持 logical value、Matlab 列主序、推断维度和零 extent。
- logical sparse 输入经 `full` 转换后返回 logical dense 数组,`issparse` 与 `nnz` 保持预期行为。
- 生成的 JavaScript 为 sparse value domain 携带显式 tag,并在使用前拒绝损坏的 logical CSC value。
- 生成的 C++17 使用 `sparse_matrix<bool>` 表示 logical CSC,并安全处理压缩 logical vector 存储。
- JavaScript 与 C++17 使用彼此独立的类型化 sparse runtime,不要求先生成另一目标。
- 修复引入类型化 sparse conversion ABI 后,sparse RHS 方阵求解的转换错误。
- sparse assignment 失败现在会在生成的 JavaScript 与 C++17 中使用一致的 real-or-logical 诊断。

## 0.6.8

- Matlab 稀疏矩阵现可在已支持的静态 finite-real rank-2 能力中完整保持零 extent。
Expand All @@ -13,8 +30,6 @@
- 双目标 LIR v34 新增显式 runtime shape 调用 ABI,使 renderer 只序列化已验证调用,不再恢复 semantic storage 或 shape policy。
- source map 会保留全部新增稀疏操作以及零维左除、右除的原始调用位置。
- 新增零 extent sparse 的双目标差分执行、生成计划拒错、跨层损坏、fuzz 与架构覆盖。
- 验证基线现包含 268 项 C++ 测试、98 个差分 case、127 项 CTest 和 18 项生成 runtime 拒错测试。
- 生产源码覆盖率为 91.69%(37,154/40,520 行),既有 sparse-solve 性能预算无需放宽即可通过。

## 0.6.7

Expand All @@ -29,10 +44,8 @@
- source map 会为全部稀疏 operand 组合保留原始 `.*` 表达式位置。
- complex、零 extent、动态 shape 或不兼容的稀疏逐元素运算继续失败关闭,不会静默改变语义。
- 新增可执行 Matlab 示例,在两个输出目标间比较数值、shape 与稀疏存储。
- 验证基线现包含 258 项 C++ 测试、97 个差分 case、124 项 CTest 和 16 项生成 runtime 拒错测试。
- Matlab fuzz corpus 现覆盖稀疏逐元素语法、操作数方向、广播与 runtime 验证边界。
- 新增独立 sparse element-wise benchmark,约束编译延迟、吞吐、arena 峰值与生成代码大小。
- 生产源码覆盖率为 91.59%(36,732/40,103 行),高于 85% 硬门槛。

## 0.6.6

Expand Down Expand Up @@ -110,7 +123,7 @@
- 跨层 verifier 会在发射前拒绝损坏的 sparse-index identity、arity、shape、type、storage 或 inactive-state fact。
- 当 storage representation 已知时,`full` 现可接受结果 extent 为动态值或零值的 rank-two dense/CSC selection。
- sparse assignment、超过两个 selector、complex/sparse selector、N 维 linear result,以及动态、空或 complex sparse source 继续以稳定诊断失败关闭。
- 新增可执行 sparse-indexing 示例,覆盖双目标行为、source-map 保留、越界拒绝与 fuzz 回归;生产代码行覆盖率为 91.24%(33,780/37,023)
- 新增可执行 sparse-indexing 示例,覆盖双目标行为、source-map 保留、越界拒绝与 fuzz 回归。

## 0.6.1

Expand Down
23 changes: 18 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 0.6.9

- Matlab `sparse(A)` now accepts statically shaped logical rank-two arrays and produces typed logical CSC matrices.
- Logical triplet constructors are supported across the inferred, explicitly sized, and `nzmax` R2024 call forms.
- Duplicate logical triplets now follow Matlab semantics by combining values with `any` instead of numeric addition.
- False logical values are omitted from canonical CSC storage rather than retained as explicit entries.
- Ordinary and conjugating sparse transpose preserve the logical value class.
- Scalar, linear, and Cartesian submatrix selection preserve logical sparse storage and result type where applicable.
- Indexed assignment, growth, and deletion preserve logical CSC matrices, with false assignments removing stored entries.
- Sparse reshape preserves logical values, Matlab column-major order, inferred dimensions, and zero extents.
- `full` returns logical dense arrays for logical sparse inputs, while `issparse` and `nnz` retain their expected behavior.
- Generated JavaScript carries an explicit sparse value-domain tag and rejects malformed logical CSC values before use.
- Generated C++17 uses `sparse_matrix<bool>` for logical CSC values and safely handles packed logical-vector storage.
- JavaScript and C++17 use independent typed sparse runtimes and do not require one target to be generated before the other.
- Fixed sparse square solves with sparse right-hand sides after introducing the typed sparse conversion ABI.
- Sparse assignment failures now use consistent real-or-logical diagnostics across generated JavaScript and C++17.

## 0.6.8

- Matlab sparse matrices now preserve zero extents throughout the supported static, finite-real rank-two feature set.
Expand All @@ -13,8 +30,6 @@
- Target LIR v34 now carries an explicit runtime shape-call ABI, allowing renderers to serialize validated calls without recovering semantic storage or shape policy.
- Source maps preserve every new sparse operation and zero-dimensional left- or right-division call site.
- Added dual-target differential execution, generated-plan rejection, cross-layer corruption, fuzz, and architecture coverage for zero-extent sparse behavior.
- The validation baseline now contains 268 C++ tests, 98 differential cases, 127 CTest entries, and 18 generated-runtime rejection tests.
- Production source coverage is 91.69% (37,154 of 40,520 lines), and the existing sparse-solve performance budget passes without being widened.

## 0.6.7

Expand All @@ -29,10 +44,8 @@
- Source maps preserve the original `.*` expression location for every sparse operand arrangement.
- Complex, zero-extent, dynamically shaped, and incompatible sparse element-wise operations continue to fail closed with diagnostics instead of changing semantics.
- Added an executable Matlab example that compares values, shape, and sparse storage across both output targets.
- The validation baseline now contains 258 C++ tests, 97 differential cases, 124 CTest entries, and 16 generated-runtime rejection tests.
- The Matlab fuzz corpus now exercises sparse element-wise syntax, operand directions, broadcasting, and runtime validation boundaries.
- A dedicated sparse element-wise benchmark constrains compilation latency, throughput, peak arena memory, and generated-code size.
- Production source coverage is 91.59% (36,732 of 40,103 lines), above the 85% required threshold.

## 0.6.6

Expand Down Expand Up @@ -110,7 +123,7 @@
- Cross-layer verifiers reject corrupted sparse-index identity, arity, shape, type, storage, or inactive-state facts before emission.
- `full` now accepts rank-two dense or CSC selections with dynamic or zero result extents when their storage representation is known.
- Sparse assignment, more than two selectors, complex or sparse selectors, N-dimensional linear results, and dynamic, empty, or complex sparse sources continue to fail closed with stable diagnostics.
- Added an executable sparse-indexing example with dual-target behavior, source-map preservation, out-of-bounds rejection, and fuzz regression coverage; production line coverage is 91.24% (33,780/37,023).
- Added an executable sparse-indexing example with dual-target behavior, source-map preservation, out-of-bounds rejection, and fuzz regression coverage.

## 0.6.1

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20)

project(
mpf
VERSION 0.6.8
VERSION 0.6.9
DESCRIPTION "Modern, high-performance multilingual translation framework."
LANGUAGES C CXX)

Expand Down
6 changes: 3 additions & 3 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

| 输入语言 | 自动识别扩展名 | 当前能力摘要 |
|---|---|---|
| Matlab | `.m` | 脚本与局部函数、条件/循环/标量 `switch`、N 维逐元素 `~`/`&`/`|`、标量短路 `&&`/`||`、数组 condition truthiness、保持 shape 的 `all`/`any` 逻辑归约、实数与复数标量/数组、保持 shape 的 `0×0` 与零 extent 数组、静态 N 维及 local-function runtime-shape 隐式扩展、数组比较、静态及运行时 extent 的 `end`、保序/重复/空 numeric selector、线性/逐维 logical selector、vector/matrix/N 维扩容与单轴删除、普通/共轭转置、section、`reshape`、复数逐元素算术、二维实数/复数矩阵乘法、结构感知实数方阵求解、Hermitian 正定/稠密复数方阵求解、rank-aware 实数/复数矩形求解、R2024 全部 `sparse` 调用形式在静态 real rank-2 CSC contract(包含零 extent)内的实现、稀疏 scalar/linear/submatrix selection、indexed assignment、扩容、删除、reshape、转置/查询/计数、含 `0×0` 系数及 shaped-empty 结果的稀疏方阵求解,以及保持 Matlab 结果 storage 的 finite-real sparse×sparse/sparse×dense/dense×sparse 矩阵乘法、双向 sparse/scalar 缩放和 compatible-size sparse `.*` scalar/dense/sparse 乘法、实数/复数方阵 safe-integer 整数幂与多输出函数 |
| Matlab | `.m` | 脚本与局部函数、条件/循环/标量 `switch`、N 维逐元素 `~`/`&`/`|`、标量短路 `&&`/`||`、数组 condition truthiness、保持 shape 的 `all`/`any` 逻辑归约、实数与复数标量/数组、保持 shape 的 `0×0` 与零 extent 数组、静态 N 维及 local-function runtime-shape 隐式扩展、数组比较、静态及运行时 extent 的 `end`、保序/重复/空 numeric selector、线性/逐维 logical selector、vector/matrix/N 维扩容与单轴删除、普通/共轭转置、section、`reshape`、复数逐元素算术、二维实数/复数矩阵乘法、结构感知实数方阵求解、Hermitian 正定/稠密复数方阵求解、rank-aware 实数/复数矩形求解、R2024 全部 `sparse` 调用形式对静态 real/logical rank-2 输入的实现(全零构造仍返回 double)、logical triplet 重复坐标按 `any` 合并,以及保持类型的稀疏 scalar/linear/submatrix selection、indexed assignment、扩容、删除、reshape、转置/`full`/查询/计数、含 `0×0` 系数及 shaped-empty 结果的稀疏方阵求解,以及保持 Matlab 结果 storage 的 finite-real sparse×sparse/sparse×dense/dense×sparse 矩阵乘法、双向 sparse/scalar 缩放和 compatible-size sparse `.*` scalar/dense/sparse 乘法、实数/复数方阵 safe-integer 整数幂与多输出函数 |
| Python | `.py`、`.pyw` | 函数与参数、条件和循环、list/tuple、解包、比较链、多维数组、索引和切片 |
| Fortran | `.f`、`.for`、`.ftn`、`.f77`、`.f90` 等 | free/fixed form、function/subroutine、`INTENT`/`OPTIONAL`、数组与 section、`SELECT CASE` |
| TypeScript | `.ts`、`.mts`、`.cts` | 类型化标量和数组、函数、块作用域、条件、`while`、标准 C 风格 `for` |
Expand Down Expand Up @@ -124,7 +124,7 @@ cmake --install build/release --prefix build/stage
在项目中查找当前精确版本:

```cmake
find_package(mpf 0.6.8 EXACT CONFIG REQUIRED COMPONENTS core cpp)
find_package(mpf 0.6.9 EXACT CONFIG REQUIRED COMPONENTS core cpp)
target_link_libraries(my_application PRIVATE mpf::mpf)
```

Expand Down Expand Up @@ -152,7 +152,7 @@ int main() {
}
```

安装包提供 `core`、`javascript` 和 `cpp` component,以及 `mpf::core`、`mpf::backend-javascript`、`mpf::backend-cpp` 和统一入口 `mpf::mpf`。完整集成示例见 [`examples/embedding`](examples/embedding);配置时传入 `-DMPF_REQUIRED_VERSION=0.6.8`,以保持精确版本匹配。
安装包提供 `core`、`javascript` 和 `cpp` component,以及 `mpf::core`、`mpf::backend-javascript`、`mpf::backend-cpp` 和统一入口 `mpf::mpf`。完整集成示例见 [`examples/embedding`](examples/embedding);配置时传入 `-DMPF_REQUIRED_VERSION=0.6.9`,以保持精确版本匹配。

MPF 0.x 有意只安装静态库。共享库需要先明确符号导出、allocator/所有权和版本协商契约;设置 `BUILD_SHARED_LIBS` 不会把当前内部 C++ ABI 意外暴露为受支持的动态库接口。

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A modern, high-performance multilingual transpilation framework. MPF converts su

| Input language | Recognized extensions | Current capabilities |
|---|---|---|
| Matlab | `.m` | Scripts and local functions, conditionals/loops/scalar `switch`, element-wise N-D `~`/`&`/`|`, scalar short-circuit `&&`/`||`, array condition truthiness, shape-aware `all`/`any` logical reductions, real and complex scalars/arrays, shape-preserving `0×0` and zero-extent arrays, static N-D and local-function runtime-shape implicit expansion, array comparisons, static and runtime-sized `end`, ordered/repeated/empty numeric and linear/per-dimension logical selectors, vector/matrix/N-D growth and single-axis deletion, ordinary/conjugate transpose, sections, `reshape`, complex element-wise arithmetic, two-dimensional real/complex matrix multiplication, structure-aware real square solves, Hermitian-positive-definite/dense complex square solves, rank-aware real/complex rectangular solves, all R2024 `sparse` call forms within the static real rank-2 CSC contract including zero extents, sparse scalar/linear/submatrix selection plus indexed assignment, growth, deletion, reshape, transpose/query/count, square solves including `0×0` coefficients and shape-preserving empty results, finite-real sparse×sparse/sparse×dense/dense×sparse matrix multiplication, bidirectional sparse/scalar scaling, and compatible-size sparse `.*` scalar/dense/sparse multiplication with Matlab-compatible canonical CSC results, safe-integer real/complex square matrix power, and multiple-output functions |
| Matlab | `.m` | Scripts and local functions, conditionals/loops/scalar `switch`, element-wise N-D `~`/`&`/`|`, scalar short-circuit `&&`/`||`, array condition truthiness, shape-aware `all`/`any` logical reductions, real and complex scalars/arrays, shape-preserving `0×0` and zero-extent arrays, static N-D and local-function runtime-shape implicit expansion, array comparisons, static and runtime-sized `end`, ordered/repeated/empty numeric and linear/per-dimension logical selectors, vector/matrix/N-D growth and single-axis deletion, ordinary/conjugate transpose, sections, `reshape`, complex element-wise arithmetic, two-dimensional real/complex matrix multiplication, structure-aware real square solves, Hermitian-positive-definite/dense complex square solves, rank-aware real/complex rectangular solves, all R2024 `sparse` call forms for statically shaped real or logical rank-2 inputs (zero-matrix construction remains double), logical duplicate triplets using `any`, type-preserving sparse scalar/linear/submatrix selection plus indexed assignment, growth, deletion, reshape, transpose/`full`/query/count, square solves including `0×0` coefficients and shape-preserving empty results, finite-real sparse×sparse/sparse×dense/dense×sparse matrix multiplication, bidirectional sparse/scalar scaling, and compatible-size sparse `.*` scalar/dense/sparse multiplication with Matlab-compatible canonical CSC results, safe-integer real/complex square matrix power, and multiple-output functions |
| Python | `.py`, `.pyw` | Functions and parameters, conditionals and loops, lists/tuples, unpacking, comparison chains, multidimensional arrays, indexing, and slicing |
| Fortran | `.f`, `.for`, `.ftn`, `.f77`, `.f90`, and others | Free/fixed form, functions/subroutines, `INTENT`/`OPTIONAL`, arrays and sections, and `SELECT CASE` |
| TypeScript | `.ts`, `.mts`, `.cts` | Typed scalars and arrays, functions, block scope, conditionals, `while`, and standard C-style `for` loops |
Expand Down Expand Up @@ -124,7 +124,7 @@ cmake --install build/release --prefix build/stage
Find the exact current version in another project:

```cmake
find_package(mpf 0.6.8 EXACT CONFIG REQUIRED COMPONENTS core cpp)
find_package(mpf 0.6.9 EXACT CONFIG REQUIRED COMPONENTS core cpp)
target_link_libraries(my_application PRIVATE mpf::mpf)
```

Expand Down Expand Up @@ -152,7 +152,7 @@ int main() {
}
```

The installed package provides the `core`, `javascript`, and `cpp` components; the `mpf::core`, `mpf::backend-javascript`, and `mpf::backend-cpp` targets; and the unified `mpf::mpf` entry point. See [`examples/embedding`](examples/embedding) for a complete integration example; configure it with `-DMPF_REQUIRED_VERSION=0.6.8` so the consumer keeps exact-version matching.
The installed package provides the `core`, `javascript`, and `cpp` components; the `mpf::core`, `mpf::backend-javascript`, and `mpf::backend-cpp` targets; and the unified `mpf::mpf` entry point. See [`examples/embedding`](examples/embedding) for a complete integration example; configure it with `-DMPF_REQUIRED_VERSION=0.6.9` so the consumer keeps exact-version matching.

MPF 0.x installs static libraries deliberately. A supported shared-library ABI will require an explicit symbol-export, allocator/ownership, and version-negotiation contract; setting `BUILD_SHARED_LIBS` does not silently expose the current internal C++ ABI.

Expand Down
Loading
Loading