Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
3fecb55
Initial commit to add default .gitIgnore and .gitAttribute files.
Apr 26, 2013
022af9a
Creation
Apr 26, 2013
c76b947
Doxygen support
Apr 26, 2013
e3daf29
Cleanup
Feb 21, 2019
c7ddb13
Cleanup
Feb 22, 2019
b2d8c76
Cleanup
Feb 23, 2019
81dfd43
Delegate class for callbacks
Feb 27, 2019
9d3875d
StringHash from ETL library
Mar 6, 2019
ffd7c09
Merge pull request #3 from ambroise-leclerc/canvas
Aug 2, 2019
0e859df
Merge remote-tracking branch 'webfront0/master' into webfront.fr
Aug 3, 2019
62a1b5e
Merge pull request #4 from ambroise-leclerc/webfront.fr
Aug 3, 2019
2ec099e
Merge pull request #5 from ambroise-leclerc/NoHttp
Aug 3, 2019
1abeb06
Unit tests structure (#7)
AM-L Apr 19, 2020
2373c61
Sockets (#9)
AM-L Apr 19, 2020
3067222
C++20 rework initial commit
ambroise-leclerc Jan 16, 2022
a8bce8c
HTTP server implementation with web socket spawning
ambroise-leclerc Jan 21, 2022
e1d7848
Websocket (#12)
ambroise-leclerc Jan 23, 2022
93c41cc
Delete LICENSE
ambroise-leclerc Jan 23, 2022
65a0091
Delete Doxyfile
ambroise-leclerc Jan 23, 2022
08158db
Create .travis.yml
ambroise-leclerc Jan 23, 2022
99aad63
Websocket (#13)
ambroise-leclerc Jan 23, 2022
860e7e5
Update README.md
ambroise-leclerc Jan 23, 2022
04cf680
Create cmake.yml (#16)
ambroise-leclerc Jan 23, 2022
88e3e42
Websocket (#23)
ambroise-leclerc Jan 24, 2022
4b4cfbe
Update README.md
ambroise-leclerc Jan 24, 2022
3fbdc03
Update CMakeLists.txt
ambroise-leclerc Jan 24, 2022
2d8cd17
Websocket (#24)
ambroise-leclerc Jan 26, 2022
f9bb172
Websocket (#25)
ambroise-leclerc Jan 27, 2022
f174ac0
Websocket (#26)
ambroise-leclerc Jan 29, 2022
7519624
WebSocket log sing, C++20Support.hpp, C++23Support.hpp
ambroise-leclerc Jan 31, 2022
4229c4b
UI::addScript (#30)
ambroise-leclerc Feb 3, 2022
4fd263e
Js function (#32)
ambroise-leclerc Feb 6, 2022
cb00069
Update README.md
ambroise-leclerc Feb 6, 2022
7c6554e
Update README.md
ambroise-leclerc Feb 6, 2022
05d0a72
CppFunctions (#33)
ambroise-leclerc Feb 13, 2022
e3adebc
Cpp function (#34)
ambroise-leclerc Feb 13, 2022
b5f5ad6
Big strings and number support for cppFunction
ambroise-leclerc Feb 15, 2022
d88b55d
Tuples encoding and decoding for parameters passing and function return
ambroise-leclerc Feb 22, 2022
a9b61e0
Update README.md (#42)
ambroise-leclerc Feb 24, 2022
e75f1c1
Update README.md
ambroise-leclerc Jun 23, 2022
5146bcf
Update BuildWindows.yml
ambroise-leclerc Jun 26, 2022
15c6fbd
Consteval format (#46)
ambroise-leclerc Jul 2, 2022
e1c2b5c
C++23 compilers, feature test macros and support for network mocks (#48)
ambroise-leclerc Feb 12, 2023
39791d5
Doctest (#50)
ambroise-leclerc Feb 16, 2023
75a4b85
Coverage (#51)
ambroise-leclerc Feb 16, 2023
bbc7477
Update README.md
ambroise-leclerc Feb 16, 2023
dd463b4
Filesystem support with IndexFS as first implementation
ambroise-leclerc Mar 16, 2023
b1384c3
Multiple http-request header values support
ambroise-leclerc Mar 21, 2023
3133e68
Support for Encoded file ressources, and identification of these enco…
ambroise-leclerc Mar 22, 2023
314bf17
Rename headerContains() to headersContain() (#58)
ambroise-leclerc Mar 22, 2023
55be95f
Update README.md
ambroise-leclerc Mar 22, 2023
2120bd0
Update README.md
ambroise-leclerc Mar 22, 2023
92d6c77
Update README.md
ambroise-leclerc Mar 22, 2023
a184be2
Update README.md
ambroise-leclerc Mar 22, 2023
9b26ee6
URI decoding of faulty %encoded chars (#60)
ambroise-leclerc Mar 23, 2023
0fe0f3e
Files reorganization for Codescene's codehealth score improvement (#62)
ambroise-leclerc Mar 24, 2023
d03b343
Update README.md
ambroise-leclerc Mar 24, 2023
f4a6f64
Missing mime types (#64)
ambroise-leclerc Mar 26, 2023
8321bfc
Removal of unused webfront and libgenerator directories (#66)
ambroise-leclerc Mar 26, 2023
62ce717
Rewrite RequestParser as a free function (#69)
ambroise-leclerc Mar 28, 2023
11a49fb
70 request parsing is no longer asynchronous (#71)
ambroise-leclerc Mar 29, 2023
3c4e9a6
72 ctad everything (#73)
ambroise-leclerc Apr 4, 2023
c551643
75 remove 3rdparty directory and use cpm instead (#76)
ambroise-leclerc Apr 11, 2023
93cdb8e
Use v1.12.0 of networking-ts-impl (#80)
ambroise-leclerc Apr 15, 2023
1f8a8c3
[[nodiscard]] attributes on adequate functions (#78)
ambroise-leclerc Apr 16, 2023
ba77fb0
Update issue templates
ambroise-leclerc Apr 17, 2023
0b1858b
Update issue templates
ambroise-leclerc Apr 17, 2023
6d433bb
Update README.md
ambroise-leclerc Apr 17, 2023
7a46391
erroneous gzip content-encoding was added when the requested file was…
ambroise-leclerc Apr 26, 2023
ab1c0bf
cpp encoding of jasmine resources with bin2cpp v010 (#87)
ambroise-leclerc Apr 27, 2023
8954c22
89 create a filesystem adapter to combine multiple filesystems (#91)
ambroise-leclerc May 1, 2023
d14c116
Sec Key hashing handled in websocket (#92)
ambroise-leclerc May 2, 2023
8be2994
94 add networking ts in webfront library (#95)
ambroise-leclerc May 4, 2023
56c647d
96 nativedebugfs (#98)
ambroise-leclerc May 7, 2023
8e5416b
99 rename webfrontfilesystem namespace (#100)
ambroise-leclerc May 8, 2023
318e890
101 fs::File should handle std:ifstream (#102)
ambroise-leclerc May 8, 2023
6af18a8
fs::Provider is no longer static (#104)
ambroise-leclerc May 9, 2023
58e69f5
88 create a test application for jasmine (#106)
ambroise-leclerc May 12, 2023
ff621eb
105 add an uri decoder (#108)
ambroise-leclerc May 13, 2023
0958dd3
107 uri decoder needs more tests and can be streamlined (#109)
ambroise-leclerc May 14, 2023
0f58efe
Remove unnamed namespaces from headers files
ambroise-leclerc May 15, 2023
7f320e9
CMake reads version string in WebFront.hpp (#112)
ambroise-leclerc May 17, 2023
7a03103
First (failing) Jasmine TDD test with getVersion function (#113)
ambroise-leclerc May 18, 2023
309ea8b
Minimal React UI test (#128)
ambroise-leclerc Jun 7, 2023
683a57c
ReactFS filesystem for React 18 (#129)
ambroise-leclerc Jun 9, 2023
450d03c
BabelFS filesystem with Babel/Standalone 7.22.5
ambroise-leclerc Jun 11, 2023
ae7c115
138 try sonarcube opensource integration (#139)
ambroise-leclerc Aug 12, 2023
d9db881
Add CMAKE_MODULE_PATH (#142)
ambroise-leclerc Sep 21, 2023
0aae535
Catch2 with C++23 compilation (#146)
ambroise-leclerc Oct 15, 2023
54943f5
Fully qualified move and forward. New version of networking TS withou…
ambroise-leclerc Oct 19, 2023
164dfd9
Unique names for CMake libraries (#151)
ambroise-leclerc Oct 30, 2023
a9c2e0e
Implement a matrix strategy in CI (#152)
ambroise-leclerc Nov 7, 2023
3abd4e6
Update Code coverage and static analysis.yml (#153)
ambroise-leclerc Nov 8, 2023
adb5c07
154 code coverage ci workflow isnt executed (#156)
ambroise-leclerc Nov 9, 2023
291a959
Add warnings to detected dangling references (#159)
ambroise-leclerc Apr 14, 2024
cb9fb9a
Don't forward arguments to make_format_args (#161)
frederic-tingaud-sonarsource Nov 7, 2024
7404728
#164 URI constructed in place from percent encoded string (#165)
ambroise-leclerc Dec 19, 2024
35fb692
Add static code analysis option for msvc (#167)
ambroise-leclerc Apr 16, 2025
8a94f60
168 build badges arent valid anymore (#169)
ambroise-leclerc Apr 16, 2025
8ba9b99
Update BuildAndTest.yml
ambroise-leclerc Apr 16, 2025
249b89d
Update BuildAndTest.yml
ambroise-leclerc Apr 16, 2025
a209255
Update BuildAndTest.yml
ambroise-leclerc Apr 17, 2025
f1199c0
Update BuildAndTest.yml
ambroise-leclerc Apr 17, 2025
0981688
Update BuildAndTest.yml
ambroise-leclerc Apr 17, 2025
4fb8091
Update BuildAndTest.yml
ambroise-leclerc Apr 17, 2025
ec30f56
Update BuildAndTest.yml
ambroise-leclerc Apr 17, 2025
b1947c4
Update BuildAndTest.yml
ambroise-leclerc Apr 17, 2025
7b78e9a
Update BuildAndTest.yml
ambroise-leclerc Apr 17, 2025
fd7f5c3
remove
ambroise-leclerc Apr 17, 2025
52e989b
id
ambroise-leclerc Apr 17, 2025
92df588
build
ambroise-leclerc Apr 17, 2025
23437a2
unified build action
ambroise-leclerc Apr 17, 2025
b97851f
unified build action
ambroise-leclerc Apr 17, 2025
a6468dc
Clang 17
ambroise-leclerc Apr 17, 2025
550a41c
Merge pull request #171 from ambroise-leclerc/170-remove-sonarcloud-s…
AM-L Apr 17, 2025
7575ad9
Correct version number extraction & CPM version upgrade (#172)
ambroise-leclerc Apr 18, 2025
1936672
173 add an arm runner (#174)
ambroise-leclerc Apr 23, 2025
666d00f
Comment now corresponds to the class (#176)
ambroise-leclerc May 23, 2025
75ddbf4
Rename function print to displayTest in order to no longer open a pri…
ambroise-leclerc May 25, 2025
aeb3032
Fix CEF crashes on macOS and Linux due to CEF resources deployment fa…
ambroise-leclerc Aug 16, 2025
8876a8e
Extract duplicated findDocRoot function into shared utility (#188)
ambroise-leclerc Aug 16, 2025
6546274
Reconcile release history with the validated develop snapshot [#253]
ambroise-leclerc Oct 19, 2026
67f50a7
Release WebFront 0.2.0 [#253] (#279)
ambroise-leclerc Oct 19, 2026
314de62
Merge pull request #296 from ambroise-leclerc/develop
ambroise-leclerc Oct 21, 2026
51df045
Merge pull request #301 from ambroise-leclerc/develop
AM-L Oct 21, 2026
c241e7a
Buffer gzip reads and accelerate short Huffman codes [#282]
ambroise-leclerc Oct 25, 2026
96aaa6a
Prepare WebFront 0.5.0 [#282]
ambroise-leclerc Oct 25, 2026
7158ca2
Synchronize release branch with master
ambroise-leclerc Oct 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-23 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-23 libclang-rt-23-dev libc++-23-dev libc++abi-23-dev
sudo apt-get install -y clang-23 libclang-rt-23-dev libc++-23-dev libc++abi-23-dev zlib1g-dev
- name: Restrict address-space randomization for ThreadSanitizer
if: matrix.sanitizer == 'thread'
run: sudo sysctl vm.mmap_rnd_bits=28
Expand All @@ -191,13 +191,19 @@ jobs:
run: >-
cmake -S . -B build-sanitizers -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_BUILD_EXAMPLES=OFF -DENABLE_TESTING=ON -DENABLE_CACHE=OFF
${{ matrix.sanitizer == 'thread' && '-DCMAKE_CXX_FLAGS=-stdlib=libc++ -DENABLE_SANITIZER_THREAD=ON' || '-DENABLE_SANITIZER_ADDRESS=ON -DENABLE_SANITIZER_UNDEFINED_BEHAVIOR=ON -DENABLE_FUZZING=ON' }}
${{ matrix.sanitizer == 'thread' && '-DCMAKE_CXX_FLAGS=-stdlib=libc++ -DENABLE_SANITIZER_THREAD=ON' || '-DENABLE_SANITIZER_ADDRESS=ON -DENABLE_SANITIZER_UNDEFINED_BEHAVIOR=ON -DENABLE_FUZZING=ON -DWEBFRONT_GZIP_DIFFERENTIAL=ON' }}
- name: Build
run: cmake --build build-sanitizers --parallel 2
- name: Run full CEF-off suite
run: >-
ctest --test-dir build-sanitizers --output-on-failure --no-tests=error --parallel 4
--output-junit "${{ github.workspace }}/build-sanitizers/test-results.xml"
- name: Compare generated gzip streams against zlib
timeout-minutes: 5
if: matrix.sanitizer == 'address-undefined'
run: |
python3 test/fuzz/GenerateGzipCorpus.py build-sanitizers/gzip-corpus
build-sanitizers/test/unit/gzip_differential build-sanitizers/gzip-corpus
- name: Retain test timings and diagnostics
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -218,6 +224,9 @@ jobs:
-max_total_time=30 -timeout=5 -max_len=65536 -rss_limit_mb=1024 \
-artifact_prefix=build-sanitizers/test/fuzz/artifacts/$decoder-
done
build-sanitizers/test/fuzz/fuzz_gzip_differential build-sanitizers/test/fuzz/corpus/gzip \
-max_total_time=30 -timeout=5 -max_len=65536 -rss_limit_mb=1024 \
-artifact_prefix=build-sanitizers/test/fuzz/artifacts/gzip-differential-
- name: Upload fuzz findings
if: failure() && matrix.sanitizer == 'address-undefined'
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option(ENABLE_TESTING "Enable Test Builds" OFF)
option(WEBFRONT_BUILD_EXAMPLES "Build the example applications" ${WEBFRONT_IS_TOP_LEVEL})
option(ENABLE_COVERAGE "Enable test coverage instrumentation" OFF)
option(ENABLE_FUZZING "Enable Fuzzing Builds" OFF)
option(WEBFRONT_GZIP_DIFFERENTIAL "Build test-only gzip/zlib differential checks" OFF)
option(WEBFRONT_USE_MDDLOG "Use the compiled mddlog diagnostic adapter" OFF)
# The experimental gate must be selected before project() probes the compiler.
if(WEBFRONT_USE_MDDLOG)
Expand Down
7 changes: 7 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## 0.5.0 - 2026-10-26

- Gzip identity fallback reuses a bounded validated-representation cache for GET and HEAD (#281).
Cold decoding uses buffered bit reads and a small Huffman lookup (#282), with unchanged
allocation behavior, strict stream validation and output budgets. Release benchmarks and
test-only zlib differential/sanitizer validation are recorded in `docs/GZIP_DECODER_MEASUREMENTS.md`.

- `WebFrontLifeDeveloper` starts without argument on `./life-project` (created when missing, reused untouched otherwise) and the
pinned environment; the explicit `<project> [<environment-url> <sha512-integrity>]` form remains. At configuration, the
native window engine of the platform is enabled automatically when its dependencies are found (top-level builds with examples,
Expand Down
151 changes: 151 additions & 0 deletions docs/GZIP_DECODER_MEASUREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Gzip decoder measurements (#282)

Measured on macOS 27.0.1, Apple M2 arm64, Homebrew Clang 21.1.8/libc++, Release
(`-std=c++23 -O3 -DNDEBUG`), 2026-10-25. Both versions use libc++ extensive hardening
and `-ftrivial-auto-var-init=pattern`. Timings are informational; no CI timing threshold.

The baseline is `Gzip.hpp` at `d27e4fc`, after the cache (#281) and bounded worker (#283).
The same `GzipDecoderBenchmark.cpp` runs against both headers. It measures decoding,
CRC/header/trailer validation and byte-for-byte output verification, excluding provider reads,
HTTP, cache lookup, scheduling and network I/O. Every iteration decodes a cold representation.
`fresh` destroys the output string each iteration; `reserved` reserves the exact decoded size
before timing, representing the worker's preallocated output. The actual worker reserves its
configured limit. The benchmark does not simulate worker admission or response copying.

The [cache measurements](GZIP_CACHE_MEASUREMENTS.md) show that cache hits remove repeat decoding;
this change reduces the remaining cold CPU work. Warm cache hits and gzip pass-through do not
invoke the decoder and receive no algorithmic benefit. The worker still runs one active decode,
with the same output, admission and shutdown contracts.

## Corpus and results

`GenerateGzipCorpus.py` uses Python 3.14.7/zlib 1.2.12, seed 282, gzip level 6 unless
specified. Compressed hashes depend on the Python zlib version; CI regenerates its own
corpus and does not require byte-identical compression across versions. The core bridge/bootstrap
sources are compressed **test inputs**; their production representations remain identity. The application is the generated developer compiler bundle
(78,508 decoded bytes, SHA-256 `5f36728943433f1b88eadcdc0db910133257b4502c8faec3357168b6739f70bc`).
No removed core provider is restored. Near-budget cases decode to 4,194,303 bytes, one byte
below the default limit: stored uses level 0 and deterministic random bytes; fixed/dynamic
use repeating JavaScript text; Huffman-only uses a deterministic sixteen-symbol alphabet;
incompressible uses random bytes and zlib's default strategy (predominantly stored blocks).
Some near-budget inputs exceed the server's separate 4 MiB compressed-input cap; these are
codec benchmarks, not claims that the default server admits those representations.

Median of three runs, alternating order. Throughput uses preallocated output; fresh-output
times and allocation totals are shown separately. Allocation totals match the baseline.

| Asset | gzip / decoded bytes | Reserved µs before / after | MiB/s before / after | Fresh µs before / after | Fresh allocations / bytes |
| --- | ---: | ---: | ---: | ---: | ---: |
| fixed | 499 / 23768 | 86.48 / 87.28 | 262.1 / 259.7 | 93.65 / 94.78 | 9 / 73,488 |
| dynamic | 453 / 23768 | 93.14 / 87.52 | 243.4 / 259.0 | 100.26 / 90.93 | 9 / 73,488 |
| optional | 476 / 23768 | 92.25 / 89.59 | 245.7 / 253.0 | 89.34 / 91.54 | 9 / 73,488 |
| bridge | 5739 / 25527 | 207.21 / 170.62 | 117.5 / 142.7 | 226.52 / 159.51 | 11 / 98,256 |
| bootstrap | 2824 / 6534 | 78.32 / 48.77 | 79.6 / 127.8 | 73.57 / 58.28 | 9 / 24,528 |
| application | 22974 / 78508 | 827.14 / 568.52 | 90.5 / 131.7 | 809.29 / 587.63 | 12 / 196,560 |
| near-stored | 4194651 / 4194303 | 12525.22 / 11135.83 | 319.4 / 359.2 | 12826.86 / 11119.19 | 7 / 8,323,072 |
| near-fixed | 36667 / 4194303 | 16501.30 / 14886.27 | 242.4 / 268.7 | 17698.25 / 14966.84 | 17 / 11,009,856 |
| near-dynamic | 14330 / 4194303 | 14807.34 / 15056.99 | 270.1 / 265.7 | 17463.25 / 14797.25 | 17 / 11,009,856 |
| near-incompressible | 4195601 / 4194303 | 11036.32 / 11085.55 | 362.4 / 360.8 | 11213.95 / 11048.08 | 9 / 8,378,352 |
| near-huffman | 2132022 / 4194303 | 48956.38 / 30807.26 | 81.7 / 129.8 | 47336.47 / 31237.99 | 18 / 12,582,864 |

The application improves by about 31% and the Huffman-only case by 37% in these runs.
Small fixed decoding is within 1%; near-budget dynamic decoding is about 2% slower.
Stored-block copying and CRC are unchanged, so their variable timing is not evidence of a
new bulk-copy optimization. These observations support the small lookup for application
code and literal-heavy inputs, without claiming universal improvement.

Allocation counts and bytes are **identical before and after**. They count scalar `operator new`
requests during the loop, including string growth, rather than allocator bookkeeping or peak RSS.
Input, reference output and pre-reservation allocations are excluded. The decoder has no aligned
or array allocation path. Every `reserved` case makes **zero allocations** during decoding.
The fresh case reports cumulative allocated bytes, not simultaneously live or retained memory.

## Algorithm choice

A byte-bounded 64-bit reservoir replaces per-bit input indexing. It holds at most 39 bits for
reads of up to 32 bits, checks each byte before fetching it and tracks logical offsets separately
from prefetched bytes. Alignment discards only the fractional byte; bulk reads return complete
prefetched bytes to the input view. This preserves header CRC ranges, stored blocks, member
trailers, concatenation and strict trailing-byte rejection without reading past the supplied span.

A buffered-reader-only prototype gave a modest gain on the compiler bundle. The 128-entry
Huffman prototype reduced its fresh decode from approximately 743 to 613 µs; 256 entries reduced
it to approximately 534 µs in the exploratory run. The 256-entry table is retained: each tree
adds 512 stack bytes and no heap allocations. Codes longer than eight bits and short final input
use the validated canonical decoder. No large secondary tables or new tree acceptance rules are
introduced. Repeating-match and stored workloads remain dominated by copying and CRC validation.

## Reproduction

Configure the ordinary CEF-off Release build, then build the optional benchmark (not in CTest):

```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=OFF -DENABLE_TESTING=ON
cmake --build build --target gzip_decoder_benchmark --parallel 2
python3 test/fuzz/GenerateGzipCorpus.py build/gzip-corpus path/to/build-distribution/compiler.mjs
build/test/unit/gzip_decoder_benchmark build/gzip-corpus/*.gz
```

The corpus directory must not already exist. Omit the optional bundle argument to use only
repository sources and generated neutral fixtures. The generator prints compressed/decoded
sizes and SHA-256 checksums. The benchmark also always runs the three small checked-in fixtures.
CSV reports time, decoded MiB/s, allocations and requested bytes per decode, for both output modes;
2,000 iterations per small input and 40 per input above 1 MiB. No timing assertion runs in CI.

For an exact historical comparison, copy only the two standalone headers into a build directory
and compile the same harness with that directory first in the include path:

```bash
mkdir -p build/gzip-baseline/webfront/http
git show d27e4fc:include/webfront/http/Gzip.hpp > build/gzip-baseline/webfront/http/Gzip.hpp
git show d27e4fc:include/webfront/http/BuffersPolicy.hpp > build/gzip-baseline/webfront/http/BuffersPolicy.hpp
clang++ -std=c++23 -O3 -DNDEBUG -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE \
-ftrivial-auto-var-init=pattern -Ibuild/gzip-baseline -Itest/unit \
test/unit/GzipDecoderBenchmark.cpp -o build/gzip-before
clang++ -std=c++23 -O3 -DNDEBUG -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE \
-ftrivial-auto-var-init=pattern -Iinclude test/unit/GzipDecoderBenchmark.cpp -o build/gzip-after
build/gzip-before build/gzip-corpus/*.gz
build/gzip-after build/gzip-corpus/*.gz
```

Use the same compiler for both; adapt the standard-library hardening macro on other platforms.
Repeat three times, alternating before/after order. Desktop background activity makes these
local observations noisy; compare the corpus as a whole rather than treating a small timing
difference as a guaranteed gain.

## Differential and sanitizer validation

`WEBFRONT_GZIP_DIFFERENTIAL=ON` opts into test-only zlib linkage. Production remains header-only
and does not depend on zlib. `GzipZlibDifferential` checks the neutral fixtures in ordinary CTest;
`gzip_differential <corpus-directory>` also compares generated stored/fixed/dynamic/Huffman-only,
flush boundaries and size-boundary cases, exact budgets, sampled truncations/mutations, optional
headers, concatenation, CRC and trailing bytes. Comparisons require matching acceptance and
byte-for-byte content. The oracle explicitly loops over members and requires full consumption.

Intentional differences from permissive gzip consumers: WebFront rejects all trailing padding,
including zeros, and dynamic declarations of 31/32 distance symbols. The zlib oracle normalizes
strict consumption; arbitrary-input differential fuzzing compares every WebFront-accepted stream
with zlib, while the generated supported corpus checks acceptance in both directions. Reserved
or otherwise unsupported declarations are covered by WebFront's malformed-input unit fixtures.

```bash
cmake -S . -B build -DWEBFRONT_GZIP_DIFFERENTIAL=ON
cmake --build build --target gzip_differential --parallel 2
build/test/unit/gzip_differential build/gzip-corpus
ctest --test-dir build --output-on-failure --parallel 4
```

For Clang/compiler-rt sanitizer fuzzing, configure with `ENABLE_FUZZING=ON` and
`WEBFRONT_GZIP_DIFFERENTIAL=ON`. See [fuzzing](../test/fuzz/README.md) for commands.
The extended CI ASan/UBSan job runs the generated corpus and both gzip fuzzers; CodeScene
quality gates remain unchanged. The generated-corpus comparison step has a five-minute timeout.

On this macOS host, Homebrew's ASan runtime stalled in its allocator initialization before main.
Validation instead used Apple Clang 21.0.0's ASan/UBSan runtime; libFuzzer came from Homebrew LLVM
21.1.8 because Apple does not ship its archive. Both fuzzers ran for 30 seconds with a 1 MiB output
cap, 65,536-byte maximum mutation size and a five-second per-input timeout. Standalone differential
validation used the 4 MiB output limit with the complete generated corpus.

Local validation: 293 CEF-off CTest cases passed; 12,571 generated/fixture comparisons passed
under ASan/UBSan; bounded fuzzing completed 53,370 runs and differential fuzzing 44,065 runs
without a finding. The 264 bit-width/alignment combinations are covered by the unit tests.
10 changes: 7 additions & 3 deletions docs/HTTP_ASSETS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ the decoded output budget is read for every fallback request. Zero retention dis
caching, including HEAD metadata. Policies without this member inherit 8 MiB.
For the synchronous API, `RequestHandler::fallbackCacheStatistics()` exposes decode attempts, hits (including budget-rejected hits), entries and accounted retained bytes; read it
on the server context. The LRU lookup compares compressed bytes linearly across retained
entries; gzip pass-through remains independent of this cost. Decoder throughput and buffered
bit reads remain [#282](https://github.com/ambroise-leclerc/WebFront/issues/282).
entries; gzip pass-through remains independent of this cost. Cold decoding uses bounded buffered
bit reads and a 256-entry short-code Huffman lookup, with the canonical decoder for longer codes.
See [decoder measurements and differential validation](GZIP_DECODER_MEASUREMENTS.md) for the
Release comparison, allocation accounting and test-only zlib tools. Validation, budgets and
strict member/trailer boundaries are unchanged.

See [gzip cache measurements](GZIP_CACHE_MEASUREMENTS.md) for cold/repeated GET and HEAD data
and the optional benchmark target.
Expand Down Expand Up @@ -142,7 +145,8 @@ never closes a socket from its thread. An active non-interruptible decode can de
queued jobs are stopped without decoding. `fallbackDecodeStatistics()` exposes atomic counters
for jobs, response leases, charged bytes, decode attempts and whether a worker has been created.
`Server::fallbackCacheStatistics()` combines I/O-context cache counters with worker decode attempts;
read cache statistics on the I/O context. Decoder throughput remains #282.
read cache statistics on the I/O context. Buffered decoding reduces cold CPU work; see
[decoder measurements](GZIP_DECODER_MEASUREMENTS.md).

## Fallback budget

Expand Down
19 changes: 17 additions & 2 deletions docs/PROJECT_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ be checked on the corrected head before merging. See the



## Release 0.5.0 (2026-10-26)

`webfront::version` and the CMake project version are 0.5.0. This version integrates the
manifest-driven, self-building developer environment, the reduced identity-only embedded core,
and bounded cached/worker gzip fallback with buffered decoding. Includes move to
`<webfront/...>`; removed terminal/tool-manager APIs migrate to the developer terminal and
`webfront::Commands`. See `docs/CHANGELOG.md` and `docs/UI_COMPONENTS.md` for migration details.
The published developer environment pin is 0.6.2; environment sources at 0.6.3 are not yet
published. Library APIs and packaging remain experimental.

## Release 0.4.0 (#200, 2026-10-21)

`webfront::version` and the CMake project version are 0.4.0. The release presents the repository
Expand Down Expand Up @@ -521,8 +531,13 @@ The minimum demonstration milestone is deliberately narrower than the long-term
across keys and decoded storage. Each hit rechecks the active output budget; oversized
entries are served without retention. Cold fallback runs on a lazy, owned CPU worker (#283),
with bounded jobs, consumer slots and buffer reservations; results return to the I/O context.
Job, consumer and buffer saturation returns 503; the compressed-input cap (4 MiB by default) returns 500 before cache lookup. Active decoding finishes before shutdown joins; decoder throughput remains #282. See [HTTP asset encoding](HTTP_ASSETS.md)
for negotiation rules, errors, strict stream validation and budget configuration.
Job, consumer and buffer saturation returns 503; the compressed-input cap (4 MiB by default)
returns 500 before cache lookup. Active decoding finishes before shutdown joins. Bounded
buffered bit reads and a 256-entry
short-code Huffman table reduce cold decoding work (#282); allocation counts are unchanged.
See [Release decoder measurements and zlib differential validation](GZIP_DECODER_MEASUREMENTS.md)
and [HTTP asset encoding](HTTP_ASSETS.md) for negotiation rules, errors, strict stream validation
and budget configuration.
Regression tests and gzip/HTTP fuzzers cover decoding and encoding preferences.
Verified 2026-10-25 on Linux for #281: 275 CEF-off CTest cases and all 64 CEF/Xvfb
web-integration cases passed; cold/repeated GET/HEAD measurements are recorded in
Expand Down
2 changes: 1 addition & 1 deletion include/webfront/WebFront.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

namespace webfront {

inline constexpr std::string_view version = "0.4.0";
inline constexpr std::string_view version = "0.5.0";

using NetProvider = networking::TCPStdnet;
using ConnectionError = std::runtime_error;
Expand Down
Loading
Loading