Skip to content

Commit 1f68b43

Browse files
committed
Prepare Menudet 1.0 draft release certification
1 parent c6ede83 commit 1f68b43

20 files changed

Lines changed: 3141 additions & 26 deletions

‎.github/workflows/build.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ jobs:
108108
PYTEST_DEADMAN_SECONDS: "300"
109109
PYTEST_DEADMAN_SESSION_SECONDS: "1500"
110110

111+
- name: Certify bounded Menudet math against independent references
112+
run: python scripts/certify_menudet_math.py --report menudet-math.json
113+
114+
- name: Upload Menudet math certification
115+
if: always()
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: menudet-math-${{ matrix.os }}-py${{ matrix.python-version }}-np${{ matrix.numpy-version || 'default' }}
119+
path: menudet-math.json
120+
if-no-files-found: ignore
121+
111122
# TUIs are timing-sensitive and only boot a headless terminal: one OS is
112123
# enough, and a flake here is feedback, not a release blocker.
113124
- name: Test TUI (non-blocking)

‎.github/workflows/cibuildwheels.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ on:
1111

1212
env:
1313
CIBW_BUILD_VERBOSITY: 1
14+
# Every tested wheel checks portable descriptors/persistence and independent
15+
# numeric references, not only whether the extension can be imported.
16+
CIBW_TEST_COMMAND: >-
17+
python -m pytest
18+
{project}/tests/test_portable_artifact.py
19+
{project}/tests/test_portable_descriptor.py
20+
{project}/tests/test_portable_descriptor_host.py
21+
{project}/tests/test_portable_lazy.py
22+
{project}/tests/test_portable_policy.py
23+
{project}/tests/test_portable_table_export.py
24+
{project}/tests/test_dsl_portable.py -q -n 0 &&
25+
python {project}/scripts/certify_menudet_math.py
1426
# Skip testing on aarch64 for now, as it is emulated on GitHub Actions and takes too long
1527
# Now that github provides native arm64 runners, we can enable tests again
1628
# CIBW_TEST_SKIP: "*linux*aarch64*"

‎.github/workflows/wasm-tests.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
# WASM/Pyodide has no SIMD/runtime CPU detection; disable optimised paths
2020
CMAKE_ARGS: "-DWITH_ZLIB_OPTIM=OFF -DWITH_OPTIM=OFF -DWITH_RUNTIME_CPU_DETECTION=OFF"
2121
# cibuildwheel runs the suite automatically in the node/pyodide runtime
22-
CIBW_TEST_COMMAND: "pytest {project}/tests"
22+
CIBW_TEST_COMMAND: >-
23+
pytest {project}/tests &&
24+
python {project}/scripts/certify_menudet_math.py
2325
steps:
2426
- uses: actions/checkout@v7
2527
- uses: actions/setup-python@v7

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ endif()
142142

143143
FetchContent_Declare(miniexpr
144144
GIT_REPOSITORY https://github.com/Blosc/miniexpr.git
145-
GIT_TAG 55c882b238c4daf0523a52a44d5d84db56af24e4
145+
GIT_TAG 3418cdce4b5c11e1661c8b6453e3d31d94b0b2b4
146146
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../miniexpr
147147
)
148148
FetchContent_MakeAvailable(miniexpr)

‎RELEASE_NOTES.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Release notes
22

3+
## Changes from 4.14.2 to 4.15.0 (in development)
4+
5+
### Introducing the Menudet 1.0 draft
6+
7+
**Menudet — a little language for portable computation on arrays and tables.**
8+
9+
- Export normalized `DSLKernel` authoring as validated, standalone JSON artifacts
10+
with typed signatures and exact captured constants. Native miniexpr executes
11+
imports without reconstructing Python functions or falling back to Python.
12+
- Support checked integer arithmetic, operand-typed floating computation, control
13+
flow, fixed-width strings, logical array coordinates and ordered block reductions.
14+
- Keep logical reduction groups stable through persistence, partial reads and
15+
output rechunking. True block-scalar results expose the logical block-grid shape.
16+
- Add portable CTable computed/generated transformers with an explicit
17+
`row_domain="independent"` contract, including fixed-shape row reductions.
18+
- New compliant DSLKernel-backed LazyUDF saves export the draft automatically;
19+
unsupported saves fail validation before writing the destination.
20+
- Historical Python-specific recipes require explicit `deserialize="full"`.
21+
MessagePack decoding is safe by default, including nested containers.
22+
23+
Menudet 1.0 is a **draft**, not a frozen compatibility promise. The existing
24+
`DSLKernel` and portable API names remain unchanged. This draft uses the typed
25+
interpreter; optional JIT requests fall back before execution, while required JIT
26+
rejects unsupported acceleration. Complex computation, callbacks, arbitrary
27+
memory access and non-strict floating-point modes are outside the portable contract.
28+
29+
See the [Menudet reference](https://www.blosc.org/python-blosc2/reference/portable_dsl.html)
30+
for array/table examples, persistence policy and current limitations. Release
31+
certification is tracked separately; this development entry is not an announcement
32+
that 4.15.0 has been published.
33+
334
## Changes from 4.14.1 to 4.14.2
435

536
XXX version-specific blurb XXX

‎doc/conf.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@ def genbody(f, func_list, lib="blosc2"):
111111
],
112112
}
113113

114-
exclude_patterns = ["_build", ".DS_Store", "**.ipynb_checkpoints", "tutorials/images/**"]
114+
exclude_patterns = [
115+
"_build",
116+
".DS_Store",
117+
"**.ipynb_checkpoints",
118+
"tutorials/images/**",
119+
"html/**",
120+
"**/autofiles-stash/**",
121+
]
115122

116123
html_show_sourcelink = False
117124

@@ -306,7 +313,7 @@ def process_sig(app, what, name, obj, options, signature, return_annotation):
306313
# ``-W`` (as CI does) to turn that warning into a failure.
307314

308315
_AUTODOC_DIRECTIVE = re.compile(
309-
r"^\s*\.\.\s+(?:autoclass|autofunction|autodata|autoexception|autodecorator)::"
316+
r"^\s*\.\.\s+(?:autoclass|autofunction|autodata|autoexception|autodecorator|py:class)::"
310317
r"\s*([\w.]+)"
311318
)
312319
_CURRENTMODULE = re.compile(r"^\s*\.\.\s+(?:currentmodule|module)::\s*([\w.]+)")

‎doc/getting_started/installation.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ grouped into *extras* that you opt into with the ``blosc2[extra]`` syntax:
3333
- The :doc:`b2view <../guides/b2view>` terminal browser (``textual``,
3434
``textual-plotext``), including its in-terminal braille plot (the
3535
``p`` key). Required by the ``b2view`` command.
36-
* - ``hires``
36+
* - ``hires``
3737
- The high-resolution image view in b2view (the ``h`` key), which
3838
renders a real ``matplotlib`` image in the terminal
39-
(``textual-image``, ``matplotlib``). Includes ``tui``.
40-
* - ``images``
41-
- JPEG/PNG ordinary-file previews in b2view (``Pillow``, ``textual-image``).
42-
Includes ``tui`` without requiring matplotlib. ``hires`` includes this extra.
39+
(``textual-image``, ``matplotlib``). Includes ``tui``.
40+
* - ``images``
41+
- JPEG/PNG ordinary-file previews in b2view (``Pillow``, ``textual-image``).
42+
Includes ``tui`` without requiring matplotlib. ``hires`` includes this extra.
4343
* - ``parquet``
4444
- The ``parquet-to-blosc2`` converter (``pyarrow``); see
4545
:doc:`../guides/parquet_to_blosc2`.

‎doc/reference/dsl_syntax.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
This is the practical reference for the DSL used by `@blosc2.dsl_kernel`
44
functions (and checked by `blosc2.validate_dsl()`).
55
It focuses on what works today and the most common gotchas.
6+
The portable subset is named **Menudet**, a little language for portable
7+
computation on arrays and tables. See the [Menudet reference](portable_dsl.rst)
8+
for the 1.0 draft contract. This page also documents ordinary full-DSL features;
9+
acceptance here does not imply portability.
610
For usage walkthroughs and end-to-end examples, see the
711
[LazyArray UDF DSL kernels tutorial](../tutorials/03.lazyarray-udf-kernels.ipynb).
812

‎doc/reference/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ API Reference
1313
utilities
1414
dsl_syntax
1515
portable_dsl
16+
menudet_accuracy
1617
jit

‎doc/reference/menudet_accuracy.md‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Menudet draft: numeric certification
2+
3+
Menudet requires checked integer results and the stated floating-point type,
4+
domain, NaN, infinity, signed-zero and rounding rules. It does **not** promise
5+
bit-identical transcendental results across host math libraries or a universal
6+
ULP error bound. Native exact-anchor and exceptional-value tests remain separate
7+
from the bounded independent math check described here.
8+
9+
## Reproducible independent references
10+
11+
`scripts/menudet_math_vectors.json` contains 284 samples for 40 canonical
12+
operations, covering both float32 and float64. Inputs and expected results are
13+
stored as exact hexadecimal encodings. References were generated with mpmath
14+
1.3.0 at both 100 and 200 decimal digits; regeneration rejects disagreement
15+
between the two rounded results. The checker does not need mpmath and does not
16+
use NumPy or the executing host's libm as its mathematical reference.
17+
18+
The finite domains include inverse-function endpoints, small arguments that
19+
exercise cancellation, mixed quadrants, gamma functions, and explicit fused
20+
multiply-add cancellation. Domain errors, NaNs/infinities, subnormal behavior,
21+
signed zeros, rounding functions, nextafter and aliases additionally have native
22+
conformance fixtures; they are not certified merely by these finite samples.
23+
24+
| Operations | Maximum error for the checked samples |
25+
| --- | --- |
26+
| cospi, sinpi, exp10, lgamma, tgamma, logaddexp | 8 ULP |
27+
| Other sampled transcendental functions, sqrt, hypot, floating pow | 4 ULP |
28+
| fdim, fmin, fmax, copysign, fmod, remainder, ldexp, fma | Exact rounded value |
29+
30+
These are **function-specific acceptance budgets for this finite corpus**, not
31+
new normative bounds over all possible inputs. ULP is measured using the smaller
32+
adjacent gap at the expected value, including at powers of two. Adding a new
33+
sample or changing a budget requires review; a failed platform must not silently
34+
skip a function or inflate its tolerance.
35+
36+
## Running certification
37+
38+
Against an installed package:
39+
40+
```console
41+
python scripts/certify_menudet_math.py --report menudet-math.json
42+
```
43+
44+
Reports identify the package path/version, platform, reference generator, sample
45+
count, per-function/per-precision maxima and individual failures. The process
46+
exits nonzero on failure. Use `--generate` only to regenerate the checked-in
47+
reference corpus in a development environment with mpmath installed.
48+
49+
Native Python CI uploads the reports. The same corpus runs in Pyodide and in the
50+
installed-wheel test command, without adding a runtime reference-library
51+
dependency. Passing a local wheel certifies only that tested wheel and host;
52+
release readiness additionally requires the supported platform matrix to pass.

0 commit comments

Comments
 (0)