Commit Graph

249 Commits

Author SHA1 Message Date
Peterino2 2b1ce3ac75 initial implementation of zargs 2026-01-22 01:14:23 -08:00
Peterino2 204460f500 saving mocks implementation 2026-01-22 00:14:48 -08:00
Peterino2 8cdeac3238 saving 2026-01-21 22:41:50 -08:00
Peterino2 ec10f75888 Add TODO.md with next implementation steps
Document the current completed state and outline the next phase:
- Mock code generator implementation
- Test project with C linkage and function coverage
- Golden file regression testing
- Multi-header support

Provides clear roadmap based on TEST_HARNESS_PLAN_V2.md with
time estimates and prioritization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 20:28:07 -08:00
Peterino2 35a171f804 Remove obsolete TEST_HARNESS_PLAN.md
Keep only TEST_HARNESS_PLAN_V2.md which includes the enhanced design
with mock generation and complete test project architecture.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 20:27:32 -08:00
Peterino2 9f4c2b6914 Add comprehensive documentation and reorganize project structure
Created human-readable documentation under docs/ directory:
- docs/README.md: Project overview, quick start, features, and status
- docs/architecture.md: Pipeline design, components, and implementation details
- docs/usage.md: Usage guide, integration examples, and troubleshooting
- docs/naming.md: Detailed explanation of C-to-Zig naming conventions

Removed obsolete documentation files:
- PARSER_FIX_PLAN.md: Content moved to architecture.md
- IMPLEMENTATION_COMPLETE.md: Content moved to README.md

The documentation provides:
- Complete architecture overview of the 4-stage pipeline
- Detailed explanation of the "first underscore" naming rule
- Integration examples and common usage patterns
- Troubleshooting guide and FAQ
- Extension points for adding new C patterns

Kept TEST_HARNESS_PLAN.md and TEST_HARNESS_PLAN_V2.md as they document
future implementation plans for testing infrastructure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 20:20:07 -08:00
Peterino2 0c5383f518 Fix SDL3 parser critical issues and add comprehensive test plans
## Critical Fixes Implemented

### 1. Memory Leak Resolution
- Fixed doc comment allocation in peekDocComment() to properly allocate memory
- Added cleanup for pending_doc_comment when skipping lines
- All tests now run with zero memory leaks (GPA verified)

### 2. Flag Definition Parsing (CRITICAL)
- Added skipWhitespace() helper to handle newlines before #define statements
- Flag structures now properly populated with all fields
- Before: empty structs with only padding
- After: all 7 flags present in GPUTextureUsageFlags

### 3. Invalid Identifier Generation (CRITICAL)
- Implemented "first underscore" naming rule
- Prevents enum values starting with numbers (e.g., 16bit, 2d)
- detectCommonPrefix() now only strips SDL_GPU_/SDL_ prefix
- enumValueToZig() splits on first underscore to preserve type prefix

### 4. Naming Convention Alignment
- Changed from "last underscore" to "first underscore" rule
- Type part: all lowercase (e.g., primitivetype)
- Value part: TitleCamelCase (e.g., Trianglelist)
- Result: primitivetypeTrianglelist (matches existing codebase)
- Added screaminToTitleCamel() helper for proper camelCase conversion

## Test Coverage

### New Tests Added
- patterns.zig: 3 new tests for flag scanning with whitespace
- naming.zig: 10 new comprehensive tests for naming conventions
- All 18 unit tests passing
- Integration test with SDL_gpu.h successful (169 declarations)

### Files Modified
1. **patterns.zig**
   - Added skipWhitespace() helper (lines 609-618)
   - Updated scanFlagTypedef() to skip whitespace before #define
   - Added 3 new flag scanning tests

2. **naming.zig**
   - Rewrote detectCommonPrefix() to only strip SDL prefix
   - Rewrote enumValueToZig() with first underscore rule
   - Added screaminToTitleCamel() helper
   - Added 10 comprehensive naming tests

3. **parser.zig**
   - Previous memory leak fixes intact
   - No changes needed for this iteration

## Documentation Added

1. **PARSER_FIX_PLAN.md** - Detailed implementation plan
2. **IMPLEMENTATION_COMPLETE.md** - Summary of fixes and results
3. **TEST_HARNESS_PLAN.md** - Original test harness design
4. **TEST_HARNESS_PLAN_V2.md** - Enhanced plan with mock generation

## Verification

 Parser generates valid Zig code (no compilation errors)
 All flag fields populated correctly
 No invalid identifiers (no numeric prefixes)
 Naming matches existing codebase conventions
 All 18 unit tests passing
 No memory leaks (GPA verified)
 Successfully parsed SDL_gpu.h (169 declarations)

## Next Steps (Planned)

- Implement mock_codegen.zig for C stub generation
- Create test_project/ with complete build system
- Add function call coverage tests
- Implement golden file regression testing

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 19:37:26 -08:00
Peterino2 5ae025a691 sdl3 initial parser 2026-01-21 16:28:12 -08:00
Peterino2 eee1bd265e saving 2026-01-21 00:16:03 -08:00
peterino2 2d59109994 saving 2026-01-19 21:40:05 -08:00
Peterino2 bae150305d enabling shader gen 2026-01-08 17:19:52 -08:00
peterino2 6300ef0e35 something broke with core 2026-01-08 09:40:02 -08:00
peterino2 a518a89798 hot reloading with trampoline 2026-01-06 09:14:02 -08:00
peterino2 e69a8d13ec hot reloading and module watching done 2026-01-03 20:39:31 -08:00
peterino2 ef91c4599b updated install script 2026-01-03 16:37:02 -08:00
peterino2 9f9f40abd9 updates to engine time and seemingly bugs are fixed 2026-01-03 16:35:31 -08:00
peterino2 81aaaa81b7 big refactor to new lifetime rules 2026-01-03 16:02:52 -08:00
peterino2 c36cae7db9 engine object changes 2026-01-03 14:05:30 -08:00
peterino2 a06b0e6394 saving 2026-01-02 16:47:56 -08:00
peterino2 17b3a4c23d trampoline loading is now working for coreTest... now onto hot reloading 2026-01-01 16:10:54 -08:00
peterino2 81132ac97b saving 2025-12-30 14:40:51 -08:00
peterino2 97c8de24b9 saving 2025-12-30 13:55:35 -08:00
peterino2 bb99e9025e saving 2025-12-28 17:38:50 -08:00
Peter Li b4fa25106a Merge branch 'dev/variant-engine' of http://archon:3000/searzocom/Backlog into dev/variant-engine 2025-12-27 22:54:20 -08:00
Peter Li 75a9ae1b39 spec generation complete 2025-12-27 22:51:40 -08:00
peterino2 18b5537826 saving 2025-12-19 02:18:45 -08:00
Peter Li b248573930 more work on variant engine 2025-12-19 01:45:12 -08:00
peterino2 3648615829 new build system who dis 2025-12-07 14:35:58 -08:00
peterino2 8a30c78260 archiving a lot of things then moving to yet another redo of the build system 2025-11-28 20:22:51 -08:00
peterino2 cc00fb076e switched all builds to bh.declareOptions 2025-11-28 20:14:56 -08:00
Peter Li ffc84ce44c
Merge pull request #5 from peterino2/dev/buildhelper
Dev/buildhelper
2025-11-06 20:45:39 -08:00
peterino2 a727aedd97 change tests to avoid -fincremental, causes issues on windows, also reducing payload size for concurrent queue test, due to memory constraints 2025-11-06 20:44:59 -08:00
peterino2 fb131ab6c4 added EA's implementation of MPMC queue 2025-11-06 20:43:20 -08:00
peterino2 1572f96429 fixed all tests and added bh.zig 2025-11-06 20:42:48 -08:00
peterino2 5fbc11e1a1 we gonna have to fix our build system even more 2025-11-06 11:54:40 -08:00
peterino2 0fc379cbc3 added pscopes 2025-11-03 09:17:27 -08:00
peterino2 55e7c955c1 saving 2025-11-02 00:55:21 -07:00
Peter Li 35562ab6d7 saving 2025-11-02 00:44:21 -07:00
peterino2 7aa70eb5d5 fixes for core dependencies on std c lib 2025-11-01 16:33:17 -07:00
peterino2 2e2ab68178 updates to pscopes 2025-11-01 16:21:14 -07:00
Peter Li 054b41da95 fixed up toolbox.zig 2025-11-01 15:25:49 -07:00
Peter Li 60dfe0ae60 compiling platform now 2025-11-01 15:19:03 -07:00
Peter Li 180badad39 moved filewatch out of packer, and moving spng to rend, and deleted a lot of dead code 2025-11-01 15:13:42 -07:00
peterino2 08bad270e6 saving 2025-10-31 00:55:27 -07:00
peterino2 c7cfa18ce9 added scopes 2025-10-31 00:36:14 -07:00
peterino2 b5dad13bd7 enabled parallel job, added optimizeBroadphase, and more scopes 2025-10-26 22:31:48 -07:00
peterino2 2e4f7d98e4 crated zuck game content and creating hello-window 2025-10-26 20:02:36 -07:00
peterino2 6bf5b3516f saving 2025-10-26 15:50:50 -07:00
peterino2 cf0f27cc92 trying out the depot project 2025-10-26 15:50:42 -07:00
peterino2 338954aa8a updating tracks regarding headless 2025-10-25 17:01:10 -07:00