Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
# Scope diagnostics to this object's and the core's own headers: a path
# filter over source/projects would also match the bundled CPython
# headers, which are reached via …/tap.python_tilde/../../../support/… .
hf='.*/(tap\.python_tilde/tap\.python_tilde|core/(include|tests|bench)/).*'
hf='.*/(tap\.python_tilde/tap\.python|core/(include|tests|bench)/).*'
fail=0
check() { # <file> <clang-tidy args…>
# a finding, a compile error, or clang-tidy itself failing (non-zero exit with or
Expand Down
14 changes: 9 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ built yet.
interval). `scripts/update-perf-docs.py` builds it (Release), runs it, and
rewrites the ReadMe's generated performance tables — with `--max`, Max's CPU meter too, through
`runtime-tests/run.py --session perf`. Never hand-edit those tables; measure on an idle machine.
- **`source/projects/tap.python_tilde/`** — the Min external: package paths, the file watcher, atom
conversion, and mapping the core's descriptions onto `object_addattr`/`object_addmethod`. Its
`_test.cpp` drives the Max glue through min-api's mock kernel.
- **`source/projects/tap.python_tilde/`** — the Min external (`tap.python_tilde.h`) over the shared
glue (plan 9.2), which `tap.python` (9.3) will use too: `tap.python_glue.h` — starting the runtime,
atom conversion, the reserved names (`reserved_messages(audio)`) and the guard, and mapping the
core's descriptions onto `object_addattr`/`object_addmethod`, with the C trampolines instantiated
per host type (`python_glue<Host>`, through `Host::self()`) — plus the package paths
(`tap.python_package.h`) and the file watcher (`tap.python_filewatch.h`). Its `_test.cpp` drives
the Max glue through min-api's mock kernel.
- **`python/`** — the user's script folder in the package (and the examples: `default.py`,
`numpy_gain.py`, `allpass.py`, `numpy_allpass.py` — the same filter per vector, checked equal
sample for sample by the core battery — `stereo_width.py`, two inputs and two outputs, and
Expand Down Expand Up @@ -136,14 +140,14 @@ attaches all the zips + SHA256s to a release — a pre-release for 0.x, a draft
- Max calls some methods directly with C arguments (`A_CANT`): the file watcher's `filechanged`
is one. min registers a `message<>` whose name it does not special-case with its `A_GIMME` wrapper,
which such a call crashes — so
the watcher is owned by a nobox helper with the SDK's signature (`tap.python_tilde_filewatch.h`).
the watcher is owned by a nobox helper with the SDK's signature (`tap.python_filewatch.h`).
Check the SDK's calling convention before exposing a Max-called method as a `message<>`.
And read the SDK's return contract before testing a Max call's result: `object_getmethod()`
answers `method_false()`, a function, not null, for a name an object does not have — a null
test reserved every Python name in 1.0.0. **Never compare a function pointer Max returns with
the address of a function this module imports:** across a DLL boundary the module's
`&method_false` is its own import thunk (the SDK declares it without `dllimport`), so 1.0.1's
comparison reserved every name again, on Windows only. The object asks Max what it answers for a
comparison reserved every name again, on Windows only. The glue asks Max what it answers for a
name no class can have (`not_found_method()`) and compares with that (`found_method()`, 1.0.2).
And what the object itself registers can answer its name too — its *attributes* do, and the guard
must leave them out, or a reload reserves every field (1.0.1, found in Max); its messages, added
Expand Down
2 changes: 1 addition & 1 deletion docs/PRODUCTION-PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ row shipped what only a host platform could show.
the release is 2.0.0, decided 2026-10-09); announce-once per
(file, kind); the `Loaded` line per binding. `test_output.cpp`, the output table over its edges, the
new examples on known inputs, and a bench row for a message call. `tap.python~` unchanged and green.
- [ ] **9.2 The shared glue:** the attribute, message, trampoline, file-watcher and package headers
- [x] **9.2 The shared glue** (#47)**:** the attribute, message, trampoline, file-watcher and package headers
as `python_glue<Host>`; `reserved_messages()` parameterized by the audio names. A pure move.
- [ ] **9.3 The object:** `tap.python.h` in the project, a plain SDK class registered by the
project's `ext_main` — ports with the dumpout and the object's lock, the output mapping, the
Expand Down
12 changes: 10 additions & 2 deletions docs/TAP-PYTHON-PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,18 @@ third was Windows-only.
running, a message with 64 numbers in and out measured 5.6 µs for the bridge alone and 15 µs for
`scale.py`, and `main` and the branch measured alike back to back.)* No Max code changes; `tap.python~`'s battery and glue test unchanged and green; the
audio bench numbers unchanged (the audio path does not touch the new code).
- [ ] **9.2 The shared glue.** `tap.python_tilde_{attribute,message,cglue,filewatch,package}.h`
- [x] **9.2 The shared glue** (#47). `tap.python_tilde_{attribute,message,cglue,filewatch,package}.h`
become `python_glue<Host>` (the trampolines instantiated per host through `Host::self()`), in
`source/shared/tap/python_max/` or beside the object; `reserved_messages()` parameterized by the
audio names. A pure move: `tap.python~`'s behavior, tests and the data-import check unchanged.
*(Done beside the object, as one binary builds both: `tap.python_glue.h` holds `python_attr`,
`python_message` and `python_members` (the attributes and messages made for a class, their
reconciliation, attribute access and the guard) on the host, the trampolines, `start_runtime()`,
`watch_source()` and `to_values()`; the file watcher and package paths are
`tap.python_{filewatch,package}.h`. The same 53 reserved names in the same order; the glue test
pins what an audio object reserves beyond every object's; every runtime test passes in Max 9.1.5.
For 9.3: `reserved_messages(false)` still has 8.2's `anything`, which `tap.python`, exposing a
class's `anything`, takes out — and adds `dumpout`.)*
- [ ] **9.3 The object.** `tap.python.h` and its TU in the project, registered by the project's
`ext_main` (replacing the 9.0 spike's TU and its CMake option); ports with the dumpout, its
`dumpout` method and the lock; output mapping (a `str` as `symbol <s>`); the `anything` forwarder
Expand Down Expand Up @@ -579,7 +587,7 @@ own log (`Logs/Max.log`) has every console line with its thread, but not a `[pri
And methods added with `object_addmethod()` are not found by `object_getmethod()` (4 above) —
CLAUDE.md said an object's own messages answer their names, as its attributes do; only the
attributes do, which the guard was right to leave out either way (CLAUDE.md now says so; the
comment on `answered_by_max()` says the same, for 9.2's move to correct).
comment on `answered_by_max()` said the same, and 9.2's move corrected it).

**On Windows, learned on the way** (for 9.5 and 9.6, which run Windows by hand). A patcher opened
together with Max (`Max.exe "<patcher>"`, as Explorer opens one) had its scheduler held for
Expand Down
2 changes: 1 addition & 1 deletion scripts/assemble-package.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@


# Each platform's folder for its runtime in a package for every platform (plan 4.8); the external
# names its own (runtime_platform() in tap.python_tilde_package.h).
# names its own (runtime_platform() in tap.python_package.h).
RUNTIME_PLATFORMS = ["macos-arm64", "macos-x86_64", "windows-x64"]

# What differs between single-platform packages, and is merged rather than copied once.
Expand Down
7 changes: 3 additions & 4 deletions source/projects/tap.python_tilde/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ include_directories(

set(SOURCE_FILES
${PROJECT_NAME}.h
${PROJECT_NAME}_package.h
${PROJECT_NAME}_cglue.h
${PROJECT_NAME}_attribute.h
${PROJECT_NAME}_message.h
tap.python_glue.h
tap.python_filewatch.h
tap.python_package.h
${PROJECT_NAME}.cpp
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// @file tap.python_tilde_filewatch.h
/// @file tap.python_filewatch.h
/// @brief Watches the class file, and delivers a save to the object as its filechanged message.
// SPDX-License-Identifier: MIT
// Copyright 2022-2026 Timothy Place.
Expand All @@ -22,7 +22,7 @@ namespace tap::python {

struct file_watch_object {
c74::max::t_object header;
c74::max::t_object* target; // the tap.python~ object told of each save
c74::max::t_object* target; // the object told of each save
};

/// Called by Max's file watcher, on the main thread.
Expand Down
Loading
Loading