Repository navigation
Code Analysis Rust Inherent Functions
Draft #1265, original runtime-bearing head 20ce8f32ad9002c408abeb11a6fedec539aba004, with evidence-only follow-up 1788ace7a692586332bdb7ceabf17ec8eab3d54e, extends Go Draft #1264 in native stack #1262. Original Rust/Go, #1252 and team commits/authorship/PR ownership are preserved. Not in Labs, approved, merged, released or installed. Labs remains bf0a29e7664f52973d06a8e6a608df2db1ecbd39.
Before, serde_json src/value/from.rs:60 Number::from_f64(f) stopped at an unknown target. Now it follows use crate::number::Number to src/number.rs:183:5. The real upstream version pair removes #[inline] and edits documentation, while the function body stays unchanged. Its owned-definition change now exposes three verified source callers per side, compared with zero in the parent. The overall investigation stays partial/exit 1; this is not complete impact or runtime reachability.
Regex's string and bytes modules have distinct Regex::new functions: src/regex/string.rs:125 → 180:5 and src/regex/bytes.rs:123 → 178:5. Nominal module identity keeps the same spelling from conflating them. rustc controls also established a wrong-target counterexample: a tuple enum variant may share an inherent function's name and wins at the call; such calls remain unknown rather than jumping to that function.
| Scope | Parent | Candidate |
|---|---|---|
| Four design observations, three physical sites; serde repeated under two profiles | 0 correct / 0 wrong / 4 missed | 4 correct / 0 wrong / 0 missed |
| Reserved generic Map::new: two physical sites, two profiles | 4 known-source misses | 4 known-source misses |
| Trait deserialize and external cfg-dependent alias controls | 4 reasonable unknowns | 4 reasonable unknowns |
| Supplemental changed from_f64, three callers per side | 0 base / 0 head | 3 base / 3 head, all navigation valid |
Pins: regex 9870c06e6c772daaad7ab612faab29130753e41c; serde_json d2fce19685bf0e3d493a9d785665137654c79e6d → 4d4f53c3b7de3259b6a8a15ef4d5f4edb47af32f. Both projects were exposed in earlier free-function studies. Source answers precede rule design; the map file was reserved before implementation and inspected after the first rule, before extraction. These are not blind repositories. The supplemental pair's initial source list omitted old value/de.rs:54; its direct-source correction is retained explicitly. Paired observations overlap the design corpus and must not be added as independent accuracy evidence.
A later independent rust-analyzer audit checks all 1,205 regex / 22 default-serde / 23 arbitrary-serde emitted source-target observations: 1,250 declaration locations agree, zero different/unavailable, across 1,230 physical sites. It includes earlier finite cases and is not whole-project precision/recall or rustc compilation. All old correct targets and function inventories remain. Six calls inside an arbitrary_precision nested method are now excluded under default features, with the exact excluded region disclosed. Pinned answers, commands, source/ZIP scores, correction and preservation records.
rust-source-direct-v2, adapter revision 2, adds rust-inherent-source-candidate through the existing module/use/local-Cargo path resolver. Unique receiver-free inherent functions on monomorphic nominal owners are source candidates. Trait impl functions are not entered in the registry. Generic scopes, conditional alternatives and enum variant precedence prevent unsupported binding; calls from inside trait implementations may still name an explicit inherent function. Old v1 captures keep their original free-function scope and are readable by both distributions.
Generic/specialized owners, type aliases, Self, receiver/trait dispatch, visibility and argument applicability remain unproved. Separate type/value namespace ambiguity may conservatively miss a valid call. Reserved Map<String, Value> calls are known misses. Macros, build-script cfg, generated/external dependency source and full Cargo build/resolve semantics remain opaque or unsupported. Nested call records describe source containment, not separately attributed execution.
Profiles still disclose local crate targets, tests=false, target/custom cfg, local feature propagation, parsed/excluded files, conditional definitions, opaque macros and missing modules. Cargo metadata is offline/no-deps/locked over captured manifests and zero-byte source stubs. No upstream source, build script, proc macro or test executes. Default and arbitrary_precision serde profiles select the same from_f64 definition with different inline branches.
python3 benchmarks/code-analysis-rust-inherent-functions/run.py \
--cli archify/bin/archify.mjs --samples-root /fixed/samples --out /runs/sourceUse #1264's CLI and --expect baseline for the parent; use the extracted ZIP entrypoint for package replay. Three checks and three questions exit 0; the paired task remains partial/exit 1. Checks deliberately use --fail-on never, not a claim that findings are absent. The large regex question preserves 207 calls, 40 included and 167 omitted.
Three raw captures are byte-identical and four questions agree after only install/output path normalization. Historical v1 reader parity also passes. Canonical Node 22.23.3 / zlib 1.3.1-e00f703 builds match all 168 tracked module files. ZIP SHA256 247ddbe320f03c28e9b3f5af4698ae8535c21224615eb45e817c7088ad0b9a3b.
Existing rustc/cargo 1.89.0; declared floor remains 1.71+. No new toolchain or dependency installed. Missing rustc/cargo both exit 2 with extract/rust-unavailable and installation/override guidance. The original acceptance had no RA audit; the separately installed optional component and later real-project LSP comparison are recorded below, without claiming rustc compilation. The legacy shared helper executable caused cross-version output during replay; contents-keyed caches isolate versions and allow identical source/ZIP reuse. Observed current cache: 103,840 KiB including dependencies. Fresh setup/download costs were not controlled; per-command cache-dependent times are recorded without speedup claims.
-
Local: full six-language module suite 380/380 and Rust 14/14, zero skips; core smoke 19/19 and release identity pass. Runtime commit
1a1f6677e; later commits only freeze replay/evidence and archive. - Package: extracted Rust/question/change selection 42/42, zero skips; source/ZIP questions, paired references, exit statuses and v1 reader parity pass.
- Remote: final-head CI 42410170694 completed success at20ce8f32ad9002c408abeb11a6fedec539aba004. Both full-regression and browser shards, WebM, ZIP freshness, maintained Node lanes, three-platform package jobs and both Windows lanes passed. Deployment jobs skipped. The actual Code Analysis module job reports 380/380 passed, zero skips.
- Integration: Draft, not Labs/approved/merged/released/installed. Original PRs remain separately owned.
Next: independently grade additional source candidates, investigate generic/type-alias owner paths, and retain Go's 37 known compiler-confirmed method misses alongside the JS/TS/Python/Java source-backed backlog.
After this Draft evidence was frozen, the optional official rust-analyzer1.89.0 component was installed into the existing stable toolchain (executable35,248,592 bytes; rust-src was already present). Audit-only copies use separately generated Cargo.lock files because the fixed originals contain none; default offline setup initially failed for an uncached automod dependency, so explicit lock generation/fetch was needed. Further LSP definition comparisons are in progress, with check-on-save, build scripts and proc macros disabled. These setup facts are separate from the Draft's earlier no-new-toolchain acceptance. The independent audit is now complete; results and limits follow below.
Immutable scripts, audit locks, exact query/target rows, effective settings and costs. Every returned declaration selection lies inside the expected captured function range. The two known generic Map misses are independently located under both profiles (four observations); they remain product misses. A deliberately wrong bytes target for string::Regex::new is rejected by the grader. Neither control is added to product accuracy denominators.
RA prefers CARGO_HOME/bin/cargo, so both proxy entrypoints are guarded; effective checkOnSave/buildScripts/procMacro settings are verified disabled. Metadata is locked/offline, and build/check/test/Cargo rustc requests are blocked, with direct rustc cfg fallback. Offline stdlib metadata lacks cc1.2.0 and retries no-deps; this is recorded, not a full compiler environment claim. Twenty-three crate archives were observed downloading during setup (1,000,993 cached compressed bytes); this reused existing caches and is not a fresh-install cost measurement. Raw replay timings are not comparable to full product analysis.
This follow-up changes no shipped runtime file or ZIP byte. The earlier runtime-head CI remains successful; evidence-head CI42412123205 completed success at1788ace7a692586332bdb7ceabf17ec8eab3d54e. The actual analysis job reports 380/380 passed, zero skips; all executed jobs passed and deployments skipped. The optional RA audit is a separate local replay, not a CI-executed comparison. No approval, formal merge, release or live installation.