Skip to content

feat(foreign): code in c is translated to flang and judged by kernel - #338

Merged
the-homeless-god merged 2 commits into
devfrom
a/foreign-code-is-checked-in-flang
Oct 7, 2026
Merged

the-homeless-god merged 2 commits into
devfrom
a/foreign-code-is-checked-in-flang

Conversation

@the-homeless-god

Copy link
Copy Markdown
Member
  • chore(numbers): sync measured counts after rebase
  • feat(foreign): code in c is translated to flang and judged by kernel

Verified on the tree of dev plus this branch (d160ace): the checker test set passes, the provability verdict is green with all four checks, the proved-share ledger and the rule tables agree with the tree, pre-push is green, commit messages follow the convention.

🤖 Generated with Claude Code

the-homeless-god and others added 2 commits October 7, 2026 13:29
ADR-0058 is accepted: a foreign language enters through an untrusted
translator, and every verdict is about the translation, shown in full.
The first language is a subset of C (int functions, return, if/else,
int locals with an initial value, arithmetic, comparisons, logic, ?:),
chosen by measurement over the ten print targets.

flang/foreign/c/translator.fscript reads the text AST dump of clang,
prints the translation with the duties of C (int range of every
arithmetic result, a divisor that is not zero, no fall off the end),
derives a draft specification marked as derived, and holds three lying
translators (dropped branch, shifted constant, swapped operands).

flang/foreign/c/run.fscript has two plans. Demo translates the corpus,
judges the translation and the draft with the kernel, prints the
translation back to C and compares it with the original C under UBSan
on a grid of inputs, confirms every counterexample with flang run and
fails when any function disagrees with corpus/expected.tsv or a lying
translator passes. Census counts the share of the hand written C files
of the tree that falls in the subset and fails when it drops.

The license guard and the tree inventory treat the corpus as foreign
input; tasks 2196 and 8406 record what was done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNHrA3rG7FTWhB11E7pjDQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNHrA3rG7FTWhB11E7pjDQ
@the-homeless-god
the-homeless-god merged commit b051ad1 into dev Oct 7, 2026
32 checks passed
@the-homeless-god
the-homeless-god deleted the a/foreign-code-is-checked-in-flang branch October 7, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant