Skip to content

paper: match 0.5.1 - #15

Open
trissim wants to merge 1 commit into
mainfrom
paper/match-0.5.1
Open

trissim wants to merge 1 commit into
mainfrom
paper/match-0.5.1

Conversation

@trissim

@trissim trissim commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Brings paper.md in line with the code at v0.5.1 (6f69ea4, which is also main). No library code changes. Paths below are under src/arraybridge/.

Nothing was executed: the machine was loaded and no environment was created. Every name and call signature in the code examples was checked by reading the source (ArrayLibrary.named libraries.py:292, convert_to :624, ConversionRoute.planned conversion.py:124, ConversionCounters :470 with installed :426 and format_table :545, AcceleratorDevice devices.py:28, decorator lookup __init__.py:54 and decorators.py:486). The examples were not run.

Claim ledger

# Old claim Status What it became Source
1 Converts between NumPy, CuPy, PyTorch, TensorFlow, JAX, pyclesperanto true kept, libraries now cited libraries.py:1243, 1287, 1365, 1528, 1697, 1830
2 Users declare a function's memory type with a decorator (@cupy) true kept; example now imports the decorator and returns one array decorators.py:419-493
3 "The decorator handles DLPack zero-copy transfers ... falls back to NumPy bridging" false The decorator records the declared libraries, adds streams, OOM retry and dtype restoration. It never converts arguments. Conversion is convert_to / convert_memory; the paper now says so decorators.py:452-472; converters.py:21-45
4 Decorator "manages per-thread CUDA streams" true for CuPy and PyTorch only stated for those two, and only for calls whose arguments are on an accelerator libraries.py:925-955, 958-1008
5 Decorator "detects and recovers from GPU out-of-memory errors" partly "retries after the library's caches are freed"; see 12 libraries.py:535-555
6 "preserves dtypes through conversions" false as worded dtype restoration applies to a decorated function's output, not to conversions decorators.py:313-386
7 Per-framework device, OOM exception, cache and stream APIs (bullets) true where the source uses them; "TensorFlow has no explicit cache API" unverifiable kept; the TensorFlow clause removed libraries.py:1297-1300, 1319, 1345, 1376, 1538
8 "single declarative configuration, generating 36 conversion methods (6 x 6) from ~450 lines of configuration" false One class per library; lookup, decorators, MemoryType and conversion between every pair are derived from the classes. No count is given libraries.py:245-306; types.py:110-124; conversion.py:59-177
9 Table: "Unified API (36 paths)" false "One call for every library pair" libraries.py:624
10 Table: "Automatic fallback" true only for DLPack to host copy folded into "Record of the mechanism used"; the fallback is described in Design conversion.py:153-159, 269-289
11 "The architecture uses data-driven metaprogramming" false "an abstract family ... a subclass per library with role parents" libraries.py:789-1236
12 CupyLibrary listing true (abridged) kept, one method dropped for length libraries.py:1287-1362
13 "Each library implements to_numpy(), from_numpy(), from_dlpack(), and convert_to()" false for from_dlpack (only DLPackImport libraries: NumPy and pyclesperanto have none) replaced by the role-parent paragraph libraries.py:1021-1032, 1243, 1830
14 "Adding a seventh framework requires only adding its ArrayLibrary subclass" true kept ADDING_NEW_FRAMEWORKS.md:3-7; types.py:47-124
15 Thread-local streams via threading.local() true kept, scoped to CuPy and PyTorch and to accelerator arguments libraries.py:961, 979-998
16 "model(image) runs on thread-local stream" (the @torch example) false in general A host tensor call runs as written; the example was removed libraries.py:936-941
17 "true parallel GPU execution is possible" unverifiable (no measurement in the repo) removed
18 OOM recovery enabled by default; checks exception types and message patterns true kept decorators.py:430; libraries.py:502-518
19 "clears framework-specific caches" true for CuPy and PyTorch only says so; the other four declare no cache to free and only gc.collect() runs libraries.py:520-523, 1010-1018
20 run_with_oom_recovery listing true (abridged) removed for length; behaviour is stated in prose libraries.py:535-555
21 "the pipeline automatically falls back to CPU processing" (twice, plus Research Impact) false "The retry runs on the same device. After two failed retries the error is raised; there is no fallback to the CPU" libraries.py:543-555
22 "scales and clamps back to uint16"; example of 0.0-65535.0 floats returned as uint16 misleading The float result's minimum and maximum are mapped onto the full range of the integer dtype, so intensities are stretched to 0 to 65535, not rounded in place libraries.py:80-86, 195-218, 1217-1231
23 Each library's scale_dtype does the scaling true kept libraries.py:660-666
24 OpenHCS uses CuPy for stitching, flatfield, edge detection; PyTorch via the torch decorator true in OpenHCS today (ashlar_main_gpu.py:859, basic_processor_cupy.py:285, cupy_processor.py:792, n2v2_processor_torch.py:311) kept; "segmentation" became "denoising", which is the use I could find OpenHCS repository
25 "thousands of images ... without coordination overhead" unverifiable removed
26 AI disclosure: "data-driven configuration" false "one class per library"

New statements, with their source: the five routes and their order (conversion.py:180, 214, 244, 306, 341; CHANGELOG 0.5.1 "Conversion"); one predicate plans and performs (candidates :108-121 is used by both planned :137 and run :153); records name the mechanism used and the declined ones (:160-175, :358-372); ConversionCounters (:470); devices as values (devices.py); a host call does not initialise CUDA (libraries.py:936-941, CHANGELOG 0.5.1).

False or misleading: 9 (rows 3, 6, 8, 9, 11, 13, 16, 21, 22) plus the same wording in the AI disclosure (26). Removed as unverifiable: 3 (rows 7 clause, 17, 25).

For the owner

  • The title still says "OOM Recovery". The code retries on the same device after freeing caches, twice, then re-raises. I left the title alone; "OOM Retry" would be the exact word.
  • Dtype restoration stretches contrast. A float result with values 100.0 to 200.0 returned to uint16 becomes 0 to 65535 (libraries.py:201-208). The old paper's example implied values are kept. The paper now states what the code does; whether the code should do that is a separate question.
  • OOM retry frees nothing for TensorFlow, JAX and pyclesperanto beyond gc.collect() (only CudaLibrary overrides cleanup_loaded).
  • OpenHCS pins arraybridge>=0.4.1,<0.5 (pyproject.toml:110 on the branch I read), so the Research Impact section describes OpenHCS on 0.4.x while the paper describes 0.5.1.
  • paper.bib: the metaclassregistry URL pointed at github.com/trissim/metaclass-registry; changed to github.com/OpenHCSDev/metaclass-registry (confirmed to exist). The six library entries already in the bib are now cited at first mention. No reference was added.
  • Length: 1230 words by wc -w (front matter and code included) against 1019 before. The two new mechanisms (routes, records) account for the difference.
  • The comparison table's "—" cells are the original table's "no" marks and were kept.

🤖 Generated with Claude Code

Rewrite the statements the 0.5.x refactors made false: conversion is an
ordered family of routes whose one predicate plans and performs, not 36
generated methods; out-of-memory handling retries on the same device and
re-raises, with no CPU fallback; the decorators do not convert arguments;
dtype restoration rescales to the full integer range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants