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