Commit Graph
191 Commits
Author SHA1 Message Date
BFlat 6c7484457b Merge pull request #2923 from dotCooCoo/feat/craft-raster3d
craft-raster3d: CPU raster, shadow maps, resolve and encoding from EffectCraft
2026-11-30 01:10:15 +07:00
BFlat 7f52db114e Merge pull request #3934 from dotCooCoo/fix/kurbo-linear-cubic-zero-tangent
kurbo: carry 0.13.1 in vendor/ with a stroke fix for zero tangents
2026-11-29 00:25:53 +07:00
BFlat 19c08ce81a Merge pull request #1233 from dotCooCoo/feat/craft-mesh-ops
craft-mesh-ops: mesh operations, a BVH and primitives for the 3D apps
2026-11-28 23:59:52 +07:00
dotCooCoo 0fd83009e3 Merge main into fix/kurbo-linear-cubic-zero-tangent 2026-11-28 08:49:46 -08:00
dotCooCoo ff6c7ee288 Merge main into feat/craft-raster3d 2026-11-28 01:41:48 -08:00
dotCooCoo 08525664c3 kurbo: a stroke skips zero tangents instead of giving NaN
A collinear cubic that runs back and forth is stroked by
StrokeCtx::do_linear, which steps from cusp to cusp. After rounding, two
cusps can land on the same point, or a cusp on the end point, and the
tangent between them is exactly zero. do_join and do_line divide by the
tangent's length, so the whole outline held NaN coordinates and a
renderer that fills it draws no stroke. do_linear now skips such a step.

The stroker had the same fault for a quadratic or cubic that ends where
it starts with control arms shorter than 1e-6: PathSeg::tangents falls
back to the chord, which is zero. Such a curve is now skipped, as a
zero-length line already is.

The linear_cubic_with_coincident_cusps and tiny_closed_loops tests fail
on the published package. README.craft.md, SOURCE.json and NOTICE list
the patches.
2026-11-27 13:38:22 -08:00
dotCooCoo 5ee624b384 kurbo: keep a copy of the crates.io 0.13.1 package in vendor/
Add the kurbo 0.13.1 package to vendor/ with no file changed, so that a
fix to it can reach the Craft apps through this repository. The package
was published from the v0.13.1 tag of linebender/kurbo, and every file
of the archive is kept.

Add a workspace exclude, a [patch.crates-io] entry, SOURCE.json with the
archive hash and per-file hashes, a NOTICE section, and the package's
tests in the backend test script, whose other backends now also build
against the copy. Every workspace crate that uses kurbo 0.13 builds
against the copy, so Cargo.lock drops the package's registry source and
checksum.
2026-11-27 13:17:31 -08:00
dotCooCoo 5ccb4d64c1 Merge main into fix/linesweeper-add-many-paths-quadratic 2026-11-26 00:03:39 -08:00
dotCooCoo 795d798def craft-mesh-ops: the crate is the TextureCraft geometry code moved as it is
Replace the crate's sources with TextureCraft crates/geom at 386630e and
MaterialCraft Mesh::subdivided at 3133062, with their tests, so this pull
request is the move alone. The crate keeps the sources' dependencies and
behavior; rustfmt is applied at this repository's 150 columns. Fixes to the
moved code go in separate pull requests.
2026-11-25 23:11:13 -08:00
dotCooCoo a5c89d9d51 Merge main into feat/craft-mesh-ops 2026-11-25 20:45:54 -08:00
dotCooCoo c7eed854ba Merge main into feat/craft-raster3d 2026-11-25 20:23:22 -08:00
dotCooCoo 403d97b6be Merge main into integration/linesweeper 2026-11-25 19:51:20 -08:00
BFlat b5c33cddef Merge pull request #2880 from dotCooCoo/feat/craft-pbr-wgsl
craft-pbr: shading functions as WGSL text for apps' shaders
2026-11-26 10:28:51 +07:00
dotCooCoo 9a56e78aeb Merge main into integration/linesweeper 2026-11-25 19:28:03 -08:00
dotCooCoo a8e1315bc0 Merge main into feat/craft-mesh-ops 2026-11-25 19:26:13 -08:00
BFlat 5632c89adf Merge pull request #729 from dotCooCoo/fix/linesweeper-transversal-negative-dy
linesweeper: curves that cross just after a shared start are not reported as ordered
2026-11-26 10:14:01 +07:00
dotCooCoo 51de235a44 Merge main into feat/craft-raster3d 2026-11-25 18:56:25 -08:00
aiongg cf35f7dbae Merge remote-tracking branch 'upstream/main' into next-sync-1123
# Conflicts:
#	Cargo.toml
#	crates/audio/src/track.rs
2026-11-23 01:29:52 +00:00
dotCooCoo 517454e4a4 Merge main into feat/craft-raster3d
# Conflicts:
#	NOTICE
2026-11-21 17:55:37 -08:00
FredApps 3de39fd3a5 media-source: play indexed Y4M from bounded byte ranges (#2903)
* media-source: play indexed Y4M from bounded byte ranges

* Preserve Y4M indexing errors and align fractional seek boundaries
2026-11-22 04:58:22 +07:00
dotCooCoo c6c7cf30af craft-raster3d: CPU raster, shadow maps, resolve and encoding from EffectCraft
Adds crates/raster3d (craft-raster3d) with EffectCraft's Advanced 3D CPU
renderer from crates/render/src/three_d/adv.rs (resolve, encode,
render_cpu), adv/raster.rs (render, shadow maps, env_shadow_map),
adv/shade.rs and the scene types of adv/scene.rs, at 2f16feb1.

- try_render, try_shadow_maps, try_env_shadow_map, try_resolve,
  try_encode and try_render_cpu check the scene first and return a
  RenderError instead of panicking: indexes, materials and textures that
  do not exist, spans past their arrays, values that are not finite,
  alpha, cone cosines, light kinds and alpha modes out of range,
  environment level ranges that overflow, zero sizes and resolve
  factors that do not divide the size.
- Limits bounds the raster pixels (2^24), triangles (2^22), vertices
  (3 x 2^22), lights (1024) and coverage work (2^31). Setup stops at the
  first triangle past the work limit, and the same limit covers the
  shadow maps' depth tests.
- An environment light whose radiance levels or irradiance map do not
  exist is an error instead of black light, and so is a shadow mark
  that names a map that does not exist. A raster side over 2^30 is an
  error whatever the limits.
- Finite inputs near the top of the f32 range no longer give NaN or
  infinite output: clipping, projection with a tiny w, bilinear
  sampling and resolve fall back to f64, and a rendered pixel, encoded
  pixel or shadow map that still overflows is an error.
- Triangles are clipped against a guard band of 1024 w in x and y, so a
  triangle far past the viewport is no longer dropped, and a triangle on
  the far plane is drawn.
- try_shadow_maps replaces the maps of an earlier call instead of
  appending texels after them, and reads any shadow mark of 0 or more
  as a request, so a second call gives the same maps. Masked casters
  use the material's alpha cutoff, and an untextured caster whose alpha
  shading discards casts no shadow.
- The search under discarded opaque pixels visits each triangle's
  bounding box once, in the same order, so the work limit bounds it.
- render, setup and the shadow passes are split into smaller functions
  with the same order of operations. For valid scenes inside the guard
  band and off the far plane, whose alpha-tested casters are textured
  with a cutoff of 0.5, every output matches EffectCraft bit for bit;
  the differential tests run a copy of EffectCraft's code on the same
  scenes.
- EffectCraft's seven raster and shadow-size tests move to the crate's
  API.
2026-11-21 13:28:04 -08:00
dotCooCoo 9acd6d5883 craft-pbr: record the TextureCraft, MaterialCraft and EffectCraft sources in NOTICE
NOTICE lists the files craft-pbr adapts and the reference copies in tests/it/reference, with each repository, path and full revision, under Source provenance as docs/clean-room.md asks.
2026-11-21 09:41:50 -08: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
aiongg ca58dfe6c9 Merge storytold main into next (19 Nov sync)
Merges main at d7c9632bfb.

- Cargo.toml: both sides' new workspace crates (next's font-subset, harfbuzz-subset-sys and
  host; main's gpu, gpu-null, gpu-providers and gpu-wgpu).
- crates/jpeg: next split lib.rs into modules; main's reduced-size decoding goes to them: the
  scaled IDCT, reconstruction and render_scaled to idct.rs, MAX_SHRINK, reduced_estimate and
  decode_reduced stay public in lib.rs. Main's new test added; the frame test next removed
  stays removed.
- crates/audio, crates/media: next builds the integration tests into the library's test
  executable (autotests off, tests/main.rs); main's new DSD and MPEG-TS mux tests are modules
  there behind their features instead of [[test]] targets, and the mux tests reach their shared
  helper module through the integration module.
- crates/media/src/matroska/track.rs: main's new FFV1 codec-parameter test added; the test
  modules next removed stay removed.
- crates/file-formats: main's JXL capability test, which asks the codec whether JXL reads,
  replaces next's interim check.
2026-11-19 16:22:24 +00:00
texjer 400b2f821d craft-develop: the crate, with inpaint from LightCraft
The first module of the shared develop pipeline (#587): lightcraft-inpaint at
a75497d6, as craft_develop::inpaint. PatchMatch patch completion and the
membrane fill it seeds from, with their tests. Only the paths in two doc
links and two imports changed.

A parity test compares both fills of one scene with what LightCraft's crate
gave at that commit, through craft-render-parity at Tolerance::BASELINE.
2026-11-17 13:00:47 -05:00
aiongg ac3dfd1f53 Merge storytold main into next (17 Nov sync)
storytold main 83cb1133dd (291 commits) into the integration head bab1a99b85; 47 conflicted files.

- Domain test files (metafile, prepress, pdf plates, settings store, heif, media-testkit, atomic): tests next cut stay cut; tests new on main are kept, as trials where the crate's test target runs trials.
- atomic: main's group-bits test and Faulty::set_group go to src/tests.rs. audio: main's GSM and SBC oracles join tests/main.rs. cms constructors, pdf knockout_backdrop and testing_pdf join their crates' one test binary; timeline's preflight tests become src/preflight_tests.rs trials.
- update: main's changes to detect, install (linux, macos) and the tests land in next's split modules. The app's own offer is inspected on a thread of its own, picked up by tick's polling; settle_for_tests settles offers too. Later on a ready update drops the close it asked for. updater_pin_tests.rs stays deleted; its new pin test is in tests/it/update.rs.
- craft-color: main added a different crate at crates/color (the colour tags of compositor and display frames); it is next's craft-color module `tags`, re-exported at the root.
- Old crates/ui (combo, docking, testing, README) and keymap's ui/view.rs stay deleted; main's new crates/ui/src/testing files are dropped with them.
- New crates in the craft facade: ai, control, dds, frame, ipc, media-source, palette, press-print, score, ssip. testkit and xtask are listed outside it.
- Cargo.lock: the union of both locks, resolved by cargo metadata. Workflow: main's nextest Windows leg, with next's --keep-going clippy.
2026-11-17 12:44:52 +00:00
dotCooCoo 81eafc3a29 Merge main into integration/linesweeper 2026-11-16 21:35:13 -08:00
dotCooCoo 3ce3470444 Merge main into feat/craft-mesh-ops 2026-11-16 19:28:46 -08:00
dotCooCoo 6e9efbdba1 Merge main into fix/linesweeper-transversal-negative-dy 2026-11-16 19:26:45 -08:00
dotCooCoo f78c1b302b Merge main into fix/linesweeper-add-many-paths-quadratic 2026-11-16 19:23:16 -08:00
.CooCoo 5724da0f2e linesweeper: short chords at huge x and subnormal line x stay finite and exact (#1258) 2026-11-16 21:36:59 -05:00
aiongg dffc61a7e0 Merge storytold main 832883b5 (sync 16 Nov)
961 upstream commits since 7bb6c900. Resolutions:
- Test-only conflicts: upstream tests from before the base that our side
  cut stay cut; tests new upstream are kept (audio aac/config, layout,
  encode_format; cms lutfile; media mux; print windows_native, ticket;
  update self_update; xml hostile).
- Code our side moved, with upstream's change carried to the new place:
  craft-media mux roll sample groups (mux/boxes.rs) and writer-start
  offsets with overflow checks (mux/progressive.rs); craft-print's
  shrink-to-fit scale guard (sheets/plan.rs); craft-update's nextest
  archive detection (self_update/detect.rs); craft-vectorcraft-format's
  Tail::write_to_with (container.rs); craft-i18n's pedantic fixes
  (bidi.rs, negotiation.rs).
- craft-ui: the old crate's modules stay removed; gpu_test_lock guarded
  their per-test wgpu renderers, which the snapshot kit does not have.
- New upstream tests in crates that build their integration tests into
  the library's test executable are modules of tests/main.rs (audio
  flac_decode and qoa_oracle, cms, docpath, pcraft-format,
  vectorcraft-format).
- The 22 new crates are optional members of the craft facade.
2026-11-16 01:52:09 +00:00
dotCooCoo 9f564159c5 Merge main into feat/craft-mesh-ops 2026-11-15 16:45:03 -08:00
Dylan M. Taylor e2e2ce2c88 Retain IJG and SIMD notices for shared JPEG encoding 2026-11-15 12:34:42 +00:00
dotCooCoo c599e9485c Merge main into fix/linesweeper-transversal-negative-dy 2026-11-14 09:11:24 -08:00
dotCooCoo bccb0a15ea Merge main into fix/linesweeper-add-many-paths-quadratic 2026-11-14 09:10:22 -08:00
Dylan M. Taylor 15b013b305 Merge pull request #637 from dotCooCoo/fix/linesweeper-sweep-doc-left-scan
linesweeper: the left intersection scan in docs/sweep.typ compares with alpha^(i+1)
2026-11-14 11:19:24 -05:00
dotCooCoo bb0e0cdd11 Merge fix/linesweeper-chord-huge-x-subnormal (#1258) into integration/linesweeper 2026-11-14 02:12:44 -08:00
dotCooCoo 645fe92a72 Merge main into feat/craft-mesh-ops 2026-11-13 21:08:37 -08:00
dotCooCoo a32a377e03 linesweeper: short chords at huge x and subnormal line x stay finite and exact
fit_quadratic takes a chord for a very short curve. Its constant term
multiplied an x coordinate by a height, which overflowed for x near
1e305 with heights near 1e4, and the difference of the two products was
NaN. When that constant term is not finite, it now takes the line
through the curve's start point with the chord's slope.

line_at_ys took the weighted sum of the x coordinates directly, so a
vertical line at x = 5e-324 gave x = 0 halfway along its height. When
both x coordinates have a magnitude below 2^-500, the sum is taken on
the x coordinates times 2^600 and scaled back.

README.craft.md, SOURCE.json and NOTICE record the local patches.
2026-11-13 20:12:23 -08:00
dotCooCoo 4c1e94606f Merge fix/linesweeper-clippy-lints (#1248) into integration/linesweeper
# Conflicts:
#	vendor/linesweeper/README.craft.md
#	vendor/linesweeper/SOURCE.json
2026-11-13 20:03:31 -08:00
Dylan M. Taylor 840d156fbf Merge current main into image codec extraction 2026-11-14 03:10:53 +00:00
dotCooCoo 453843d534 craft-mesh-ops: mesh operations, a BVH and primitives for the 3D apps
crates/mesh-ops holds the triangle-mesh code that TextureCraft and
MaterialCraft each keep a copy of: area-weighted normals, MikkTSpace
tangents, welding, UV unwrapping, the UV-space G-buffer, primitives
with UVs, a BVH (feature `bvh`) and the orbit camera. It is the
craft-mesh-ops crate of RFC-0032
(https://github.com/storytold/craft-contrib/pull/50). Each app switches
to it in its own pull request.

The code is TextureCraft's crates/geom at 386630ee, with
Mesh::subdivided from MaterialCraft's crates/geom at 31330629. Their 30
tests are unchanged. The index check before tangent generation and its
two tests are from TextureCraft #386 by simonhull.

Added to the moved code:

- Functions that take positions, normals, UVs and indices as plain
  slices (bounds, smooth_normals, tangents, weld, unwrap_uvs,
  UvGBuffer::from_slices, Bvh::from_slices), and `Limits` with a
  default for each count. They check the counts, every index and every
  value before any work and return a MeshOpsError.
- try_ forms of append, subdivision, the primitives, the G-buffer and
  the BVH. The existing forms keep their signatures: they clamp, or
  return the mesh unchanged or an empty result.
- `rayon` and `serde` are the optional features `parallel` and `serde`.

Behavior of the moved code that changes:

- A mesh with an index past its vertices, which made MikkTSpace panic,
  a non-finite position, normal or UV, or only triangles that are
  degenerate after the division below gets per-triangle tangents
  without the MikkTSpace call. Positions and UVs outside 1e-6 to
  1e6, and normals that are not near unit length, are divided by their
  largest magnitude first.
- Submesh ranges are added in u64 and have to cover whole triangles.
  append returns the mesh unchanged where a rebased index or range does
  not fit in u32, keeps the attribute arrays as long as the positions,
  and gives a side without a material list one unnamed material.
- subdivided takes midpoints as half-sums, keeps each submesh on its
  own triangles and carries polygon diagonals to the four children.
- Mesh::bounds leaves out non-finite positions. normalize_to reaches
  the requested radius for a mesh near f32::MAX or smaller than 1e-4.
- The BVH leaves out triangles with a non-finite corner. A ray with a
  non-finite origin or direction, a zero direction or a NaN tmax, a
  nearest query with a non-finite point or a NaN or negative distance,
  and a box query with a NaN coordinate find nothing. The ray test's
  determinant cutoff follows the size of the triangle, and the nearest
  search includes a point exactly at the distance.
- The primitives return an empty mesh for a non-finite size or one that
  overflows a coordinate, where they built a mesh from a NaN size, and
  the box returns one for a negative, NaN or zero half size, where it
  panicked or gave NaN UVs.
- UvGBuffer::new clamps each side to 8192 and skips a triangle more
  than 1e18 texels from the UV origin.
- auto_unwrap gives the same layout at every scale and leaves the mesh
  unchanged when it returns an error. weld_ids keeps its grid of 1e-6
  of the diagonal for a diagonal under 1e-6.
- OrbitCamera::frame leaves the camera unchanged for a box it cannot
  frame.

TextureCraft #277, #416, #253, #413 and #360 are open on the same files.
The finite-value check that #253 adds to Mesh::validate is included;
the rest of these pull requests is not.

mikktspace 0.3.0 is MIT OR Apache-2.0. Its src/generated.rs carries the
2011 notice of Morten S. Mikkelsen's C original, which
crates/mesh-ops/ATTRIBUTION.md reproduces.
2026-11-13 15:47:41 -08:00
aiongg 3e4b679592 Merge storytold main 7bb6c900 (sync 13 Nov)
# Conflicts:
#	Cargo.toml
2026-11-13 23:41:57 +00:00
Dylan M. Taylor 888bffcbb3 Add shared DWG-DXF byte bridge 2026-11-13 22:45:07 +00:00
aiongg 577055bc34 Merge storytold main 3c59a2aa5 into craft-framework (sync 13 Nov)
202 upstream commits since 6cb00467a. Resolutions:
- craft-window, craft-platform: ours. Upstream's frame policy v2, restore
  store and GNOME light/wait_first are the versions carried on 28 Oct;
  ours moved place() to craft-behavior and kept LayoutWatch and the
  appearance/portal.rs split.
- craft-timeline: ours. craft-time (crates/time) lands as upstream wrote
  it and is not yet used by craft-timeline.
- Old crates/ui modules stay removed. Upstream's frosted backdrops, shape
  gallery, dialog tabs and the iconic flyout top-edge rendering are not
  carried. The #1094 model half is in craft-behavior's dock:
  Group::flyout_offset and Action::MoveFlyoutTop.
- craft-update: #586 Save and Update, the install probe on the check
  thread and quiet per-user MSI self-updates, carried into updater.rs,
  stack_dialogs.rs, install/windows.rs and self_update/helper.rs.
- craft-jpeg: progressive Huffman decoding, carried into huffman.rs,
  parse.rs and scan.rs.
- craft-print: the driver settings dialog's new tests and the bounded
  XML parse's tests, as trials.
- Test-only conflicts: upstream tests from before the base that our side
  cut stay cut; tests new upstream are kept.
2026-11-13 17:11:48 +00:00
Dylan M. Taylor 9430f2807e Add shared image codec facade 2026-11-13 00:17:04 -05:00
dotCooCoo 32ffa0b58a Merge main into fix/linesweeper-sweep-doc-left-scan 2026-11-12 09:02:06 -08:00
dotCooCoo 6274c80715 Merge main into integration/linesweeper 2026-11-12 08:46:07 -08:00
dotCooCoo 7c9a633bba Merge main into fix/linesweeper-transversal-negative-dy 2026-11-12 08:43:25 -08:00