Commit Graph
4161 Commits
Author SHA1 Message Date
dotCooCoo 101eb2f953 craft-pbr: keep n·h at most 1 and document the specular denominator floor
Rounding after normalization can make n·h slightly greater than 1. At the
roughness floor that put the GGX distribution above its peak: a normal,
view and light along (1, 1, 0.5) gave a highlight 1.68 times the head-on
one. try_direct now takes n·h as at most 1.

The specular denominator 4 (n·v) (n·l) is taken as at least 1e-4, as in
EffectCraft. The try_direct doc comment and the README now say so, and a
test checks the floored value at a grazing angle.
2026-11-21 08:59:51 -08:00
dotCooCoo bb5a3d472b craft-pbr: metallic-roughness BRDF, environment BRDF and default environment from EffectCraft
Adds the direct-light BRDF, the split-sum environment BRDF and the
default studio environment of EffectCraft's adv/shade.rs and
adv/scene.rs to craft-pbr, with EffectCraft's tests on the new API.

- Material::try_new and try_with_weights check base color, metallic,
  roughness and the specular and diffuse weights; NaN, infinity and
  values out of range give PbrError::BadMaterial. try_direct checks and
  normalizes its directions (PbrError::BadDirection).
- The BRDF is the final form of glTF 2.0 section B.3.5 with Schlick's
  Fresnel and the GGX distribution of ggx_distribution, evaluated in
  f64. The geometry term stays the Smith-Schlick term with
  k = (roughness + 1)^2 / 8 for analytic lights; it equals glTF's
  separable Smith term at roughness 1.
- Roughness is shaded as at least 0.032 instead of 0.03, above the
  alpha floor of ggx_distribution. A view straight opposite the light
  gives 0.
- try_environment_brdf keeps scale and bias at least 0 with a sum of at
  most 1. The fit gave a scale of -0.044 and a bias of 1.044 at n.v = 0
  and roughness 0, and a bias of -0.0024 at n.v = 0 and roughness 1.
- default_environment returns the 8 x 4 studio gradient in this crate's
  frame; its pixels match EffectCraft's within 1e-6.

New tests: a white metal reflects at most the light it receives at every
roughness and view angle, the BRDF is reciprocal, roughness is clamped
at MIN_DIRECT_ROUGHNESS, metallic 0 and 1 match glTF's dielectric and
metal BRDFs, the geometry term against glTF's Smith form, invalid
values are refused, and the direct light, environment BRDF and default
environment match a copy of EffectCraft's code.
2026-11-21 08:30:29 -08:00
dotCooCoo e8fac42706 craft-pbr: keep halving, resampling and SH tables inside Limits
- try_half computes each output pixel's covered source span on the fly
  instead of building per-axis weight tables, so halving allocates only
  the output buffer that Limits already counts. Results are unchanged.
- try_half and try_resampled check the source against the limits as
  well as the result.
- try_sh9 checks its column table (48 bytes per column) against
  Limits::max_bytes before reserving it.
- The TextureCraft migration step says that the import, each try_half
  and try_resampled need Limits raised past the default 2048 side.
- The test helper max_rel_diff treats a NaN or infinite value as
  infinitely far, so a non-finite result can no longer compare equal.
2026-11-21 06:48:44 -08:00
dotCooCoo 3f89a2cba8 craft-pbr: GGX environment prefilter and SH9 irradiance for TextureCraft and MaterialCraft
New crate craft-pbr with the image-based lighting code that TextureCraft
and MaterialCraft each keep in crates/render/src/ibl.rs: an equirect
EnvImage, the split-sum GGX prefilter chain (Karis 2013, GGX as glTF 2.0
sections B.2.3 and B.3.2 define it), nine SH irradiance coefficients and
the six procedural environments.

With a firefly cap of 64, which both apps apply, the prefiltered levels
match the apps' code exactly for sources with even sides; a differential
test runs a copy of that code against the crate. Changes from it:

- Halving an odd side keeps its last column or row.
- The firefly cap and the level bias are options; the cap is off by
  default.
- Sizes, buffer lengths, radiance (0 to MAX_RADIANCE), options and
  directions are checked, and memory and sample work are bounded by
  Limits, before anything is allocated. Buffers are reserved fallibly.
- The SH projection reads every pixel and integrates each basis function
  over the pixel's area, so a uniform source of any size gives uniform
  irradiance and rows near the poles keep their solid angle.
- rayon is behind the optional `parallel` feature; the default build
  compiles for wasm32-unknown-unknown.

On a 256 x 128 source the default prefilter evaluates 1,396,736 samples.
2026-11-21 06:15:17 -08:00
FredAppsandCodex 531f12d235 Add bounded Sony rtmd timecode prefix parser (#2789)
Co-authored-by: Codex <codex@openai.com>
2026-11-21 14:42:45 +07:00
studiosloppyandFredApps ad0cb48e82 craft-psd: tolerate a missing pad byte after the last image resource (#1949) (#1951)
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-21 09:22:30 +07:00
Terra854 b674d91fbe stream-codecs: decode a RunLength stream prefix (#2703) 2026-11-21 08:32:16 +07:00
Dylan M. TayloranddotCooCoo 9b28b56bc7 craft-cdr: look up clipped objects' own chunks once (port vectorcraft#8862) (#2727)
Ports @dotCooCoo's clipped-group lookup accounting and regression test
() from storytold/vectorcraft#8862
into craft-cdr (#778, storytold/vectorcraft#8857).

Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
2026-11-20 19:30:33 -05:00
Dylan M. Taylor 0350c2edc0 sqlite: extract shared page-size, B-tree header, local-payload, and signed-int helpers (#2694)
* sqlite: extract shared page-size, B-tree header, and signed-int helpers (#778)

* sqlite: remove duplicate test block in wire.rs

* sqlite: cover Error Display and truncated/invalid page-header branches
2026-11-20 19:26:17 -05:00
Dylan M. TayloranddotCooCoo 75d179f8df craft-cdr: move VectorCraft's bounded CDR/CMX reader into craft-libs (#2697)
* craft-cdr: move VectorCraft's bounded CDR/CMX reader into craft-libs (#778)

Moves crates/cdr (vectorcraft-cdr, landed in storytold/vectorcraft#8632)
to craft-libs as craft-cdr: legacy WL (v1-v2), RIFF/cmpr (v3-v13),
ZIP packages and data streams (v14-v27), .cmx (32-bit), provenance
(R1-R63), synthetic test builders, and integration tests.

Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>

* craft-cdr: address CodeRabbit review findings

- Classify all-zero CMX dash patterns once in Tables::read instead of per-curve
- Validate loda offset table length before reserving offsets Vec capacity

---------

Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
2026-11-20 19:12:32 -05:00
Terra854 c6c90e991b sqlite: share B-tree local payload sizing (#2696) 2026-11-21 06:16:40 +07:00
FredApps 2d9d096e4f Merge pull request #2495 from keithcsqueensu/ppt95-shapes
craft-ppt-binary: read PowerPoint 95 shapes and lines (#2317, step 3)
2026-11-21 02:41:26 +07:00
FredApps d7fc79387d Merge pull request #2493 from keithcsqueensu/ppt95-text
craft-ppt-binary: read PowerPoint 95 placeholders and text (#2317, step 2)
2026-11-21 02:10:22 +07:00
dependabot[bot] a20dfd1623 ci(deps): bump actions/checkout (#2582)
Bumps the actions group with 1 update in the / directory: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4.4.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.4.0...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-20 13:19:17 -05:00
bdb9dae67d craft-xlsx: typed external links, and external references in binary formulas (#1347)
* craft-xlsx: typed external links, read from .xlsx and .xlsb; external references in binary formulas

ExternalLink (another workbook as ExternalBook: its target, sheet names,
defined names with refersTo and sheetId, and cached cells; a DDE or OLE link
as Other) reads from externalLinkN.xml and externalLinkN.bin alike.
Package::external_links gives one entry per Workbook::external_references,
which is now a typed field, read from externalReferences or the binary
workbook's BrtSupBookSrc records and written back from the field.

A binary formula's reference to another workbook decodes as .xlsx spells it:
[1]Data!$A$1, '[1]Other Sheet'!A1, '[1]A:C'!A1, [1]!ExtName, [1]Data!Local
for a sheet-scoped name, a DDE item [2]!'R1C1'. The link parts are read when
the workbook part is; one that can't be read, a deleted sheet of it or a name
it lacks keeps the cell's saved result.

Closes #1252.

* craft-xlsx: review fixes: external links keep their numbers, are read once, and deleted sheets keep values

- An externalReference without an r:id, or a BrtSupBookSrc whose id can't be
  read, keeps its place as an empty id, so the links after it keep their
  [n]; it is written back without r:id.
- A binary workbook's external link parts are read once, with its workbook
  part: the formulas' index and Package::external_links share that read, so
  cached cells are charged to binary_cells once.
- PtgNameX through a deleted sheet of another workbook (-1) keeps the cell's
  saved result instead of falling back to the name's own scope.

* craft-xlsx: deduplicate binary external links against budget and add cache-cap test

* craft-xlsx: avoid cloning ExternalLink on duplicate binary external references

---------

Co-authored-by: kiwi4boy <kiwi4boy@gmail.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2026-11-20 13:19:14 -05:00
FredApps 86d6df9c45 Preserve additional COLLADA camera instances (#2576) 2026-11-21 01:14:47 +07:00
FredApps 7f5c123859 Merge pull request #2116 from marcwgls/fix/html-fragment-spacing
craft-html: a fragment keeps its paragraphs' spacing and indents
2026-11-21 01:05:10 +07:00
aiongg 7d22ffc36b Merge pull request #2503 from aiongg/ci-test-select
Workspace: pull requests run only the tests their change reaches
2026-11-20 13:01:27 -05:00
FredApps a49329e71e Merge pull request #2507 from OPUZZLES/opuzzles/proof-map-lookups
Proofing: index spelling MAP lookups
2026-11-21 00:23:07 +07:00
aiongg 1819a0868e Workspace: pull requests run only the tests their change reaches
craft-common-actions' select-platforms selects the tests: the crates that
own a changed file, the crates that declare a read of it, and every
crate that depends on them. Every nextest run gets the filter; the build
and the doctests stay whole-workspace. The build setup, a crate's own
Cargo.toml and files outside the crates other than docs run every test;
docs alone run none. pdf, svg and the fonts-build consumer declare the
files of other crates that their tests read.
2026-11-20 17:17:41 +00:00
Dylan M. Taylor 5d4357256a ps(write): handle empty, single, and flat stops in push_shading (#2570) 2026-11-20 11:43:22 -05:00
FredApps 712b35379b Merge pull request #1691 from vangel76/fix/drawingml-numfmt-1675
Chart number and date formats show what Excel shows (rounding, dates, fractions, conditions)
2026-11-20 22:45:34 +07:00
FredApps f389c25c23 Resolve scatter category axis by position rather than ID order 2026-11-20 16:01:18 +01:00
David Mann 8f92ed1334 Merge pull request #2550 from davidmann4/agents/default-folder
craft-control agents: default agent folder in Documents and the agent_folders tool
2026-11-20 15:54:58 +01:00
FredApps 6200c71304 Keep category formats with their source and preserve literal slashes 2026-11-20 15:51:04 +01:00
49b542759c mesh: support opt-in GLB sampler filtering (#2523)
* mesh: support opt-in GLB sampler filtering

* mesh: describe GLB sampler filtering in the README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:28:05 +07:00
FredApps 05603f5e40 Match observed second rounding in date and minute formats 2026-11-20 15:10:53 +01:00
FredApps 533518fc18 Keep original date and minute when seconds are not displayed 2026-11-20 15:05:31 +01:00
FredApps 7c2494b611 Merge main, retaining chart date formats and data-table metadata 2026-11-20 15:05:16 +01:00
David MannandClaude Opus 5.5 f9ebae49c0 craft-control agents: default agent folder in Documents and the agent_folders tool (#2548)
An empty agent folder setting meant no file access, so an agent reached
through the launcher's MCP entry could neither open nor save a file, and
nothing told it where to put files.

- default_folder(app): Documents/ArtCraft/Agents/<App> (dirs::document_dir,
  else ~/Documents), only for plain app names.
- AgentSettings::folders / folders_with: the person's own folders win; an
  empty setting falls back to the default, created on first use.
- The live client's headless sessions use it (LiveConfig::default_folder).
- FOLDERS_TOOL, folders_tool, folders_answer: the tool each app offers so an
  agent learns the folders it may use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:00:40 +01:00
Dylan M. Taylor 9eb02be84f Merge pull request #2546 from dylanmtaylor/feat/pdf-max-coverage
feat(pdf): enforce max_coverage budget via vendored vello_cpu 0.0.8
2026-11-20 08:27:48 -05:00
David Mann e544a6c69b Merge pull request #2035 from dotCooCoo/fix/update-test-attach-retry
craft-update: the macOS partway-install test retries a busy disk-image attach
2026-11-20 14:20:44 +01:00
aiongg 8048f8ef92 Adopt the shared AGENTS.md (RFC-0072) and test rules (RFC-0071) (#2489) 2026-11-20 18:08:50 +07:00
kiwi4boy 8f14a19169 ppt95: share the trapezoid outline with the PowerPoint 97 path
#2492 landed, so the PowerPoint 95 path's copy of OfficeArt's trapezoid
outline now uses geom::trapezoid. A negative adjust value is 0 on both.
2026-11-20 02:56:26 -05:00
kiwi4boy c53d43acd1 Merge branch 'ppt95-text' into ppt95-shapes
# Conflicts:
#	crates/ppt-binary/src/geom.rs
2026-11-20 02:56:01 -05:00
kiwi4boy bb829867fa Merge remote-tracking branch 'origin/main' into ppt95-text 2026-11-20 02:54:29 -05:00
kiwi4boy 05121acf29 ppt95: decide upright text from the shape's final angle
Whether a shape's text is upright was decided from the quarter-turns
before shape::geometry ran, but geometry gives a mirrored trapezoid a
half-turn of its own, so its text turned upside down with it. The text
is now upright, at its own angle, whenever the shape ends at any other
angle. Probes of trapezoids turned and flipped before and after their
text was typed all end at the text's own angle, as PowerPoint 95 drew
them.
2026-11-20 02:37:52 -05:00
kiwi4boy 91032e78b0 Merge branch 'ppt95-text' into ppt95-shapes 2026-11-20 02:23:26 -05:00
kiwi4boy 6571b28594 Merge branch 'ppt95' into ppt95-text 2026-11-20 02:23:15 -05:00
kiwi4boy b122ba51dd ppt-binary: a PowerPoint 95 slide whose SlideAtom was cut short is lost too
A stream cut just after the SlideAtom's header left an atom with no
body, which counted as kept: the slide read blank and nothing was named
lost. A slide is now kept only when its atom gives its id and its
master's.
2026-11-20 02:23:13 -05:00
kiwi4boy ebd664b8be ppt95 tests: read each WMF record within its size; drop only repeated outline vertices
The samples test's WMF reader took a polygon's points and a rectangle's
sides at fixed offsets, so a record shorter than its count read on into
the next one. Each record is now sliced to its stated size and skipped
when its values don't fit.

The outline matcher merged neighbouring vertices within the pen's
tolerance before comparing, so a narrow rectangle drawn with a wide pen
lost the corners of its short edges. Only exact repeats are dropped now;
the tolerance is for the comparison.
2026-11-20 02:14:43 -05:00
kiwi4boy 3d9992410d Merge branch 'ppt95-text' into ppt95-shapes
# Conflicts:
#	crates/ppt-binary/src/ppt95/tests.rs
2026-11-20 02:13:34 -05:00
kiwi4boy ed6d273e05 ppt-binary: an empty footer gives its look from its end mark; cap point spacing at DrawingML's
The footer row's look came from its first run, so an empty footer, date
or slide number placeholder (no runs once normalized) gave none. It now
falls back to the paragraph's end mark. This is the shared helper, so
both paths take it.

PowerPoint 95 point spacing was capped at 4000 pt, but DrawingML holds at
most 1584 and the writer clamps to that, so a larger value changed on
export. It is now capped at 1584.
2026-11-20 02:13:09 -05:00
kiwi4boy 7fd97515a7 Merge branch 'ppt95' into ppt95-text
# Conflicts:
#	crates/ppt-binary/src/ppt95/tests.rs
2026-11-20 02:11:30 -05:00
kiwi4boy f09e70f281 ppt-binary: a PowerPoint 95 slide cut off after its header is left out and named as lost
PowerPoint 95 writes a slide's SlideAtom first. A slide record without
one is what a file cut just after the slide's header leaves; it read as
a blank slide, and import_checked reported nothing lost. It is now left
out, as the PowerPoint 97 path leaves out the slides it lost, and named
by its position.
2026-11-20 02:11:02 -05:00
kiwi4boy 883fafe72a ppt95: text in a turned box keeps its own angle
PowerPoint 95 lays a shape's text out in the box the geometry holds,
turned by the text's own angle (4003 +16, the geometry's own angle in
every probe). Quarter-turns folded into that box don't turn the text: a
shape turned a quarter before its text was typed draws it upright, and
one turned on to 120 degrees after that draws it at 30 (probes wrap-before,
wrap-mix, wrap-arrow, with word wrap set in the Text Anchor dialog).

When the shape's box is turned back, its text is now upright at that
angle, with its insets on the held box's edges. That replaces remapping
the insets: in PowerPoint 16, upright text with these insets breaks into
the same lines at the same places as PowerPoint 95's renderings, while
remapped insets put an up arrow's text 18 pt off. A balloon's body cut is
taken from whichever edge of the held box its tail is on.
2026-11-20 02:05:01 -05:00
FredApps e6dbc97ca3 Merge pull request #2348 from OPUZZLES/opuzzles/rtf-info-groups
craft-rtf: preserve document properties across nested groups
2026-11-20 13:58:23 +07:00
Codex 9b57bcdd94 Merge main for combined HTML fragment and table export validation 2026-11-20 07:54:59 +01:00
FredApps f7067b297c Merge pull request #2485 from keithcsqueensu/ppt95
craft-ppt-binary: read PowerPoint 95 slides, masters, layouts and backgrounds (#2317, step 1)
2026-11-20 13:49:24 +07:00
kiwi4boy 261b6e7a75 Merge branch 'ppt95-text' into ppt95-shapes 2026-11-20 01:49:23 -05:00