A Debug-only refusal-site tracer: hooks in rpg_eval.zig and rpg_statements.zig, no behaviour change #759
Loading…
Reference in a new issue
No description provided.
Delete branch "lt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A Debug-only refusal-site tracer: hooks in rpg_eval.zig and rpg_statements.zig, no behaviour change
src/core/rpg_trace.zigwrites one stderr line where a reader of the recoverydeclines or refuses. It runs only in a Debug build, and only when the
environment variable
SOURCERER_TRACE_REFUSALSis exactly1. A Releasebuild compiles every call to nothing. With the variable unset a Debug build
reads the variable and returns: the emitted text, the receipts and the exit
code do not change (
emit-bytes-diff.shof origin/trunk against this change isempty).
The coordinator runs it on a pre-ship Debug build:
and tallies the tokens (
sort tokens | uniq -c | sort -rn). A line is one ofA refusal token is a code location: the file, the function and the number of
the return in that function, in source order. It never carries an operand, a
symbol, an operation number, a count or a text, so it holds no content of the
program under recovery.
trace module-beginmarks the start of each recoverypass of a module and
trace statement-beginthe end of each statement group, sothe refusals between two markers belong to one group.
Sites:
rpg_argument_copy,rpg_copy_lifetime,rpg_decimal_call,rpg_decimal_convert,rpg_decimal_copy,rpg_frames,rpg_programs(everyreturn null/return false), and inrpg_eval.zigcall,callFactandbuiltinCall.rpg_shape.zig(controlStatusat eachcontrol_flowfailure,the
block_ownerone included, and the boundary readers it calls),rpg_flow.zig,rpg_branches.zig,rpg_loop_exits.zig,closeBlocksand theblock_ownerfailure of theuntilarm inrpg_statements.zig, andunhandledOperationinrpg_render_ctx.zig(one token per stage of theoperation_semanticsfailure).rpg_eval.zig: the address-push arm (operations 33 and 34) andevery
stack_valueandstorage_spanrejection of the load (62) arm, theload through an address (32) and the store (
writeValue).Not traced, on purpose: the scan predicates that run for every operation of a
statement (
rpg_flow.mentionsData,rpg_flow.isData,rpg_shape.monitorCut,rpg_branches.Graph.target). They answer no for nearly every operation andburied every other token (700 thousand of 800 thousand lines over 60 public
saved files).
rpg_trace_test.zigpins that the module is silent when the variable is unsetand prints only the fixed lines when it is set, and that every site written in
the instrumented files matches
^refusal [a-z_]+\.[A-Za-z_]+ s[0-9]{2}$, isunique, and names the file that holds it.
rpg_eval.zig
stephas new tokens only; rpg_statements.zig net growth is 0lines (two blank lines go, for the import and the
closeBlockshook).Gates