Commit Graph

1161 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
826b71cc24 Remove accidentally committed tmp.glb
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/syoyo/tinygltf/sessions/74f01d98-ca42-4950-984e-458d4e3eeccd
2026-03-21 20:39:39 +00:00
copilot-swe-agent[bot]
dfd94f03fb Fix cj_dbl_to_i64 comment to accurately describe clamping behavior
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/syoyo/tinygltf/sessions/74f01d98-ca42-4950-984e-458d4e3eeccd
2026-03-21 20:39:31 +00:00
copilot-swe-agent[bot]
131c4489fa Initial plan 2026-03-21 20:37:03 +00:00
Syoyo Fujita
594c3a057b Merge pull request #540 from syoyo/copilot/sub-pr-537-another-one
Fix float32_mode mis-classifying long integer tokens as floats
2026-03-21 07:04:36 +09:00
Syoyo Fujita
ad316367b9 Merge pull request #541 from syoyo/copilot/sub-pr-537-yet-again
Fix `tg3__arena_strdup` conflating empty strings with absent strings
2026-03-21 07:04:10 +09:00
Syoyo Fujita
1f15c2d140 Merge pull request #538 from syoyo/copilot/sub-pr-537
Fix tg3_writer allocation: replace calloc/free with new/delete
2026-03-21 06:38:06 +09:00
Syoyo Fujita
1d5e721a24 Merge pull request #542 from syoyo/copilot/sub-pr-537-one-more-time
Guard TINYGLTF3_IMPLEMENTATION against C translation units
2026-03-21 06:37:42 +09:00
copilot-swe-agent[bot]
c9a9b1175a Fix float32_mode integer parsing: preserve int64 precision for integer-only tokens
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/syoyo/tinygltf/sessions/a77fd614-00f3-49c1-bb4a-0498771cc63b
2026-03-20 21:24:37 +00:00
copilot-swe-agent[bot]
5e0c5b9ada Fix tg3__arena_strdup to distinguish empty strings from absent strings
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/syoyo/tinygltf/sessions/445ab61b-4294-45e6-8faf-4f2fc8dfe369
2026-03-20 21:21:35 +00:00
copilot-swe-agent[bot]
03b9db782e Add C++ compilation guard for TINYGLTF3_IMPLEMENTATION
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/syoyo/tinygltf/sessions/9d34bfe8-6b91-44f8-aedc-adb3bfeadf84
2026-03-20 21:21:26 +00:00
Syoyo Fujita
c99e713fab Merge pull request #539 from syoyo/copilot/sub-pr-537-again
Use `__VA_OPT__` for variadic comma elision in C++20, `##__VA_ARGS__` fallback for C++17
2026-03-21 06:19:35 +09:00
copilot-swe-agent[bot]
8c8cbfa0ba Initial plan 2026-03-20 21:15:51 +00:00
copilot-swe-agent[bot]
0949983acc Initial plan 2026-03-20 21:15:45 +00:00
copilot-swe-agent[bot]
c870bd5fd6 Initial plan 2026-03-20 21:15:36 +00:00
copilot-swe-agent[bot]
b76cf7aa21 Replace ##__VA_ARGS__ with portable TG3__COMMA_VA_ARGS helper (C++17/C++20)
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/syoyo/tinygltf/sessions/a7105342-8673-4241-b727-29026461cc67
2026-03-20 20:42:17 +00:00
copilot-swe-agent[bot]
946c5a2d9b Fix tg3_writer allocation: use new/delete instead of calloc/free
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/syoyo/tinygltf/sessions/c2a9ce6c-1c60-4925-b67b-e5ad2ffe1cd2
2026-03-20 20:39:43 +00:00
Syoyo Fujita
f7bd377a69 Update tiny_gltf_v3.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-21 05:36:13 +09:00
Syoyo Fujita
5d6984b9fd Update tiny_gltf_v3.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-21 05:35:53 +09:00
Syoyo Fujita
3331c6cee2 Update tinygltf_json.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-21 05:35:34 +09:00
copilot-swe-agent[bot]
97316e140c Initial plan 2026-03-20 20:35:31 +00:00
copilot-swe-agent[bot]
0e370ef62f Initial plan 2026-03-20 20:34:21 +00:00
Syoyo Fujita
2c7bf2c932 Fix fuzzer-found bugs, add libFuzzer harness for v3
Add tests/v3/fuzzer/ with libFuzzer harness covering all four parse
paths (auto-detect, JSON, GLB, float32 mode) with ASan+UBSan.

Fix two bugs found by 10+ hours of fuzzing (~23M iterations):

1. UB: (int64_t)inf in cj_parse_number when extreme exponents like
   22222222e222222 produce infinity. Add cj_dbl_to_i64() that clamps
   inf/NaN/out-of-range values before casting.

2. Null deref in tg3__parse_string when glTF array elements are not
   JSON objects (e.g. "scenes": [[3]]). Add is_object() validation
   in TG3__PARSE_ARRAY_SIMPLE and TG3__PARSE_ARRAY_IDX macros.

Verified clean: 5.8M additional runs with zero crashes after fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 04:10:25 +09:00
Syoyo Fujita
2aeac50277 Add fast float parser and benchmark float-heavy scene
Replace strtod() with Clinger's fast path in tinygltf_json.h for ~1.5x
faster JSON float parsing. The new parser accumulates all digits into a
uint64 mantissa and uses exact power-of-10 tables for conversion,
avoiding locale-dependent strtod for ~99% of JSON float values.

Add optional float32 parse mode (parse_float32 option) that parses JSON
floats at single precision — fewer significant digits needed, wider fast
path range. Breaks strict double-precision conformance but sufficient
for glTF data which is typically single-precision.

Benchmark additions:
- gen_synthetic: add float_heavy preset (~500MB ASCII float JSON)
- bench_v3: add --float32 flag for float32 parse mode benchmarking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 09:00:30 +09:00
Syoyo Fujita
78f4a5cfe8 Add tinygltf v3 single-header C API (tiny_gltf_v3.h)
Ground-up C-centric rewrite of tinygltf with pure C POD structs,
arena-based memory management, structured error reporting, streaming
callbacks, and no STL dependency in the public API. Uses tinygltf_json.h
as the sole JSON backend.

Includes complete parser (JSON + GLB), writer (JSON + GLB), streaming
writer, C++ RAII wrappers, and C++20 coroutine facade. Verified with
Cube.gltf and Fox.glb parse/write round-trips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 03:31:05 +09:00
Syoyo Fujita
aa63297061 Merge branch 'release' of github.com:syoyo/tinygltf into release 2026-03-19 13:39:50 +09:00
Syoyo Fujita
7163d5ab17 ignore build/ 2026-03-19 13:39:37 +09:00
Syoyo Fujita
f9397d296d Merge pull request #535 from syoyo/copilot/optimize-json-parser
Add tinygltf_json.h: fast custom JSON parser with optional SIMD acceleration
2026-03-19 09:29:56 +09:00
copilot-swe-agent[bot]
c4e4155bf7 Super final review: fix cj_unescape_string data-loss, escape-scan infinite loop, operator[] destructor
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-18 21:44:18 +00:00
copilot-swe-agent[bot]
5dfa17d14b Final review: fix stray *out_len=len UB, add get<T> primary template for size_t
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-18 20:16:01 +00:00
Syoyo Fujita
5b87beb373 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:39:27 +09:00
Syoyo Fujita
0ab7e74933 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:39:13 +09:00
Syoyo Fujita
247cb388a0 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:38:55 +09:00
Syoyo Fujita
eb087e80e7 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:38:40 +09:00
Syoyo Fujita
690585fa73 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:38:28 +09:00
Syoyo Fujita
73d309ebfa Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:38:10 +09:00
Syoyo Fujita
4d16d528a5 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:37:50 +09:00
Syoyo Fujita
229f2b8c88 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:37:37 +09:00
Syoyo Fujita
ad531900cb Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 02:37:10 +09:00
copilot-swe-agent[bot]
9da2046cba Mitochondria-level review: fix NULL ptr + nonzero length → serializer overread (6 sites)
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-18 04:34:13 +00:00
copilot-swe-agent[bot]
ed13b0422a Deepest-ever review: NaN/Inf->null, operator[] null key, copy_from_ arr_size_ tracking
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-18 04:10:06 +00:00
copilot-swe-agent[bot]
1dfcb11442 Ultra deep final review: 6 correctness/safety fixes in tinygltf_json.h
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-18 03:32:36 +00:00
copilot-swe-agent[bot]
a2b55f008e Fix security/correctness issues from thorough code review of tinygltf_json.h
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-17 23:17:24 +00:00
copilot-swe-agent[bot]
fdf528f9aa Make C++ exceptions optional in tinygltf_json.h (default off)
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-17 19:33:02 +00:00
copilot-swe-agent[bot]
ebcd8cc4ee Replace recursive parser with iterative loop using CJ_MAX_ITER explicit frame stack
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-17 19:24:38 +00:00
copilot-swe-agent[bot]
f6c71cf88b Security fixes: null key guard, allocation overflow protection, parser depth limit
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-17 16:02:25 +00:00
copilot-swe-agent[bot]
5aaa3e4daf Remove accidental test artifact files and update .gitignore
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-17 15:52:12 +00:00
copilot-swe-agent[bot]
1117aa7191 Add tinygltf_json.h: fast custom JSON parser with optional SIMD support
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-17 15:49:46 +00:00
copilot-swe-agent[bot]
bdba4dfb4c Initial plan 2026-03-17 15:15:01 +00:00
Syoyo Fujita
e379d0d60c Merge pull request #533 from syoyo/copilot/remove-appveyor-ci-config
Remove AppVeyor CI config and badge from README
2026-03-05 13:29:40 +09:00
copilot-swe-agent[bot]
659de95977 Remove AppVeyor CI config and badge from README
Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
2026-03-05 04:27:49 +00:00