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.
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.
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.
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.
[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.
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>
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>
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>
* 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>
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.
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>
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.
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.
* 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>
* 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>
* 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>