Commit Graph
2792 Commits
Author SHA1 Message Date
kiwi4boy 20050077ad craft-xlsx: the README describes formulas in binary workbooks
They were "token streams that are not decoded". The README now says what the decoder gives
(text in the file's spelling, shared and array kinds and ranges, cell metadata, each shared copy's
own text), what keeps its saved result and why, that the function table and printer are this
crate's own, and the binary_formula_text limit with the decoder's fixed bounds.
2026-11-12 23:36:47 -05:00
kiwi4boy 1f5f1f0f51 craft-xlsx: a shared formula stops decoding copies once one is kept as its value
From gridcraft#3821's review (CodeRabbit, still open there): a shared formula's copies are
checked against the formula text allowance with the first cell's length, which a copy can
exceed. A copy that was decoded and printed, then kept as its value because it didn't fit, or
because it couldn't be decoded, charged nothing, so a file with many cells of one long shared
formula could repeat that work for each of them. The PR's case was GridCraft's 8,192-character
rejection, which isn't here; the allowance and decode failures are the same path.

After one such copy the group keeps every later copy as its value without decoding it, so a
group costs at most one wasted decode. A new test shows a later copy that would have fit kept
as its value; it fails without this commit.
2026-11-12 23:36:18 -05:00
kiwi4boy 734ade8cd9 craft-xlsx: read shared, array and dynamic-array formulas from .xlsb files (port of gridcraft#3821)
A cell whose tokens are only PtgExp (row) + PtgExtraCol (column) belongs to the shared or array
formula starting there; its first cell is followed by BrtShrFmla or BrtArrFmla.

- Shared formulas: each cell's copy is decoded from the shared tokens at its own cell, as
  [MS-XLSB] defines it (PtgRefN/PtgAreaN offsets, wrapping around the grid). Every cell of the
  group gets FormulaKind::Shared, its own text and the group's index (`si`, counted per sheet);
  the first also gets the group's range. Its first cell is the first that uses it, anywhere in
  its range. Copies are charged to the formula text allowance before they are decoded, so a long
  formula shared by a million cells stops costing once the allowance is spent.
- Ctrl+Shift+Enter and dynamic arrays: the first cell gets FormulaKind::Array with its range; a
  dynamic one also has its cell metadata (BrtCellMeta, which now also holds across a BrtValueMeta
  written in between), as `cm` marks it in .xlsx. The other cells of an array keep their cached
  values and have no formula, as in .xlsx.
- A record that can't be read leaves its range as values and never fails the file, with a
  warning; so does a first cell with no formula record after it.

Ported from storytold/gridcraft#3821 (issue gridcraft#3806), with its review fixes (each copy
decoded at its own cell; a shared formula may start inside its range). Changed from the
GridCraft PR:
- In .xlsx a shared formula's other cells have empty text. Here they have their own decoded text
  (and CellFormula's doc says so), because that is exact where shifting the first cell's text is
  not, as the PR's review found.
- Clearing an array's other cells for recalculation, marking dynamic arrays to spill, and the
  check against GridCraft's parser's 8,192-character limit are GridCraft's reading, not the
  file's: the cells keep what the file holds. That test becomes one that a copy may be longer
  than its first cell.
The PR's tests come along in tests/xlsb.rs, with craft-xlsx's model in the expectations.

Checked against Excel: in a workbook Excel saved both as .xlsb and as .xlsx, every formula this
reads (33, shared, array and dynamic ones included) has the .xlsx text, kind and range; the other
5 use tables, an external link or defined names.
2026-11-12 23:34:15 -05:00
kiwi4boy 787b3e44f4 craft-xlsx: read cell formulas from .xlsb files (port of gridcraft#3818)
A BIFF12 decoder for cell formulas (xlsb/formula.rs), separate from craft-xls's BIFF8 one because
nearly every operand differs (32-bit rows, 14-bit columns, UTF-16 strings, its own array-constant
codes, newer functions called through hidden names). It reads references, 3-D references,
constants, array constants, functions by number (xlsb/ftab.rs) and newer functions through
Excel's hidden _xlfn. names. A formula cell's CellFormula holds the text as an .xlsx file holds it
(`_xlfn.CONCAT`, `_xlpm.x`, no implicit `@`), and a BrtCellMeta before a cell gives it
cell_metadata, as `cm` does. Reverse-Polish tokens group by order alone, so the decoded tree
gets the parentheses its text needs from operator precedence; Excel's own text is unchanged. A
chain of string constants joined with & prints as one flat chain.

What a formula refers to must be readable too, so shared, array and data-table forms, user
defined names (XLSB names aren't read yet), table references, external links and PY(index, ...)
(code stored elsewhere in the package) keep only their saved results, with a warning saying why.
So does a formula past Limits::binary_formula_text (128 MiB of text over the workbook). The
workbook's links and names are optional: if they can't be read, the file opens with values only,
as before, and a warning says so.

Ported from storytold/gridcraft#3818 (issue gridcraft#3806), with its two review fixes
(grouping by precedence, the flat & chain). Changed from the GridCraft PR:
- The tree and its A1 printer (xlsb/expr.rs) are a copy of craft-xls's expr.rs, with
  BinOp::precedence added; the decoder's stack and depth guards are copies of craft-xls's. The
  PR used GridCraft's formula crate and shared these with GridCraft's .xls decoder.
- No fmla::from_file, implicit `@`, parse check or Python-cell adoption: those are GridCraft's
  reading of the text, not the file's. A single-cell dynamic-array formula is read (with its
  cell metadata) instead of being kept as its value; the PR left dynamic arrays to the next PR.
- The links are read with the workbook part and kept by Package for its sheets.
Its tests come along in tests/xlsb.rs, with the expected text in the file's spelling.

Checked against Excel: of the formulas in a workbook Excel saved both as .xlsb and as .xlsx,
every one this reads (26) has the text of the .xlsx; the other 12 are the kinds above.
2026-11-12 23:29:29 -05:00
Dylan M. Taylor 7c10820123 Preserve ZIP directory semantics in bundle reader 2026-11-13 04:26:31 +00:00
kiwi4boy 1bdaa7aff3 craft-xlsx: the XLSB function table, with the numbers 0x17C-0x1E4 (port of gridcraft#3810)
[MS-XLSB]'s Ftab (2.5.98.10) continues the [MS-XLS] table from 0x17C: the cube functions, the old
Analysis ToolPak functions, IFERROR, COUNTIFS, SUMIFS and AVERAGEIF(S). Excel writes these by
number in .xlsb (PtgFunc / PtgFuncVar) where .xls calls them by name, so an XLSB formula decoder
needs them. Generated from the spec with the same argument-count rule as the existing entries.

Ported from storytold/gridcraft#3810 (issue gridcraft#3806). There the entries were appended to
GridCraft's .xls table, which is now craft-xls's. Here the table is craft-xlsx's own
(xlsb/ftab.rs): craft-xls's 0-379, which match GridCraft's table before the PR, then the PR's
entries. The two formats follow separate specifications and develop separately; they can share a
table later if both readers settle on one. The PR's table checks come along. Its decoding checks
(IFERROR, SUMIFS by number) go with the decoder in the next commit, and its check that every new
name is a GridCraft function stays in GridCraft.
2026-11-12 23:23:02 -05:00
Dylan M. Taylor a2e0f58632 Bound shared SoundCraft session IO 2026-11-13 04:20:55 +00:00
Dylan M. Taylor 88aa0bed6a Add shared SoundCraft session format 2026-11-13 04:07:08 +00:00
Dylan M. Taylor 4c25109473 test(openpgp): align signature time with generated key 2026-11-13 03:47:36 +00:00
Dylan M. Taylor f29cb7076f Merge remote-tracking branch 'origin/main' into codex/craft-time-soundcraft
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	README.md
2026-11-13 03:46:49 +00:00
Dylan M. Taylor ae0f0488dc craft-time: preserve SoundCraft time API and serialization 2026-11-13 03:44:51 +00:00
Dylan M. Taylor 7316e4e223 fix: clear workspace baseline gates on Rust 1.100 2026-11-13 03:13:53 +00:00
Dylan M. Taylor 94e65a4606 ci: run workspace checks with shared gate and test inputs 2026-11-13 03:06:38 +00:00
Nicolas Bohn 5056c13ef7 fix(dxf): split binary hex payloads into chunks of at most 127 bytes (#1147) (#1148) 2026-11-12 21:49:37 -05:00
Dylan M. Taylor 1b53814a38 Apply verified workspace format fixes 2026-11-13 02:37:09 +00:00
Dylan M. Taylor 7a639e04a7 Fix workspace clippy loop in LaTeX tests 2026-11-13 02:35:01 +00:00
Dylan M. Taylor d31b04810b Fix current workspace clippy diagnostics 2026-11-13 02:28:06 +00:00
Dylan M. Taylor c7fb7544c2 craft-stencilcraft-format: add native JSON schema 2026-11-13 02:23:04 +00:00
Dylan M. Taylor 6ef2334920 plotter: expect registration offset command 2026-11-13 02:05:17 +00:00
Dylan M. Taylor d316f0fc2d fix(xml): walk deep KRA and ORA trees iteratively 2026-11-13 02:05:09 +00:00
Dylan M. Taylor 2253894e2f fix: satisfy Rust 1.100 workspace clippy 2026-11-13 01:39:26 +00:00
Dylan M. Taylor 92d1bba5de fix(proof): satisfy workspace clippy gate 2026-11-13 01:28:46 +00:00
Dylan M. Taylor 198697cfc8 fix(cms): keep clippy compatible with workspace gate 2026-11-13 01:18:59 +00:00
Dylan M. Taylor 4cca9be2ab video: configure bounded decoder frame limits 2026-11-13 01:10:32 +00:00
Dylan M. Taylor 6fa8323991 video: saturate extreme H.264 picture order values 2026-11-13 00:44:21 +00:00
Dylan M. Taylor 409b0036f8 video: bound H.264 picture number arithmetic 2026-11-13 00:37:31 +00:00
Dylan M. Taylor 61d9de7846 psd: bound resource iterator size hint 2026-11-13 00:21:00 +00:00
Dylan M. Taylor dc20b58f01 Bound document bundle asset reads 2026-11-12 19:19:53 -05:00
Dylan M. Taylor ef01d69f7d Shared document bundle package IO 2026-11-12 19:11:55 -05:00
Dylan M. Taylor cc9c380543 Fix PSD resource iterator size hint 2026-11-13 00:05:37 +00:00
Dylan M. Taylor 341c84d1b1 Add borrowed PSD head resource views 2026-11-13 00:03:19 +00:00
vangel76andClaude Sonnet 5.5 756def2bc6 mxf: checked end offset for the TIFF u16 read in DNG sniffing
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 23:18:51 +01:00
midasmatterhorn 72b6005033 Revert "cms: index the primaries with an iterator in the 16-way sum"
This reverts commit 714b1f8b3f.
2026-11-13 00:23:49 +03:00
vangel76 14913a18c2 Merge remote-tracking branch 'upstream/main' into HEAD
# Conflicts:
#	crates/video/src/av1/decode/decoder.rs
2026-11-12 22:18:38 +01:00
vangel76andClaude Sonnet 5.5 9541787aa9 hevc: simplify scaling-list condition for clippy nonminimal_bool
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 22:17:58 +01:00
midasmatterhorn 714b1f8b3f cms: index the primaries with an iterator in the 16-way sum
clippy's needless_range_loop (stable) flags the loop variable indexing
self.prim_n; the offset is still the bit mask.
2026-11-13 00:16:46 +03:00
vangel76andClaude Sonnet 5.5 81bf3feb39 mxf: CinemaDNG in MXF (frame-wrapped DNG pictures), read and write
The demuxer identifies CinemaDNG from the CinemaDNG container labels, the
registered MXF-GC TIFF/EP container and picture coding labels, a 42h picture
element type, or a TIFF header with the DNGVersion tag at the start of the
essence. The writer produces OP1a files with frame-wrapped DNG pictures, the
provisional container label, element type 42h and an RGBA descriptor (no coding
label); OP-Atom is refused because it is clip-wrapped here.

Same change as the crates/mxf part of storytold/Filmcraft#1078, ported onto
craft-media.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 22:09:46 +01:00
vangel76andClaude Sonnet 5.5 45ddc4ffa6 mpegts: a repeated PAT or PMT packet is not appended to the section in progress
The scan fed every PAT and PMT packet to the section parser, so a packet sent
twice (same continuity counter and payload, H.222.0 2.4.3.3) appended its
payload to the section being collected. PAT and PMT packets now go through a
per-PID repeat guard first, like the elementary stream packets; a packet that
signals a discontinuity is never taken for a repeat.

The rest of storytold/Filmcraft#1438 is already in craft-media (#993).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 22:05:44 +01:00
vangel76andClaude Sonnet 5.5 c25999c8a4 hevc decode: dequantise while decoding residuals, table-driven sig_coeff contexts
Each coefficient is scaled (8.6.3) as it is decoded and stored in a list of
(index, value) instead of a separate pass over the bounding box. Only the
coefficient bounding box is cleared before the list is scattered into it. DC-only
blocks add the inverse-DC constant straight to the prediction. sig_coeff_flag
ctxInc comes from a per-sub-block table, last_sb / last_pos from inverse scan
tables. Merge candidates use the fixed five-entry list instead of a Vec.

Same change as storytold/Filmcraft#3188 (residual part), ported onto craft-video.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 21:51:12 +01:00
Dylan M. TaylorandDylan Taylor f92a91afa4 plotter: add TB54 registration-mark offset command (#1139)
* plotter: add TB54 registration-mark offset command with py_silhouette citation

The full Silhouette registration sequence (TB99 through TB55, plus
TB123/TB124 for search and TB23 for manual positioning) is documented
in the community driver py_silhouette (zero_on_registration_mark()),
which reverse-engineered the protocol from public behaviour — not from
any proprietary binary.

TB54,0,0 sets the registration-mark offset to zero (mark at expected
position). Without it the machine may use a non-zero default offset.

* workspace: allow unused_workspace_dependencies lint

The root Cargo.toml declares many workspace dependencies that are not
referenced by any crate's Cargo.toml (e.g. craft-aep, craft-ai-core,
craft-cms, etc.). This is intentional — they are available for apps to
use. Suppress the clippy warning so CI passes.

* workspace: allow unused_workspace_dependencies (cargo lint)

This is a cargo-level lint (not clippy) that fires when workspace
dependencies declared in [workspace.dependencies] are not referenced
by any crate's Cargo.toml. Many entries are intentionally available
for apps to use.

* cms, prepress, proof: allow unused_workspace_dependencies lint

These crates are built individually by CI (cargo clippy -p <crate>)
which does not inherit workspace lints. Add per-crate suppression.

* cms, prepress, proof: inherit workspace lints

Add [lints] workspace = true so these crates pick up the
unused_workspace_dependencies suppression from the root Cargo.toml.

* revert: remove duplicate [lints] sections

The cms, prepress, and proof crates already had [lints] workspace = true.
My previous commits accidentally added duplicate sections.

* cargo: suppress unused_workspace_dependencies lint via config

This is a cargo-level lint (not clippy) that fires when workspace
dependencies declared in [workspace.dependencies] are not referenced
by any crate's Cargo.toml. Many entries are intentionally available
for apps to use.

---------

Co-authored-by: Dylan Taylor <dylanmtaylor@gmail.com>
2026-11-12 15:44:47 -05:00
midasmatterhorn 88271c006c print: cover the 1% scale tolerance boundary in shrink-to-fit
The bound had only the zero-scale side tested. Add the other edge: a scale
whose four-decimal serialization is more than 1% off. A 118 750 pt wide
sheet on Letter with an 18 pt margin scales by 576 / 118 750 = 0.00485053,
written 0.0049 -- 1.02% off -- and the plan refuses as an error before
anything is sent. Just inside the bound (118 700 pt: 0.98% off) still
prints, its matrix carrying the written 0.0049.
2026-11-12 23:43:32 +03:00
vangel76andClaude Sonnet 5.5 62e09222f1 craft-video: AV1 decoding about 1.7x as fast with many threads
Port of storytold/Filmcraft#4542 (the code moved here). Frames start as soon
as the reference rows they read are done (row wavefront across frames),
parsing is split from reconstruction, and there is one frame worker per
thread. Output is bit-identical; single-thread speed is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 21:16:46 +01:00
.CooCoo d23f5f36bb craft-drawingml: outline digests print a near-zero coordinate without its sign (#1127)
outlines_match_the_string_dispatch failed on macOS for curvedRightArrow
while Linux and Windows passed. The digest prints each coordinate with
{:.3}, which writes a residue such as -1.4e-14 from the sine or cosine of
a right angle as "-0.000". The sign of that residue depends on the
platform's libm, so the digest did too.

digest_coord now maps every coordinate that prints as zero to 0.0 before
it is printed. The digests of pieWedge, curvedRightArrow and
curvedDownArrow, the only names whose outlines held such residues, are
taken again; no outline changes.
2026-11-12 13:45:57 -06:00
dotCooCoo 32ffa0b58a Merge main into fix/linesweeper-sweep-doc-left-scan 2026-11-12 09:02:06 -08:00
Dylan M. Taylor e98299546f crs: a repeated name keeps its first value, as craft-metadata reads it
craft-metadata #1042 keeps the first text-bearing value of a repeated
property so a blank repeat cannot hide a location, but craft-crs's doc
comment and test still claimed the last repeat wins. The workspace-wide
test job has been red since it landed because of that assertion.
2026-11-12 11:26:10 -05:00
Jeremy e85bd30bb2 Document the proposed Windows installation and persistent-model policy
* docs: add the Windows installation policy; models are persistent asse…

…ts, not caches

A companion policy to settings-storage.md: dual-scope per-user-default MSIs,
the ArtCraft suite folder, what an update must preserve (folder, context, no
duplicates), standalone installability, and the platform-native boundary on
macOS, Linux and FreeBSD. Splits models out of the disposable-caches row:
downloaded models are persistent user assets that cache cleanup and app
uninstallers must never delete.

* docs: describe suite Windows installation policy

* docs: record the wizard scope and folder rules and the real-install c…

…hecks

The scope page leaves ALLUSERS unset for Only for me, and the wizard sets the new-install folder itself after the choice, because Windows Installer resolves Program Files once for the context it started in. Notes the 32-bit Program Files (x86) folder and updates the adoption table to say real per-user and all-users msiexec runs were done. Clean-machine and second-account checks are still pending.

* docs: new installs default to per-machine; only the old default folde…

…r moves

* docs: say plainly that released packages still default to per-user

The policy says new installs are per-machine, but every released package is
dual-scope with a per-user authored default, and the inventory still listed
"Per-user default". The policy now separates the two: what the policy is, what
the packages do today, who picks per-machine (the launcher, or "Everyone" in the
wizard), and the follow-up that closes the gap.

Also: Update all's one-prompt route was reverted after the antivirus incident,
so the policy no longer says it asks once; the Linux model folder names its
ArtCraft/models subfolder; repair is listed where the 26/10 payload runs
covered it; the inventory no longer says nothing was released.

* docs: the launcher and a direct MSI run match only for the same scope…

… and folder

CodeRabbit pointed out that 'produce the same result' contradicted the
documented new-install difference: the launcher sets ALLUSERS=1, while a
direct run keeps the package's per-user default.

* docs: make the legacy-folder migration exception explicit

State that exact former-default paths can migrate even when manually
chosen, subject to maintainer acceptance of the proposed policy. Preserve
other chosen folders and document the effect on custom shortcuts.

---------

Co-authored-by: Jeremy <jeremy8776@googlemail.com>
2026-11-12 10:43:51 -05:00
nonplessesdsnrffffandBen Mathews 65cf3f9b0d craft-web-host: accept PDF page attachments from the host
* craft-web-host: accept PDF page attachments from the host

---------

Co-authored-by: Ben Mathews <ben@themathewsgroup.com>
2026-11-12 10:43:32 -05:00
Ken MantleandKenM76 f3b643d081 prepress: separate a page in bands, past the 4 MP plate cap
* prepress: separate a page in bands, past the 4 MP plate cap

`plates_in_bands` finds a page's inks once, then separates it in row
bands of at most MAX_PLATE_PIXELS each, rendering every band through
craft-pdf raster's size/offset viewport. A page can now be separated at
print resolution with bounded memory: only the renderer's 8192-pixel
side limit and a 256 MP per-plate total (MAX_BANDED_PIXELS) lower the
resolution. `plates` is unchanged in behaviour: it is the one-band case
of the same code.

Tests: bands of 7 rows join byte for byte into the whole-page render of
an anti-aliased disc under an overprinting spot (fails when the band
offset is dropped), and a 40 pt page at 3700 dpi separates at full
resolution in bands under the cap (fails when banding uses the plate
cap's scale).

Refs #838.

* prepress: bands pass the renderer's whole-page limits

The page's pixel size came from `raster::dimensions` on the whole page,
which enforces the renderer's 64 MP and 8192-pixel side limits, so a
Letter page past about 830 dpi failed with OutputLimit instead of
banding. The size is now computed as the renderer floors it, and only
each band's viewport reaches the renderer. Bands are also capped at
MAX_SIDE rows, and ink discovery renders within the renderer's limits.

A Letter page at 900 dpi now separates in 19 bands at full resolution;
across the page the side limit still lowers it, near 960 dpi.

Test: a 10 x 2000 pt strip at 600 dpi (16 666 rows) separates in three
bands with its black square on the right rows. It fails with either the
whole-page dimensions call or the uncapped band height restored.

* prepress: check the page before discovery; say what the banded cap bounds

The page-size check now runs before ink discovery renders anything.
MAX_BANDED_PIXELS bounds pixels, not the number of bands; the doc
comment and the README caps table say so.

* prepress: count a sub-pixel side as one pixel in the banded cap

A side scaled under one pixel still renders one, so a very thin, tall
page could pass MAX_BANDED_PIXELS by far. banded_scale now fits the
other side alone in that case, and separate() refuses any floored size
over the cap before it renders a band.

* prepress: keep the banded area scale under the cap after rounding

The area scale came from the exact cap, so f32 rounding could floor a
page one row past it (17 x 15 058 824 pt at 72 dpi), which then failed
with OutputLimit. The same 0.1% margin as the one-pixel branches now
applies to the area scale too, with a test on that page.

---------

Co-authored-by: KenM76 <KenM76>
2026-11-12 10:41:24 -05:00
skylar taylor-barrickandskylartaylor 86ed498b49 Prepare v0.1.0 with release notes, versioning policy and pinned adoption
* Prepare the first coordinated craft-libs release

---------

Co-authored-by: skylartaylor <skylartaylor@users.noreply.github.com>
2026-11-12 10:38:46 -05:00
aionggandaiongg 270db68c1e craft-cms: run the CMS suite in CI
* craft-cms: run the CMS suite in CI; say when system-profile checks are skipped

* craft-cms: satisfy clippy's chunks_exact_to_as_chunks lint in the total-ink test

---------

Co-authored-by: aiongg <aiongtaigi@gmail.com>
2026-11-12 10:38:37 -05:00