Add backend divergence probes - #2
Open
erichanwang wants to merge 1 commit into
Open
Conversation
Add focused language programs that exercise ABI call edges, value representation, numeric formatting, control flow, scoping, strings, and recursion. The differential suite was green because it lacked inputs that distinguish EMPTY from unassigned storage, boolean payload layouts, literal precision, and fixed runtime buffers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compiler.cpp,runtime.c, and.github/unchanged so the array work can proceed independently.Exact divergences
Each named
.langfile is the exact input.Missing arguments read uninitialized registers
Input:
audit_calls_missing.langInterpreter exit: 0. Compiled exit: 139.
The interpreter fills omitted parameters with
EMPTY. The generated callee spills all six parameter registers even though the caller initialized only%rdi.Seven arguments are accepted only by the interpreter
Input:
audit_calls_over_limit.langThe interpreter exits 0 after executing the call. Assembly generation exits 1.
Mixed relational comparisons use different boolean payloads
Input:
audit_comparisons.lang. The other 46 printed comparisons agree. These 10 differ:Interpreter booleans use
b_val, but generic relational comparison readsn_val. Runtime booleans store their payload innum, which runtime comparison reads.Stored and parameter-passed EMPTY values become unknown identifiers
Input:
audit_empty_values.langThe compiled representation uses null for both a valid
EMPTYvalue and an unassigned slot, so the undefined-identifier guard cannot distinguish them.Long undefined identifiers are truncated
Input:
audit_identifier_long.lang, containing a 392-character identifier.The interpreter line is 421 characters. The compiled line is 255 characters because
rt_undefandrt_printuse fixed buffers.Numeric literals lose precision and long formatted values truncate
Input:
audit_numeric.langAssembly literals are emitted with the stream's default significant-digit precision. Independently, compiled numeric printing truncates the longest value to the runtime's fixed output buffer. Negative zero agrees.
Interpreter recursion exhausts the stack first
Input:
audit_recursion.langInterpreter exit: 139. Compiled exit: 0.
+0.000000With an 8192 KiB stack and address randomization disabled for repeatability,
descend(8055)is the largest successful interpreter input anddescend(8056)exits 139. The compiled backend succeeds throughdescend(261958)and exits 139 atdescend(261959).Covered without divergence
audit_calls.lang: six arguments, left-to-right observable evaluation, and nested calls.audit_spills.lang: expression depth beyond the five-register pool while a nested function call runs.audit_strings.lang: empty strings, quote-shaped input, backslashes, a 300-character string, long concatenation, and mixed string-number concatenation.audit_strings_unterminated.lang: unterminated string at EOF. Both outputs agree; the assembler emits a warning.audit_loops.lang: three nested loops withbreakandcontinueinsideifblocks inside a function.audit_scoping.lang: assignment and parameter shadowing preserve the global value.Verification
g++ -O2 -std=c++17 -Wall -Wextra -o /tmp/axc compiler.cpp: exits 0. The unhandled array enumerator warnings are left for the in-flight array work../run_tests.sh: exits 1 with the seven exact repro failures above; 19 programs pass.