fix(linux): add missing yaze_gfx_render dependency to yaze_gfx_debug

Fixes linker error on Linux where yaze_gfx_debug.a (performance_dashboard.cc)
was calling AtlasRenderer::Get() and AtlasRenderer::GetStats() but wasn't
linking against yaze_gfx_render which contains atlas_renderer.cc.

Root cause: yaze_gfx_debug was only linking to yaze_gfx_types and
yaze_gfx_resource, missing the yaze_gfx_render dependency.

This also fixes the undefined reference errors for HttpServer methods
which were already properly included in the agent.cmake source list.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
scawful
2025-11-20 01:38:55 -05:00
parent b556b155a5
commit e36d81f357
22 changed files with 1620 additions and 2 deletions

View File

@@ -0,0 +1,68 @@
# Build Performance & Agent-Friendly Tooling (November 2025)
Status: **Draft**
Owner: CODEX (open to CLAUDE/GEMINI participation)
## Goals
- Reduce incremental build times on all platforms by tightening target boundaries, isolating optional
components, and providing cache-friendly presets.
- Allow long-running or optional tasks (e.g., asset generation, documentation, verification scripts)
to run asynchronously or on-demand so agents dont block on them.
- Provide monitoring/metrics hooks so agents and humans can see where build time is spent.
- Organize helper scripts (build, verification, CI triggers) so agents can call them predictably.
## Plan Overview
### 1. Library Scoping & Optional Targets
1. Audit `src/CMakeLists.txt` and per-module cmake files for broad `add_subdirectory` usage.
- Identify libraries that can be marked `EXCLUDE_FROM_ALL` and only built when needed (e.g.,
optional tools, emulator targets).
- Leverage `YAZE_MINIMAL_BUILD`, `YAZE_BUILD_Z3ED`, etc., but ensure presets reflect the smallest
viable dependency tree.
2. Split heavy modules (e.g., `app/editor`, `app/emu`) into more granular targets if they are
frequently touched independently.
3. Add caching hints (ccache, sccache) in the build scripts/presets for all platforms.
### 2. Background / Async Tasks
1. Move long-running scripts (asset bundling, doc generation, lints) into optional targets invoked by
a convenience meta-target (e.g., `yaze_extras`) so normal builds stay lean.
2. Provide `scripts/run-background-tasks.sh` that uses `nohup`/`start` to launch doc builds, GH
workflow dispatch, or other heavy processes asynchronously; log their status for monitoring.
3. Ensure CI workflows skip optional tasks unless explicitly requested (e.g., via workflow inputs).
### 3. Monitoring & Metrics
1. Add a lightweight timing report to `scripts/verify-build-environment.*` or a new
`scripts/measure-build.sh` that runs `cmake --build` with `--trace-expand`/`ninja -d stats` and
reports hotspots.
2. Integrate a summary step in CI (maybe a bash step) that records build duration per preset and
uploads as an artifact or comment.
3. Document how agents should capture metrics when running builds (e.g., use `time` wrappers, log
output to `logs/build_<preset>.log`).
### 4. Agent-Friendly Script Organization
1. Gather recurring helper commands into `scripts/agents/`:
- `run-gh-workflow.sh` (wrapper around `gh workflow run`)
- `smoke-build.sh <preset>` (configures & builds a preset in a dedicated directory, records time)
- `run-tests.sh <preset> <labels>` (standardizes test selections)
2. Provide short README in `scripts/agents/` explaining parameters, sample usage, and expected output
files for logging back to the coordination board.
3. Update `AGENTS.md` to reference these scripts so every persona knows the canonical tooling.
### 5. Deliverables / Tracking
- Update CMake targets/presets to reflect modular build improvements.
- New scripts under `scripts/agents/` + documentation.
- Monitoring notes in CI (maybe via job summary) and local scripts.
- Coordination board entries per major milestone (library scoping, background tooling, metrics,
script rollout).
## Dependencies / Risks
- Coordinate with CLAUDE_AIINF when touching presets or build scripts—they may modify the same files
for AI workflow fixes.
- When changing CMake targets, ensure existing presets still configure successfully (run verification
scripts + smoke builds on mac/linux/win).
- Adding background tasks/scripts should not introduce new global dependencies; use POSIX Bash and
PowerShell equivalents where required.
## Windows Stability Focus (New)
- **Tooling verification**: expand `scripts/verify-build-environment.ps1` to check for Visual Studio workload, Ninja, and vcpkg caches so Windows builds fail fast when the environment is incomplete.
- **CMake structure**: ensure optional components (HTTP API, emulator, CLI helpers) are behind explicit options and do not affect default Windows presets; verify each target links the right runtime/library deps even when `YAZE_ENABLE_*` flags change.
- **Preset validation**: add Windows smoke builds (Ninja + VS) to the helper scripts/CI so we can trigger focused runs when changes land.

View File

@@ -0,0 +1,46 @@
# Modernization Plan November 2025
Status: **Draft**
Owner: Core tooling team
Scope: `core/asar_wrapper`, CLI/GUI flag system, project persistence, docs
## Context
- The Asar integration is stubbed out (`src/core/asar_wrapper.cc`), yet the GUI, CLI, and docs still advertise a working assembler workflow.
- The GUI binary (`yaze`) still relies on the legacy `util::Flag` parser while the rest of the tooling has moved to Abseil flags, leading to inconsistent UX and duplicated parsing logic.
- Project metadata initialization uses `std::localtime` (`src/core/project.cc`), which is not thread-safe and can race when the agent/automation stack spawns concurrent project creation tasks.
- Public docs promise Dungeon Editor rendering details and “Examples & Recipes,” but those sections are either marked TODO or empty.
## Goals
1. Restore a fully functioning Asar toolchain across GUI/CLI and make sure automated tests cover it.
2. Unify flag parsing by migrating the GUI binary (and remaining utilities) to Abseil flags, then retire `util::flag`.
3. Harden project/workspace persistence by replacing unsafe time handling and improving error propagation during project bootstrap.
4. Close the documentation gaps so the Dungeon Editor guide reflects current rendering, and the `docs/public/examples/` tree provides actual recipes.
## Work Breakdown
### 1. Asar Restoration
- Fix the Asar CMake integration under `ext/asar` and link it back into `yaze_core_lib`.
- Re-implement `AsarWrapper` methods (patch, symbol extraction, validation) and add regression tests in `test/integration/asar_*`.
- Update `z3ed`/GUI code paths to surface actionable errors when the assembler fails.
- Once complete, scrub docs/README claims to ensure they match the restored behavior.
### 2. Flag Standardization
- Replace `DEFINE_FLAG` usage in `src/app/main.cc` with `ABSL_FLAG` + `absl::ParseCommandLine`.
- Delete `util::flag.*` and migrate any lingering consumers (e.g., dev tools) to Abseil.
- Document the shared flag set in a single reference (README + `docs/public/developer/debug-flags.md`).
### 3. Project Persistence Hardening
- Swap `std::localtime` for `absl::Time` or platform-safe helpers and handle failures explicitly.
- Ensure directory creation and file writes bubble errors back to the UI/CLI instead of silently failing.
- Add regression tests that spawn concurrent project creations (possibly via the CLI) to confirm deterministic metadata.
### 4. Documentation Updates
- Finish the Dungeon Editor rendering pipeline description (remove the TODO block) so it reflects the current draw path.
- Populate `docs/public/examples/` with at least a handful of ROM-editing recipes (overworld tile swap, dungeon entrance move, palette tweak, CLI plan/accept flow).
- Add a short “automation journey” that links `README` → gRPC harness (`src/app/service/imgui_test_harness_service.cc`) → `z3ed` agent commands.
## Exit Criteria
- `AsarWrapper` integration tests green on macOS/Linux/Windows runners.
- No binaries depend on `util::flag`; `absl::flags` is the single source of truth.
- Project creation succeeds under parallel stress and metadata timestamps remain valid.
- Public docs no longer contain TODO placeholders or empty directories for the sections listed above.