Compare commits

..
4 Commits
Author SHA1 Message Date
andrew dfa7451c16 ci: download mc from weaselab mirror
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (push) Successful in 1m7s
CI / pre-commit (push) Successful in 1m21s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (push) Successful in 1m1s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (push) Successful in 1m48s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (push) Successful in 1m40s
2026-11-04 13:35:06 -05:00
andrew 426b2641ff Merge pull request 'parser3: keep the stackSize needed by a document independent of chunking (reserve transient token slots)' (#72) from weaselbot/weaseljson:weaselbot/issue-71 into main
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (push) Failing after 57s
CI / pre-commit (push) Successful in 59s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (push) Successful in 55s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (push) Failing after 1m46s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (push) Successful in 1m46s
Reviewed-on: #72
2026-10-30 13:05:50 +00:00
weaselbot bce971fbd2 ci: don't hardcode ~/.local/bin when running pre-commit
CI / pre-commit (pull_request) Successful in 54s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (pull_request) Successful in 59s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (pull_request) Successful in 52s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (pull_request) Successful in 1m44s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (pull_request) Successful in 1m50s
The pre-commit job failed with

    /root/.local/bin/pre-commit: No such file or directory

even though `pipx install pre-commit` succeeded: `pipx install` writes the
app to PIPX_BIN_DIR, and the runner image no longer uses ~/.local/bin for
it. Run the binary from PATH when pipx put it there, and fall back to
`pipx run pre-commit` otherwise, so the hook still runs regardless of
where pipx exposes its apps.
2026-10-27 18:53:07 -04:00
weaselbot 507be6f0a2 Address review: keep the transient-token reserve out of the public header
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (pull_request) Successful in 1m12s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (pull_request) Successful in 53s
CI / pre-commit (pull_request) Failing after 47s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (pull_request) Successful in 1m44s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (pull_request) Successful in 1m42s
The create() documentation described how the reserve is implemented (six
extra slots for literals and \uXXXX escapes that straddle a chunk
boundary). That is an implementation detail; the header should only
promise the behaviour callers can rely on, i.e. that the accept/reject/
overflow decision depends on the document's bytes and on stackSize, not
on how they are split across parse() calls. The derivation of the upper
bound lives next to kTransientSymbols in src/parser3.h, where it can be
kept in sync with the pushes.

Also make the chunking test cover every split point, not just fixed
strides: each document is split in two at every possible offset, so every
literal, escape and surrogate pair in the fixture straddles a chunk
boundary. Verified that this fails on the pre-fix parser ("true",
stackSize 3, cut 1: whole buffer accepts, two chunks overflow).
2026-10-27 17:31:49 -04:00
2 changed files with 14 additions and 6 deletions

No files matched your search

+10 -2
View File
@@ -12,7 +12,15 @@ jobs:
run: pipx install pre-commit run: pipx install pre-commit
- name: Run pre-commit - name: Run pre-commit
run: ~/.local/bin/pre-commit run --all-files --show-diff-on-failure # `pipx install` writes the app to PIPX_BIN_DIR, which is not
# necessarily ~/.local/bin and not necessarily on PATH, so don't
# hardcode a path that only some runner images happen to use.
run: |
if command -v pre-commit >/dev/null 2>&1; then
pre-commit run --all-files --show-diff-on-failure
else
pipx run pre-commit run --all-files --show-diff-on-failure
fi
build: build:
strategy: strategy:
@@ -76,7 +84,7 @@ jobs:
echo "MinIO credentials not configured; skipping upload" echo "MinIO credentials not configured; skipping upload"
exit 0 exit 0
fi fi
curl -Ls "https://dl.min.io/client/mc/release/linux-$(dpkg --print-architecture)/mc" \ curl -fLs "https://minio.weaselab.dev/public/$(uname -m)/mc.RELEASE.2025-08-13T08-35-41Z" \
-o /tmp/mc && chmod +x /tmp/mc -o /tmp/mc && chmod +x /tmp/mc
dest="minio/jenkins/weaseljson/${{ gitea.run_number }}/${{ matrix.name }}/" dest="minio/jenkins/weaseljson/${{ gitea.run_number }}/${{ matrix.name }}/"
/tmp/mc cp build/*.deb "$dest" /tmp/mc cp build/*.deb "$dest"
+4 -4
View File
@@ -167,10 +167,10 @@ struct Parser3 {
} }
// Push tokenizer progress symbols for a literal or escape that straddles a // Push tokenizer progress symbols for a literal or escape that straddles a
// chunk boundary. These go in the reserve past `stackEnd`, so they don't // chunk boundary. Unlike push(), these may grow past `stackEnd` into the
// spend the caller's nesting budget and can't make the parser overflow on // reserve, so they don't spend the caller's nesting budget and can never make
// input it would have accepted in one piece. See kTransientSymbols for why // the parser overflow on input it would have accepted in one piece. See
// the reserve is big enough to always succeed. // kTransientSymbols for why the reserve is big enough to always succeed.
[[nodiscard]] WeaselJsonStatus [[nodiscard]] WeaselJsonStatus
pushTransient(std::initializer_list<Symbol> symbols) { pushTransient(std::initializer_list<Symbol> symbols) {
assert(ptrdiff_t(symbols.size()) <= kTransientSymbols); assert(ptrdiff_t(symbols.size()) <= kTransientSymbols);