Skip to content

Swift-Liquid 1.3.1

Latest

Choose a tag to compare

@ThorFuchs ThorFuchs released this 15 Oct 21:57

Swift-Liquid 1.3.1

Swift-Liquid 1.3.1 strengthens the dependency-free Shopify Liquid engine at two
resource boundaries: deeply nested JSON no longer exhausts the parser's call
stack, and rendering checks cancellation before admitting output after
synchronous filter work. It also delivers the four public-quality sprints:
clearer documentation, adversarial tests, structured evidence, isolated
contribution checks and measurements you can inspect.

Requires Swift tools/compiler 6.4 or later, in Swift language mode 6. Existing
1.0–1.3 library applications need no API migration.

Safer JSON and reliable cancellation boundaries

The ordered JSON reader now uses an explicit container stack. AddressSanitizer
exposed stack exhaustion at the already admitted 128-level nesting boundary;
the fix preserves that boundary, exact scalar keys, object order, number handling
and existing errors. Fixed-seed truncation, escape, Unicode and depth regressions
exercise successful and rejected inputs through the public API.

Output admission checks cancellation before applying its byte quota, including
final delivery after synchronous standard-filter work. Cancellation takes
precedence for empty, fitting and oversized output and does not consume evaluator
steps. Successful output, quotas and logical counters are unchanged. This adds a
cooperative checkpoint; synchronous helpers and arbitrary host callbacks remain
responsible for their own work. There is no preemption or elapsed-time guarantee.

Explicitly coordinated callback tests cover return and recoverable-error paths,
source and parsed templates, and ordinary, diagnostic, measured and combined
rendering. They assert cancellation identity, no subsequent filter evaluation,
sibling isolation and healthy engine reuse without sleeps or timing deadlines.
See limits and concurrency and
measured maintenance.

A stronger public package

  • A rewritten README, six compiled runnable examples, contributor and support
    guidance, expanded API comments and a clearer hosted documentation entry point.
  • Exact Swift Testing event admission: reviewed function/case inventories, raw
    JSONL streams, skip/issue/cancellation accounting and negative runner probes.
    Expected reference errors remain distinct from successful renders.
  • GitHub-hosted runner admission and provenance, pinned actions, read-only
    contribution qualification and a separate main-only documentation deployment.
  • A fresh public-URL library/CLI installation gate for immutable 1.3.0, alongside
    current-candidate consumers and a clean source-archive rebuild. This published
    compatibility anchor remains 1.3.0 until a later explicit change. Publication
    additionally verifies exact 1.3.1 resolution from a fresh public-URL consumer.
  • Swift Package Index registration accepted in
    PackageList PR #15709.
    Registration acceptance does not establish a live index build matrix.

See testing, contribution isolation
and package discovery for commands and limits.

Compatibility and release qualification

The release retains one Liquid library, one liquid executable and no root
package dependencies. Public inputs, engines and parsed templates keep checked
Sendable conformance; mutable render state belongs to each invocation. All 126
authored public declarations in the published 1.3.0 baseline are retained. CLI
inspection, metrics and dependency-report JSON schemas remain at version 1.

Release qualification requires all nine source-bound gates: native, safety,
reference, platforms, documentation, performance, matched performance, published
installation and archive. The archive gate rebuilds and tests the candidate from
a clean extraction and verifies reproducible tracked-source packaging.

The reviewed inventory contains 75 Swift Testing functions and 2,123 parameter
cases in debug and release. AddressSanitizer covers the full suite;
ThreadSanitizer covers five concurrency functions. The 16-function, 43-case
adversarial/cancellation profile is repeated twice under parallel execution.
Five standalone public consumers and the README consumer check external API use;
CLI qualification retains 60 existing and 24 dependency cases plus six positive
and nineteen negative Swift-JSON schema vectors. These counts describe coverage,
not complete language conformance.

All 1,098 pinned Golden Liquid cases, licenses, checksums and parser modes are
preserved. The Ruby reference retains 2,032 core checks: 1,502 successful renders,
337 parsed grammar cases, 132 expected language errors, 26 recovered errors and
35 explicit supported-year boundaries. The 15 paired host-filter cases remain
separate. No exclusion, missing fixture or reference error counts as success.

Runtime qualification covers macOS 27 with Swift 6.4. Four simulator-SDK gates
establish library compilation; device, Linux, WASI and browser execution are not
qualified. The duplicate-normalized-filename CLI vector remains unavailable on
the qualification macOS filesystem and is not counted as passed.

Measurements and their limits

Matched qualification compares all 26 common records with immutable 1.3.0 commit
9963591f18ef8aa1d1a8d9cd9bcc5508c82b5d4e, using its unchanged harness and
manifest. A separate same-candidate phase measures 24 opt-in metrics pairs.
Both retain three serial ABBA blocks, six runs per side, ten warmup samples and
25 measured samples of 100 repetitions. Builds finish before timing begins.

Absolute median changes of at least 10% and observed run-median ranges of at least
10% produce separate review lists. The qualification archive includes every raw
sample, all four flag lists and their checksum-bound review. The
1.3.1 benchmark review explains the prior flags,
the independent-host study and the release decision. Timing spread is not a
confidence interval and a passing evidence check is not a claim of no regression.
Controlled checkpoint experiments support a latency cost on small rendering
calls. An initial local measured-interpolation case had a +9.34% paired median
change under contention. A separate hosted experiment with the pinned common
harness observed +19.28% for that case, with positive effects in all three blocks;
its identical-source control changed by −4.08%. These observations include
compiler/code-layout effects and are not a universal overhead bound. Retaining
the checkpoint is an explicit correctness tradeoff for the reproduced cancellation
defect. Final flags, distributions and limitations remain
part of the release review.

Four graph records and six larger loop/escaping/partial records remain separate
observations. Sixteen coordinated and eight runnable cancellation scenarios
retain every outcome, including normal completion races. The new output check
improves cancellation observability; it does not impose a hard response bound.
No speedup, zero-overhead, process-memory or cross-engine superiority claim is made.

Final main qualification

All nine release gates passed on main commit
fb81cf4ff01f1bf098ceb5fff65638b1271294e0. Every lane retains the same 194-file
source inventory. The source archive was reproduced byte-for-byte, rebuilt and tested
from a clean extraction, and the matching documentation site deployed after
qualification.

The final comparison retains two common median-change flags, three opt-in metrics
flags, and spread flags in all 26 common and 24 metrics comparisons. The bound review
examines every flagged distribution and three-block effect, alongside all earlier
observations and the independent checkpoint controls.

Ordinary reused interpolation measured +17.03% (21.910 to 25.642 µs); measured reused
interpolation showed +33.43% (22.998 to 30.687 µs). Block effects change sign, and
every common comparison retains a spread flag. The separate control using frozen
sources observed a positive +19.28% effect for the measured checkpoint version; that
finding does not cap the larger main observation. This release accepts the observed
latency costs on small calls for the reproduced cancellation fix and retains every
adverse result.

The metrics phase also flags +12.57% for diagnostic reused interpolation and +13.20%
for loop rendering from source. Its apparent negative custom-filter overhead is
retained without a speedup claim. These observations establish neither zero overhead
nor absence of regressions, and give no universal latency bound.

The qualification archive contains all raw samples, four exact flag lists, tag
provenance and the checksum-bound decision. Runtime qualification covers macOS; Apple
simulator results establish compilation only.

Upgrade and downloads

Select from: "1.3.1" and retain the Liquid product. Existing
1.0–1.3 APIs and package products require no migration. The CLI reports
Swift-Liquid 1.3.1.

The release assets are:

  • Swift-Liquid-source.tar.gz: tracked source verified by a clean rebuild.
  • Liquid.doccarchive.tar.gz: compiled API reference and guides.
  • Swift-Liquid-qualification.tar.gz: source-bound receipts, raw test streams,
    logs, benchmark observations, all review flags and the bound review.
  • SHA256SUMS: SHA-256 checksums for the three archives.

Download the published assets together and run shasum -a 256 -c SHA256SUMS
before extraction. These assets are bound to the qualified main source inventory;
the qualification archive retains the CI receipt, benchmark review and its
supporting observations.

Qualification: candidate fb81cf4ff01f1bf098ceb5fff65638b1271294e0, source tree e49fe0f66f8338393b6f4c67ccdb5838f144f73f, tested as fb81cf4ff01f1bf098ceb5fff65638b1271294e0. Exact-source CI evidence.

Post-publication verification: Fresh public 1.3.1 library and CLI installation.