# Capture and stop on real GCC 16.2 integral evaluator results Task ID: T-GCC-EVALUATOR-017 Role: astra_implementer Status: READY ## 1. Context and baseline Shared /home/faumaray/Projects/VoidLanguageServer, feat/implement-roadmap at ca04975. No other compiler patch owner. User D-030 approved this local prototype. GCC 16.2 official archive c51c30ca7422d0cbecf504b2e0f33c3aca31e0f90a76b65217f465163fa6fa17b3f5de39e145c47e5bab90ac0ce7fff3b03c8d553ae36e01faaea5a50f8648d1 matches release tag 78d4ac73dd391005b895a6148cd9831e28e1208b. Private cc1plus built, matched host predefined macros/ordered libstdc++ via reference-cxx and passed 19 reference, 8 tooling and 33 module scans. Preflight T-PREFLIGHT-GCC-008 cleared the ordinary integral evaluator slice with amendments below. ## 2. Objective and deliverables Implement the first versioned patch to real GCC internals and a direct bounded runtime fixture. Produce actual event-time integer values, nested bodies and cooperative stops in an isolated cc1plus process. Send the patch/application instructions early so root can build while you finalize the harness. ## 3. Scope and non-goals Only compiler hooks for ordinary integral consteval/constexpr returns, metadata/handshake, stops and direct test harness. No AST lookup/diagnostics relocation, VLS client/worker launch implementation, production registration or changes to installed compilers. Constraints/reflection semantic events are a later slice. ## 4. Files to inspect Read docs/agent-workflow/tasks/{T-PLAN-GCC-008,T-PREFLIGHT-GCC-008}.md, tests/corpus/frontend/gcc-live.cpp, exact build/gcc-gate/gcc-16.2.0/gcc/{cp/constexpr.cc,cp/lex.cc,cp/Make-lang.in,c-family/c.opt,json.cc,json.h,tree.h}. Inspect GCC raw source on disk, treat it as read-only. Compiled baseline: build/gcc-gate/compiler-build/gcc/cc1plus. Probe logs under build/gcc-gate. ## 5. Write ownership and coordination Write scope: compiler-patches/gcc-16.2.0/0001-evaluator-events.patch; tests/corpus/frontend/verify-gcc-events.py Generate/update the unified patch using private scratch build/gcc-gate/patch-author/ copies of only touched source files; no writes to official extract, compiler-build, installed gcc, shared VBS/CMake trees or sibling repositories. Root alone applies the patch to the owned release tree and rebuilds cc1plus. No branches, staging, commits, external messages or children. ## 6. Implementation or investigation approach In cp/constexpr.cc cxx_eval_call_expression admit direct FUNCTION_DECL with relevant real source after bound args (~4279). Open scoped attempt before lazy instantiate_decl 4291, actual body at 4531, capture ordinary scalar real get_value(res) at 4552 before destruction at 4576, post-clean-up outcome near 4653–4688. Distinguish real body/cache hit 4426, throw/jump_target/failure/overflow, void/constructors/unsupported; don't manufacture children for cached/folded results. For the actual returned INTEGER_CST, copy type precision, signedness and bits with correct truncation/negative handling. Never retain a GC pointer for serialization later. Disabled fast path cheap and bypasses formatting and I/O. Gate on private compiler option and validate private pipes. Locate cxx_init/cxx_finish in cp/lex.cc and registration/object list. Avoid interacting with ordinary output. Read-only planner identified exact source anchors and preflight approved this path. ## 7. Interfaces and data contracts NEW local compiler probe v1. Two fixed inherited pipes: fd 3 for control, fd 4 for event records. Opt-in private -fvls-observe, add -fvls-step for cooperative stops. VLS_GCC_NONCE is exactly 32 lower-case hex chars supplied by the trusted harness. Emit one bounded strict UTF-8 JSON object per LF line: {v:1,nonce,seq,kind,...}, contiguous seq from 0. hello first reports backend='gcc-16.2.0/vls-eval-1', supported kinds/capabilities. enter/body/value/cached/leave may carry integer frame and parent (null for root), name, source, line and byte column if established. value has an immutable value object {kind:'integer',precision,signed,bitsHex} with exact lower-case hex, or explicit unavailable; primitive widths 1..64. Treat body result as provisional until leave's outcome. stopped follows a supported value in stepping mode. Its seq is the stop generation. Accept only bounded control lines ' step|continue|cancel\n' for this stop. Wrong or missing controls cannot resume execution. frontendEnd indicates frontend finalization; wait status plus separate diagnostics determine final outcome. Helpers must escape or reject every invalid UTF8/control byte before formatting. Cap events (e.g. 4096), frame bytes 64KiB, control 4KiB, total trace (e.g. 1MiB), emit terminal truncation where possible; do not emit JSON as an unbounded printing side effect. ## 8. Dependencies and integration Root will syntax/build/test/apply patch to the verified source and relay compiler errors for you to fix in the patch. Source inputs for your harness are the existing gcc-live.cpp + controlled replacements in private temporary dirs. Test gcc disabled and enabled using the same source snapshot, no stdout ambiguity. Allow helper mapping in the test harness only for direct pipe setup. Root/other worker owns the separate bounded production-language C++ worker. ## 9. Edge cases security and performance Use narrow fixed-ASCII validated wire subset or strict writer for all text values; GCC json.cc emits invalid JSON for certain C0 strings. Detect partial writes/EINTR/errors, bound sizes before formatting. Nonce and stop generation prevent stale controls. Snapshot as provisional, only close success after cleanup; propagated jump_target takes precedence over normalized void. Capturing a tty/invalid fd must not stall ordinary compiler output. Explicit terminal reason/verified prefix on control loss. Backend never reaches out to a file or network for control. ## 10. Acceptance criteria Real runtime fixture: Ready=17/41 and identical >0 tests produce actual return pairs 17/34 and 41/82, extra bias=5 differentiates further. At held inner value prove same child PID is alive with no subsequent event until a matched step/resume, then observe outer return. Cancel another run at the same real stop; missing outer return and reaped process. Test backend/nonce/schema/sequence, parent/leave pairing, wrong control, EOF, scalar widths/negative or explicit unsupported, disabled parity/failed constraint. Ask root for patched binary when patch ready. ## 11. Verification commands and evidence Run codex-tasklint already done by root, git status --short --branch. Use patch --dry-run -p1 against clean GCC 16.2 source. Root runs dev cpp-gcc -c make -C build/gcc-gate/compiler-build/gcc -j2 cc1plus, supplies binary path. Run dev cpp-gcc -c python3 tests/corpus/frontend/verify-gcc-events.py --cc1plus /absolute/path/to/patched/cc1plus with bounded deadlines. Report each real result and unrun checks. ## 12. Constraints and stop conditions Stop for unresolved ambiguous value lifetime, need for project licensing decisions, changes outside assigned paths, or inability to prove live actual values. After two failed repair cycles provide root new hypothesis. No fabrication or progress claims before compiler-origin evidence. ## 13. Authorization and decisions User approved GPT-6.2 Astra at Max and local modified compiler prototype, licensing and distribution deferred. The fresh independent preflight's READY applies only to evaluator portion. Preserve other pending preflight gates. ## 14. Return format T-GCC-EVALUATOR-017 DONE/PARTIAL/BLOCKED, exact patch files/compiler members, private API, commands/exit/observed values/control, failure outcomes and integrations.