Skip to content

calibrate.sh SYNC drifts: analyzer builtin list, function_exists inline names, prelude files missing from the analyzer #646

Closed

Description

@blacktrs

Problem

tools/audit/calibrate.sh (the audit's honesty check) fails its SYNC section on main (dbb6fdd) and on shared-generics. Three independent drifts:

  1. Analyze\Builtins misses ~55–60 names emitBuiltin dispatches — e.g. array_key_exists, in_array, stripos, range, strrev, json_validate, substr_count, class_alias, plus internal __mc_* / __mir_* helpers. A user program calling one of the public ones reads as an undefined function to the analyzer.
  2. function_exists cannot see 8 inline builtins: array_key_exists, in_array, array_is_list, range, strrev, json_validate, substr_count, class_alias. A polyfill guard (if (!function_exists('x')) { function x() … }) around one would redefine a working function.
  3. analyze_prelude_sources() omits 19 prelude files: intl*.php (16), pdo_mysql_off.php, pdo_pgsql_off.php, pdo_sqlite_off.php. Every function they declare reads as undefined to the analyzer.

Expected

bash tools/audit/calibrate.sh passes SYNC: the analyzer's builtin list and function_exists's view cover every user-visible dispatch name, and the analyzer indexes every prelude file.

Notes

  • Internal helper names (__mc_*, __mir_*, runtime, manticore, target) in item 1 are probably scraper noise, not real gaps; the check should skip them as item 2 already does.
  • Item 2 is the user-visible one: function_exists('in_array') answering false breaks the polyfill idiom.

Activity

  1. added
    bug
    on Nov 11, 2026
  2. blacktrs commented on Nov 11, 2026

    @blacktrs
    ContributorAuthor

    Checked item 2 at run time: function_exists() answers true for all eight (array_key_exists, in_array, array_is_list, range, strrev, json_validate, substr_count, class_alias), same as php. The names resolve through their stdlib bodies, so this part of the check is stale rather than a user-visible bug. Items 1 and 3 are about the analyzer's view and still stand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions