mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-04 08:21:50 -04:00
T10.c1: progress/readability read the newest phase census; README Types at P38 close
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
type_census — 2026-10-01T01:07:38Z at c5591de124 (src stamp 287e6f521d908e6d, tool 17a2928ffd); 7306 files (4121 TUs + 3181 headers), 99109 function definitions; walk 43.7 s, total 232.7 s
|
||||
|
||||
DEFINITIONS 1650 struct/union bodies (+0 enums): canonical header 1021 · .c file-scope 0 · .c block-scope 600 · per-function shared headers 29 · other headers 0 · include/ 326
|
||||
1024 distinct names · 523 distinct layouts (0 unresolved) · 53 duplicate classes covering 496 names (tier 1 0 same-named, tier 2 53 opaque; 44 layout-twin classes / 472 names kept apart) · 42 exact-text classes / 546 copies · 0 VARIANT names (>1 layout) · 56 dead canonical names · 0 canonical names redefined in .c · 4300 scalar/alias typedefs · 145 forward decls
|
||||
CAST SITES deref 502983 = P 408974 + I 60666 + X 13800 + M 19543 (+ A address-of 18892; + C typed cast-member 36853) in 69492 bodies · coverage OK (raw {'P': 408974, 'I': 60666, 'X': 13800, 'A': 18892, 'C': 36853, 'M': 19543}) · refused 0 · absolute 0 · readability regex over raw text 411816
|
||||
by base: param 276840 · local 149900 · gaddr 40123 · nested 24076 · global 8861 · other 1677 · addr-of 1350 · ident 156
|
||||
by width: s4 145146 · u2 142772 · s2 131805 · u1 43174 · agg 13475 · p4 12018 · u4 11164 · s1 3429
|
||||
top bases: a0(param) 92255 · param_1(param) 81578 · arg0(param) 67704 · p(local) 18039 · p(param) 11784 · s0(local) 10368 · cach(local) 8246 · s1(local) 7137 · buf(local) 7060 · flag(local) 5453 · *(s32 *)(a0 + 0x20)(nested) 5215 · iVar2(local) 5160 · dst(local) 4874 · iVar1(local) 4836 · iVar3(local) 4693 · e(local) 3918
|
||||
DECLARATIONS 99109 function definitions (1894 K&R) · 4279260 extern function declarations over 12088 names (3773 spelled >1 way) · 6413 names with >1 body text · 1078766 data externs over 55542 symbols (18498 typed >1 way) · asm-label aliases 5148 (159 names) · builtins {'memcpy': 301, 'abs': 1} · attributes {'packed': 26, 'aligned': 6}
|
||||
lying declarations 229 over 24 callees {'K&R-empty': 216, 'narrow': 13} · K&R sites (marked, counted apart) 5293 over 200 callees · cross-binary (the fleet's definitions disagree, this binary has none) 418 over 96 callees
|
||||
STRUCT MAP 19122 types explain 498863/502983 deref sites (99.2 %); unassigned 4120; 4046 types span ≥2 bodies (440088 sites), 15076 single-body; types with conflicts 857, suspect 11
|
||||
merges by evidence {'param': 38862, 'assign': 16777, 'ret-of': 4334, 'arg': 10823, 'return': 1524, 'assign&': 1183, 'arg&': 270, 'field': 9896}; vetoed {'arg-conduit': 115274, 'ret-of-multisource': 6678, 'assign-multisource': 33062, 'arg&-conduit': 14636, 'field-multisource': 7008, 'ret-of': 675, 'assign&-multisource': 12102, 'arg&-no-overlap': 3455, 'assign': 347, 'arg-no-overlap': 43617, 'assign&': 337, 'arg': 182, 'return': 12, 'field': 3224}
|
||||
Unkstruct_800B5CB8 sites 107580 bodies 11184 fields 134 size≥0x10c width-conflicts 50 sign-mixed 55 merges {'param': 9704, 'assign': 8078, 'arg': 7080, 'field': 2622} at D_800B5CB8,D_800D3888,D_80181448 ptr D_8006386C,D_80074778,D_80074780
|
||||
Unkstruct_80126B58 sites 65397 bodies 17047 fields 175 size≥0x24c width-conflicts 50 sign-mixed 60 merges {'param': 2102, 'arg': 1087, 'assign&': 106, 'field': 51} at D_80126B58 ptr D_80126B58
|
||||
Unkstruct_cb638a45 sites 6477 bodies 381 fields 6 size≥0x10 width-conflicts 0 sign-mixed 0 merges {'param': 10, 'arg': 4}
|
||||
Unkstruct_dac960ce sites 4464 bodies 124 fields 13 size≥0x24c width-conflicts 0 sign-mixed 2 merges {'param': 2}
|
||||
Unkstruct_0caecd54 sites 4340 bodies 124 fields 23 size≥0xfe width-conflicts 0 sign-mixed 1 merges {'param': 2, 'assign': 1, 'return': 1}
|
||||
Unkstruct_f8ed2b9f sites 4061 bodies 4061 fields 1 size≥0x217 width-conflicts 0 sign-mixed 0 merges {'param': 2}
|
||||
Unkstruct_a32b99a1 sites 3936 bodies 123 fields 8 size≥0x4b width-conflicts 0 sign-mixed 1 merges {}
|
||||
Unkstruct_8e3dbe51 sites 3930 bodies 131 fields 5 size≥0x4c width-conflicts 0 sign-mixed 1 merges {}
|
||||
Unkstruct_8014A1B0 sites 3778 bodies 542 fields 13 size≥0xfe width-conflicts 0 sign-mixed 1 merges {'field': 13, 'arg': 10, 'param': 10, 'return': 1}
|
||||
Unkstruct_80128EA8 sites 3311 bodies 632 fields 18 size≥0x38 width-conflicts 0 sign-mixed 13 merges {'arg': 23, 'ret-of': 19, 'field': 7, 'param': 2}
|
||||
Unkstruct_57a28935 sites 3271 bodies 196 fields 26 size≥0xa4 width-conflicts 3 sign-mixed 9 merges {'param': 268, 'arg': 133}
|
||||
Unkstruct_1fa9e810 sites 3144 bodies 131 fields 3 size≥0x49 width-conflicts 0 sign-mixed 0 merges {}
|
||||
GLOBAL BLOCKS 2124 runs of ≥4 adjacent scalar D_ symbols (14253 symbols): 0x800cf10c+0x34 ×29 (D_800CF10C..D_800CF13C) · 0x800a6580+0x3a ×27 (D_800A6580..D_800A65B8) · 0x801998a4+0x57 ×24 (D_801998A4..D_801998FA) · 0x80199840+0x56 ×23 (D_80199840..D_80199895) · 0x801a9608+0x50 ×22 (D_801A9608..D_801A9654) · 0x801ab708+0x54 ×21 (D_801AB708..D_801AB758) · 0x801b0df0+0x4b ×21 (D_801B0DF0..D_801B0E3A) · 0x801b83a0+0x4e ×21 (D_801B83A0..D_801B83ED)
|
||||
PARKED (P36) 24 classes / 453 bodies / 691 needed sites → .run/P38/census/parked.tsv; needs {'signature': 13, 'struct': 7, '?': 4}; 22 PARK names are minimum-lever banks
|
||||
CONTROLS 4/4: player_block_widths OK (D_80078E8C:4/4 D_80078EB2:2/2 D_80078EB4:2/2 D_80078EB6:2/2 D_80078EB8:2/2 D_80078F08:4/4 D_80078F0C:4/4) · matrix_layouts OK (MATRIX=32 MATRIX_L48=48) · prim_layout_class OK (defs in 1 files, 1 spellings, 1/1 in one layout (64 B)) · tu_conflict_D_800A651C OK (s32:1202 | u8[]:9 | OtBlk[]:9 | OtBlk_80016450[]:8 | s32[]:7)
|
||||
|
||||
duplicate-layout classes (top 12): 4B×56 names (0 defs): B4_80165140, B4_8017F154, B4_8018750C, B4_8018AD9C… | 8B×46 names (0 defs): Blk8S16, Blk8_80126940, Blk8_80180A38, D_80195AF4_t… | 8B×45 names (0 defs): B8, B8_17F474, B8_80165140, B8_801851A8… | 8B×34 names (0 defs): Args_80182194, Blk8017FD54, Blk8_801A6AD0, Blk8_801AD914… | 20B×32 names (0 defs): Blk20_8017D110, Buf8017BF34_8017BF34, Buf8017BF50_8017C234, Loc_80180E10… | 16B×28 names (0 defs): Blk16X, Blk16_8017ECD4, Blk16_8018A4C4, Blk16_8018A8B8… | 6B×25 names (0 defs): D80190448_t, Pt6_8017D65C, ResMapCol, S6… | 32B×25 names (0 defs): Blk20_8016DF5C, Blk20_80180B78, Blk20_80184694, Blk32L_80133298… | 8B×22 names (22 defs): B8014, Blk8_80133CD4, Blk8_801463A0, Blk8_8017FF80… | 12B×19 names (19 defs): Blk12, Prim126, PrimC59C, PrimC974… | 8B×14 names (0 defs): CdFileLoc, Cmd_801805C8, M8_8016B6BC, Pair8_8017DDC4… | 4B×14 names (0 defs): D_801D0660_s, Ent_80186AE4, P4, Pair4_801B02DC…
|
||||
VARIANT names (top 12):
|
||||
|
||||
type_census: 1650 definitions (523 layouts, 53 duplicate classes, 0 variant camps) · 502983 cast sites in 69492 bodies over 8 base classes (4 forms + A, coverage OK) · 229 lying declarations / 24 callees (+5293 K&R sites, +418 cross-binary apart) · controls 4/4
|
||||
struct_map: 19122 types over 19122 clusters explain 498863/502983 sites (99.2 %); 4120 unassigned sites; 857 types with conflicts
|
||||
@@ -18,18 +18,18 @@ originals; nothing "functionally equivalent" counts. What the repository claims
|
||||
<!-- progress:begin -->
|
||||
| Metric | Matched | Of | % |
|
||||
|---|---:|---:|---:|
|
||||
| Functions byte-identical (all binaries) | 363,680 | 363,680 | 100.00% |
|
||||
| Functions byte-identical (all binaries) | 363,677 | 363,677 | 100.00% |
|
||||
| Instructions byte-identical (instruction-weighted) | 13,492,113 | 13,492,113 | 100.0% |
|
||||
| Distinct code byte-identical (each body once) | 5,820,205 | 5,820,205 | 100.0% |
|
||||
| Main executable game code (excl. Sony objects) | 45,150 | 45,150 | 100.0% |
|
||||
|
||||
218 binaries rebuild byte-identical from source · 350,533 functions in C (251,920 of them shared bodies via 3,173 dedup groups) · 1,256 Sony PsyQ library functions linked from the SDK objects, not our C · 27 hand-written-assembly bodies kept verbatim · 8 Sony library routines carried as assembly where no SDK object matched · 0 assembly stubs left · 0 non-matching functions.
|
||||
218 binaries rebuild byte-identical from source · 350,530 functions in C (251,924 of them shared bodies via 3,173 dedup groups) · 1,256 Sony PsyQ library functions linked from the SDK objects, not our C · 27 hand-written-assembly bodies kept verbatim · 8 Sony library routines carried as assembly where no SDK object matched · 0 assembly stubs left · 0 non-matching functions.
|
||||
|
||||
One source per unique function (Phase 35): 102,998 function bodies written once in C (3,173 of them shared headers instantiated 262,590 times); 143 duplicate copies remain in 45 ledgered classes (declaration conflicts left for the types phase); 38 functions whose bytes vary per binary share one text through the text tier (2,030 sites); 1,668 same-address copies of 381 tiny bodies inside the cross-address classes are deferred to the names phase.
|
||||
One source per unique function (Phase 35): 102,991 function bodies written once in C (3,173 of them shared headers instantiated 262,594 times); 139 duplicate copies remain in 41 ledgered classes (declaration conflicts left for the types phase); 38 functions whose bytes vary per binary share one text through the text tier (2,030 sites).
|
||||
|
||||
Levers off (Phase 36, snapshot 2026-09-29): 1,868 register pins and 1,862 asm statements remain in 1,838 functions (662 distinct bodies), 3,730 of them marked `// !FAKE:`; 1,589 volatile qualifiers and 50 bare `register` keywords are censused; 6,447 GTE coprocessor operations and 22 whole-body assembly routines kept inside C shells (2,682 sites; the original's scratchpad stack-switch trampolines, one copy per overlay, listed in the verbatim manifest) are not levers and are excluded.
|
||||
|
||||
Types (Phase 37, snapshot 2026-09-13): 502,985 raw pointer-cast dereferences remain in 69,493 functions (four forms; 36,681 typed cast-member accesses and 18,888 address-of casts counted apart); 7,255 struct definitions (1,179 in the canonical header, 5,989 inside `.c` files) over 527 distinct layouts, 206 duplicate classes covering 2,823 names; 1,796 call declarations narrower than their callee's definition over 76 callees; the struct map clusters the cast sites into 18,213 types by evidence (99.2 % of sites assigned).
|
||||
Types (snapshot P38, 2026-10-01): 502,983 raw pointer-cast dereferences remain in 69,492 functions (four forms; 36,853 typed cast-member accesses and 18,892 address-of casts counted apart); 1,650 struct definitions (1,021 in the canonical header, 326 in `include/`, 600 block-scope frames inside `.c` functions, 29 in per-function shared headers, 0 at `.c` file scope) over 1,024 names and 523 distinct layouts; 53 duplicate classes covering 496 names, 53 of them listed with a cause in `docs/struct-twins.md` (0 gating); 0 variant camps, 0 dead names (3 kept with a cause), 0 `pad<SIZE>` names, 0 parse-error declarations; 229 lying call declarations (an empty K&R list or a type narrower than the callee's definition) over 24 callees; the struct map clusters the cast sites into 19,122 types by evidence (99.2 % of sites assigned).
|
||||
|
||||
_Generated by `tools/progress.py --readme` from `docs/progress.json` — numbers are never typed by hand._
|
||||
<!-- progress:end -->
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
# cross-binary collapsible-byte leverage: docs/duplicates.cross.md.
|
||||
|
||||
# THREE progress metrics (all matter — see the labels):
|
||||
FLEET fn-count byte-ident: 363680 / 363680 = 100.00% (REAL+LINKED+empties; FUNCTION-count, ×134-inflated — one crack counts per overlay)
|
||||
FLEET fn-count byte-ident: 363677 / 363677 = 100.00% (REAL+LINKED+empties; FUNCTION-count, ×134-inflated — one crack counts per overlay)
|
||||
FLEET instr-weighted : 13492113 / 13492113 = 100.0% (shipped .text across main + resident + 216 overlays; the decomp.dev-DISPLAY number)
|
||||
FLEET distinct-code(uniq): 5820205 / 5820205 = 100.0% (90984/90984 unique fns; the DISTINCT-RE number)
|
||||
MAIN game-code weighted : 45150 / 45150 = 100.0% (INCLUDED in the fleet numbers above since 2026-07-22 — roadmap §1 metrics contract; build-derived sig (make sig-main) dated 2026-09-29; boundaries INDEPENDENTLY VERIFIED since P31 S77 — `make sig-main-oracle` + `make audit-corpus`: 0 phantom, 0 truncated, 0 pad-tail)
|
||||
(fleet EXCLUDING main, for continuity with pre-2026-07-22 readings: 13446963 / 13446963 = 100.0%)
|
||||
|
||||
FLEET REAL substantive : 350533 (of which dedup-shared 251920 via 3173 groups / 262590 instances)
|
||||
FLEET REAL substantive : 350530 (of which dedup-shared 251924 via 3173 groups / 262594 instances)
|
||||
FLEET LINKED PsyQ objs : 1256
|
||||
FLEET NON_MATCHING : 0 (0 in any default build — G4)
|
||||
FLEET INCLUDE_ASM stubs : 0
|
||||
FLEET matchable : 363680
|
||||
FLEET matchable : 363677
|
||||
|
||||
| binary | REAL | shared | LINKED | byte-ident | matchable | byte-ident % |
|
||||
|---|---:|---:|---:|---:|---:|---:|
|
||||
@@ -94,7 +94,7 @@ FLEET matchable : 363680
|
||||
| md_SC05_028 | 25 | 3 | 0 | 27 | 27 | 100.0% |
|
||||
| md_SC05_029 | 27 | 3 | 0 | 31 | 31 | 100.0% |
|
||||
| md_SC07_003 | 100 | 0 | 0 | 100 | 100 | 100.0% |
|
||||
| md_SC07_004 | 315 | 0 | 0 | 315 | 315 | 100.0% |
|
||||
| md_SC07_004 | 314 | 0 | 0 | 314 | 314 | 100.0% |
|
||||
| ov_MAIN_012 | 2323 | 1736 | 0 | 2402 | 2402 | 100.0% |
|
||||
| ov_SC01_000 | 2324 | 1762 | 0 | 2403 | 2403 | 100.0% |
|
||||
| ov_SC01_001 | 2385 | 1764 | 0 | 2466 | 2466 | 100.0% |
|
||||
@@ -103,8 +103,8 @@ FLEET matchable : 363680
|
||||
| ov_SC01_006 | 2421 | 1781 | 0 | 2503 | 2503 | 100.0% |
|
||||
| ov_SC01_008 | 2351 | 1763 | 0 | 2428 | 2428 | 100.0% |
|
||||
| ov_SC01_009 | 2433 | 1763 | 0 | 2509 | 2509 | 100.0% |
|
||||
| ov_SC01_074 | 2351 | 1763 | 0 | 2428 | 2428 | 100.0% |
|
||||
| ov_SC01_077 | 2505 | 1762 | 0 | 2586 | 2586 | 100.0% |
|
||||
| ov_SC01_074 | 2350 | 1763 | 0 | 2427 | 2427 | 100.0% |
|
||||
| ov_SC01_077 | 2505 | 1763 | 0 | 2586 | 2586 | 100.0% |
|
||||
| ov_SC01_080 | 2435 | 1766 | 0 | 2514 | 2514 | 100.0% |
|
||||
| ov_SC01_084 | 2497 | 1776 | 0 | 2581 | 2581 | 100.0% |
|
||||
| ov_SC02_000 | 2597 | 1844 | 0 | 2683 | 2683 | 100.0% |
|
||||
@@ -121,7 +121,7 @@ FLEET matchable : 363680
|
||||
| ov_SC02_028 | 2614 | 1784 | 0 | 2703 | 2703 | 100.0% |
|
||||
| ov_SC02_031 | 2479 | 1778 | 0 | 2564 | 2564 | 100.0% |
|
||||
| ov_SC02_035 | 2440 | 1765 | 0 | 2522 | 2522 | 100.0% |
|
||||
| ov_SC02_037 | 2434 | 1755 | 0 | 2516 | 2516 | 100.0% |
|
||||
| ov_SC02_037 | 2434 | 1757 | 0 | 2516 | 2516 | 100.0% |
|
||||
| ov_SC02_039 | 2339 | 1771 | 0 | 2418 | 2418 | 100.0% |
|
||||
| ov_SC02_041 | 2481 | 1765 | 0 | 2563 | 2563 | 100.0% |
|
||||
| ov_SC03_001 | 2776 | 1765 | 0 | 2869 | 2869 | 100.0% |
|
||||
@@ -185,7 +185,7 @@ FLEET matchable : 363680
|
||||
| ov_SC04_008 | 2338 | 2054 | 0 | 2417 | 2417 | 100.0% |
|
||||
| ov_SC04_009 | 2361 | 1763 | 0 | 2443 | 2443 | 100.0% |
|
||||
| ov_SC04_010 | 2341 | 1764 | 0 | 2421 | 2421 | 100.0% |
|
||||
| ov_SC04_011 | 2721 | 1775 | 0 | 2806 | 2806 | 100.0% |
|
||||
| ov_SC04_011 | 2720 | 1775 | 0 | 2805 | 2805 | 100.0% |
|
||||
| ov_SC04_012 | 2342 | 1763 | 0 | 2422 | 2422 | 100.0% |
|
||||
| ov_SC04_015 | 2522 | 1762 | 0 | 2613 | 2613 | 100.0% |
|
||||
| ov_SC04_016 | 2361 | 1767 | 0 | 2442 | 2442 | 100.0% |
|
||||
@@ -230,7 +230,7 @@ FLEET matchable : 363680
|
||||
| ov_SC07_000 | 2440 | 1764 | 0 | 2521 | 2521 | 100.0% |
|
||||
| ov_SC07_001 | 2375 | 1765 | 0 | 2456 | 2456 | 100.0% |
|
||||
| ov_SC07_002 | 2498 | 1769 | 0 | 2581 | 2581 | 100.0% |
|
||||
| ov_SC07_006 | 2379 | 1734 | 0 | 2459 | 2459 | 100.0% |
|
||||
| ov_SC07_006 | 2379 | 1735 | 0 | 2459 | 2459 | 100.0% |
|
||||
| ov_SC07_007 | 2530 | 1745 | 0 | 2614 | 2614 | 100.0% |
|
||||
| ov_SC07_008 | 2309 | 1764 | 0 | 2388 | 2388 | 100.0% |
|
||||
| ov_SC07_009 | 2351 | 1763 | 0 | 2432 | 2432 | 100.0% |
|
||||
|
||||
+59
-47
@@ -4,8 +4,8 @@
|
||||
"binaries": 218,
|
||||
"fleet": {
|
||||
"fn_count": {
|
||||
"matched": 363680,
|
||||
"total": 363680,
|
||||
"matched": 363677,
|
||||
"total": 363677,
|
||||
"pct": 100.0,
|
||||
"what": "functions byte-identical / matchable, every binary (one shared body counts once per overlay it is instantiated in)"
|
||||
},
|
||||
@@ -31,23 +31,23 @@
|
||||
}
|
||||
},
|
||||
"counts": {
|
||||
"real_c_functions": 350533,
|
||||
"dedup_shared_of_real": 251920,
|
||||
"real_c_functions": 350530,
|
||||
"dedup_shared_of_real": 251924,
|
||||
"linked_psyq_objects": 1256,
|
||||
"verbatim_asm_bodies": 27,
|
||||
"sdk_verbatim_bodies": 8,
|
||||
"include_asm_stubs": 0,
|
||||
"non_matching": 0,
|
||||
"matchable": 363680,
|
||||
"matchable": 363677,
|
||||
"dedup_groups": 3173,
|
||||
"dedup_instances": 262590,
|
||||
"unique_function_bodies": 102998,
|
||||
"duplicate_source_copies": 143,
|
||||
"duplicate_source_classes": 45,
|
||||
"dedup_instances": 262594,
|
||||
"unique_function_bodies": 102991,
|
||||
"duplicate_source_copies": 139,
|
||||
"duplicate_source_classes": 41,
|
||||
"text_tier_groups": 38,
|
||||
"text_tier_instances": 2030,
|
||||
"deferred_same_address_texts": 381,
|
||||
"deferred_same_address_copies": 1668,
|
||||
"deferred_same_address_texts": null,
|
||||
"deferred_same_address_copies": null,
|
||||
"levers": {
|
||||
"date": "2026-09-29",
|
||||
"what": "compiler-forcing constructs left in the C: register pins + asm statements (the classes Phase 36 drives to 0; GTE coprocessor ops and whole-body hand-asm routines excluded), with the volatile/register qualifiers censused",
|
||||
@@ -65,35 +65,47 @@
|
||||
"hand_asm_routine_sites": 2682
|
||||
},
|
||||
"types": {
|
||||
"date": "2026-09-13",
|
||||
"head": "bd7d32ec2",
|
||||
"what": "the structs phase's counters: raw pointer-cast dereferences in four forms (P *(T*)(\u2026), I *(T*)ident, X ((T*)e)[i], M M2C_FIELD), struct definitions and their duplicate classes, lying call declarations, and the struct map's types (Phase 37 drives the first three to 0)",
|
||||
"raw_cast_sites": 502985,
|
||||
"date": "2026-10-01",
|
||||
"head": "c5591de124",
|
||||
"snapshot": "P38",
|
||||
"census": ".run/P38/census/type_census.json",
|
||||
"what": "the structs phases' counters: raw pointer-cast dereferences in four forms (P *(T*)(\u2026), I *(T*)ident, X ((T*)e)[i], M M2C_FIELD), struct definitions and their duplicate classes, lying call declarations, and the struct map's types",
|
||||
"definitions_include": 326,
|
||||
"definitions_block_scope": 600,
|
||||
"definitions_fn_headers": 29,
|
||||
"distinct_names": 1024,
|
||||
"duplicate_classes_gating": 0,
|
||||
"duplicate_classes_listed": 53,
|
||||
"dead_names": 0,
|
||||
"dead_names_kept": 3,
|
||||
"pad_names": 0,
|
||||
"parse_error_declarations": 0,
|
||||
"raw_cast_sites": 502983,
|
||||
"raw_cast_forms": {
|
||||
"P": 408978,
|
||||
"I": 60664,
|
||||
"P": 408974,
|
||||
"I": 60666,
|
||||
"X": 13800,
|
||||
"A": 18888,
|
||||
"C": 36681,
|
||||
"A": 18892,
|
||||
"C": 36853,
|
||||
"M": 19543
|
||||
},
|
||||
"raw_cast_bodies": 69493,
|
||||
"address_of_sites": 18888,
|
||||
"typed_cast_member_sites": 36681,
|
||||
"raw_cast_bodies": 69492,
|
||||
"address_of_sites": 18892,
|
||||
"typed_cast_member_sites": 36853,
|
||||
"absolute_address_casts": 0,
|
||||
"struct_definitions": 7255,
|
||||
"canonical_definitions": 1179,
|
||||
"definitions_in_c_files": 5989,
|
||||
"distinct_layouts": 527,
|
||||
"duplicate_classes": 206,
|
||||
"duplicate_names": 2823,
|
||||
"variant_names": 40,
|
||||
"dead_canonical_names": 141,
|
||||
"lying_declarations": 1796,
|
||||
"lying_callees": 76,
|
||||
"asm_label_aliases": 5158,
|
||||
"multi_spelled_callees": 3777,
|
||||
"struct_map_types": 18213,
|
||||
"struct_definitions": 1650,
|
||||
"canonical_definitions": 1021,
|
||||
"definitions_in_c_files": 600,
|
||||
"distinct_layouts": 523,
|
||||
"duplicate_classes": 53,
|
||||
"duplicate_names": 496,
|
||||
"variant_names": 0,
|
||||
"dead_canonical_names": 56,
|
||||
"lying_declarations": 229,
|
||||
"lying_callees": 24,
|
||||
"asm_label_aliases": 5148,
|
||||
"multi_spelled_callees": 3773,
|
||||
"struct_map_types": 19122,
|
||||
"struct_map_explained_pct": 99.2
|
||||
}
|
||||
},
|
||||
@@ -910,11 +922,11 @@
|
||||
},
|
||||
{
|
||||
"binary": "md_SC07_004",
|
||||
"real": 315,
|
||||
"real": 314,
|
||||
"shared": 0,
|
||||
"linked": 0,
|
||||
"byte_identical": 315,
|
||||
"matchable": 315,
|
||||
"byte_identical": 314,
|
||||
"matchable": 314,
|
||||
"instr_matched": 15888,
|
||||
"instr_total": 15888
|
||||
},
|
||||
@@ -1000,18 +1012,18 @@
|
||||
},
|
||||
{
|
||||
"binary": "ov_SC01_074",
|
||||
"real": 2351,
|
||||
"real": 2350,
|
||||
"shared": 1763,
|
||||
"linked": 0,
|
||||
"byte_identical": 2428,
|
||||
"matchable": 2428,
|
||||
"byte_identical": 2427,
|
||||
"matchable": 2427,
|
||||
"instr_matched": 88341,
|
||||
"instr_total": 88341
|
||||
},
|
||||
{
|
||||
"binary": "ov_SC01_077",
|
||||
"real": 2505,
|
||||
"shared": 1762,
|
||||
"shared": 1763,
|
||||
"linked": 0,
|
||||
"byte_identical": 2586,
|
||||
"matchable": 2586,
|
||||
@@ -1181,7 +1193,7 @@
|
||||
{
|
||||
"binary": "ov_SC02_037",
|
||||
"real": 2434,
|
||||
"shared": 1755,
|
||||
"shared": 1757,
|
||||
"linked": 0,
|
||||
"byte_identical": 2516,
|
||||
"matchable": 2516,
|
||||
@@ -1820,11 +1832,11 @@
|
||||
},
|
||||
{
|
||||
"binary": "ov_SC04_011",
|
||||
"real": 2721,
|
||||
"real": 2720,
|
||||
"shared": 1775,
|
||||
"linked": 0,
|
||||
"byte_identical": 2806,
|
||||
"matchable": 2806,
|
||||
"byte_identical": 2805,
|
||||
"matchable": 2805,
|
||||
"instr_matched": 106658,
|
||||
"instr_total": 106658
|
||||
},
|
||||
@@ -2271,7 +2283,7 @@
|
||||
{
|
||||
"binary": "ov_SC07_006",
|
||||
"real": 2379,
|
||||
"shared": 1734,
|
||||
"shared": 1735,
|
||||
"linked": 0,
|
||||
"byte_identical": 2459,
|
||||
"matchable": 2459,
|
||||
|
||||
@@ -5,3 +5,4 @@ date label commit definitions narrow_decls callees kr_empty narrow pinned_rows p
|
||||
2026-09-12 P37 T2 — the census after the audit's parser fixes (attributes, dead guards) da26c05d674085afaa5727006efe6354acfc59ff 15726 98648 1609 91357 7291 33 25 411850 177902 503016 409007 60666 13800 19543 18912 36681 7255 1179 5989 527 206 2823 18760 99.2
|
||||
2026-09-12 t4 274223396dc7b5e7eedd8c8f96c82b0e80738c6a 15653 8830 950 2997 5833 13 10 411848 177902 503013 409006 60664 13800 19543 18912 36681 7255 1179 5989 527 206 2823 18741 99.2 5002 147
|
||||
2026-09-12 t4-close bd7d32ec2316b2a150ad41b0ac9d6da3786dff92 16094 1796 76 1373 423 1 1 411820 177902 502985 408978 60664 13800 19543 18888 36681 7255 1179 5989 527 206 2823 18213 99.2 5262 199 418 96
|
||||
2026-09-30 P38 close c82a24899467ab87461bcdf28f4d320cc309c6a3 16094 229 24 216 13 0 0 411816 176269 502983 408974 60666 13800 19543 18892 36853 1650 1021 600 523 53 496 19122 99.2 5293 200 418 96
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
| 2026-09-12 | P37 T2 — the census after the audit's parser fixes (attributes, dead guards) | `da26c05d6` | 98648 | 91357 | 7291 | 33 | 411850 | 177902 | **503016** | 36681 | 7255 (1179 / 5989) | 527 | 206 / 2823 | 18760 (99.2 %) | — | — |
|
||||
| 2026-09-12 | t4 | `274223396` | 8830 | 2997 | 5833 | 13 | 411848 | 177902 | **503013** | 36681 | 7255 (1179 / 5989) | 527 | 206 / 2823 | 18741 (99.2 %) | 5002 | — |
|
||||
| 2026-09-12 | t4-close | `bd7d32ec2` | 1796 | 1373 | 423 | 1 | 411820 | 177902 | **502985** | 36681 | 7255 (1179 / 5989) | 527 | 206 / 2823 | 18213 (99.2 %) | 5262 | 418 |
|
||||
| 2026-09-30 | P38 close | `c82a24899` | 229 | 216 | 13 | 0 | 411816 | 176269 | **502983** | 36853 | 1650 (1021 / 600) | 523 | 53 / 496 | 19122 (99.2 %) | 5293 | 418 |
|
||||
|
||||
**How to read it.** A *lying declaration* is a call site whose in-scope declaration names fewer parameters
|
||||
than the callee's own definition. It is not a style problem: on this processor an argument travels in a
|
||||
|
||||
+28
-10
@@ -1174,16 +1174,29 @@ def fleet():
|
||||
except Exception:
|
||||
_lev = None
|
||||
# Phase 37 T1: the type census (tools/type_census.py) — the struct debt, the declaration debt and the struct map, published until 0 (R75)
|
||||
# P38 T10: read the CURRENT phase's census — the newest .run/P<N>/census/type_census.json by numeric N (was: a P37 literal)
|
||||
_typ = None
|
||||
try:
|
||||
import json as _jt
|
||||
_tj = ROOT / ".run/P37/census/type_census.json"
|
||||
if _tj.exists():
|
||||
_tjs = sorted((int(m.group(1)), q) for q in ROOT.glob(".run/P*/census/type_census.json")
|
||||
if (m := re.fullmatch(r"P(\d+)", q.parent.parent.name)))
|
||||
_tj = _tjs[-1][1] if _tjs else None
|
||||
if _tj is not None:
|
||||
print(f"progress.py: types from {_tj.relative_to(ROOT)}", file=sys.stderr)
|
||||
_ts = _jt.loads(_tj.read_text())["summary"]
|
||||
_d, _c, _dc, _sm = _ts["definitions"], _ts["casts"], _ts["decls"], _ts["struct_map"]
|
||||
_d, _c, _dc, _sm, _st = _ts["definitions"], _ts["casts"], _ts["decls"], _ts["struct_map"], _ts.get("structs") or {}
|
||||
# pad<SIZE> names + parse-error declarations are --check-structs' inputs (restruct's audit + ledger), not in the json
|
||||
import type_census as _tcm
|
||||
_pad, _, _perr, _, _ = _tcm.check_structs_inputs()
|
||||
_typ = {"date": _ts.get("when", "")[:10], "head": _ts.get("head"),
|
||||
"what": "the structs phase's counters: raw pointer-cast dereferences in four forms (P *(T*)(…), I *(T*)ident, X ((T*)e)[i], M M2C_FIELD), "
|
||||
"struct definitions and their duplicate classes, lying call declarations, and the struct map's types (Phase 37 drives the first three to 0)",
|
||||
"snapshot": _tj.parent.parent.name, "census": str(_tj.relative_to(ROOT)),
|
||||
"what": "the structs phases' counters: raw pointer-cast dereferences in four forms (P *(T*)(…), I *(T*)ident, X ((T*)e)[i], M M2C_FIELD), "
|
||||
"struct definitions and their duplicate classes, lying call declarations, and the struct map's types",
|
||||
"definitions_include": _d["in_include"], "definitions_block_scope": _d["in_c_block_scope"],
|
||||
"definitions_fn_headers": _d["in_shared_fn_headers"], "distinct_names": _d["distinct_names"],
|
||||
"duplicate_classes_gating": _st.get("dup_classes"), "duplicate_classes_listed": _st.get("twins_listed"),
|
||||
"dead_names": _st.get("dead"), "dead_names_kept": _st.get("dead_kept"),
|
||||
"pad_names": _pad, "parse_error_declarations": _perr,
|
||||
"raw_cast_sites": _c["deref_total"], "raw_cast_forms": _c["by_form"], "raw_cast_bodies": _c["bodies"],
|
||||
"address_of_sites": _c["addr_form"], "typed_cast_member_sites": _c["typed_cast_member"], "absolute_address_casts": _c["abs_casts"],
|
||||
"struct_definitions": _d["total"], "canonical_definitions": _d["canon"], "definitions_in_c_files": _d["in_c_file_scope"] + _d["in_c_block_scope"],
|
||||
@@ -1306,13 +1319,18 @@ def readme_block(d):
|
||||
f"{c['levers']['register_keyword_sites']:,} bare `register` keywords are censused; {c['levers']['gte_sites']:,} GTE coprocessor "
|
||||
f"operations and {c['levers']['hand_asm_routines_in_c_shells']} whole-body assembly routines kept inside C shells "
|
||||
f"({c['levers']['hand_asm_routine_sites']:,} sites; the original's scratchpad stack-switch trampolines, one copy per "
|
||||
f"overlay, listed in the verbatim manifest) are not levers and are excluded."] if c.get("levers") else []) + ([f"", f"Types (Phase 37, snapshot {c['types']['date']}): {c['types']['raw_cast_sites']:,} raw pointer-cast dereferences remain in "
|
||||
f"overlay, listed in the verbatim manifest) are not levers and are excluded."] if c.get("levers") else []) + ([f"", f"Types (snapshot {c['types'].get('snapshot', 'P37')}, {c['types']['date']}): {c['types']['raw_cast_sites']:,} raw pointer-cast dereferences remain in "
|
||||
f"{c['types']['raw_cast_bodies']:,} functions (four forms; {c['types']['typed_cast_member_sites']:,} typed cast-member accesses and "
|
||||
f"{c['types']['address_of_sites']:,} address-of casts counted apart); {c['types']['struct_definitions']:,} struct definitions "
|
||||
f"({c['types']['canonical_definitions']:,} in the canonical header, {c['types']['definitions_in_c_files']:,} inside `.c` files) over "
|
||||
f"{c['types']['distinct_layouts']:,} distinct layouts, {c['types']['duplicate_classes']:,} duplicate classes covering "
|
||||
f"{c['types']['duplicate_names']:,} names; {c['types']['lying_declarations']:,} call declarations narrower than their callee's "
|
||||
f"definition over {c['types']['lying_callees']:,} callees; the struct map clusters the cast sites into {c['types']['struct_map_types']:,} "
|
||||
f"({c['types']['canonical_definitions']:,} in the canonical header, {c['types']['definitions_include']:,} in `include/`, "
|
||||
f"{c['types']['definitions_block_scope']:,} block-scope frames inside `.c` functions, {c['types']['definitions_fn_headers']:,} in per-function "
|
||||
f"shared headers, {c['types']['definitions_in_c_files'] - c['types']['definitions_block_scope']:,} at `.c` file scope) over "
|
||||
f"{c['types']['distinct_names']:,} names and {c['types']['distinct_layouts']:,} distinct layouts; {c['types']['duplicate_classes']:,} duplicate classes covering "
|
||||
f"{c['types']['duplicate_names']:,} names, {c['types']['duplicate_classes_listed']:,} of them listed with a cause in `docs/struct-twins.md` "
|
||||
f"({c['types']['duplicate_classes_gating']:,} gating); {c['types']['variant_names']:,} variant camps, {c['types']['dead_names']:,} dead names "
|
||||
f"({c['types']['dead_names_kept']:,} kept with a cause), {c['types']['pad_names']:,} `pad<SIZE>` names, {c['types']['parse_error_declarations']:,} "
|
||||
f"parse-error declarations; {c['types']['lying_declarations']:,} lying call declarations (an empty K&R list or a type narrower than the callee's "
|
||||
f"definition) over {c['types']['lying_callees']:,} callees; the struct map clusters the cast sites into {c['types']['struct_map_types']:,} "
|
||||
f"types by evidence ({c['types']['struct_map_explained_pct']} % of sites assigned)."] if c.get("types") else []) + [
|
||||
"", f"_Generated by `tools/progress.py --readme` from `docs/progress.json` — numbers are never typed by hand._",
|
||||
README_END]
|
||||
|
||||
@@ -59,13 +59,20 @@ def counts():
|
||||
# Phase 37 T1 (2026-09-12): the type census's columns — the four dereference forms (the CAST regex above sees one of them, over raw
|
||||
# text), the typed cast-member accesses (the MEMBER regex counts these as members — they are the rewrite's rung 1, not finished
|
||||
# members), the struct definitions and their duplicate classes, the struct map. A snapshot REFUSES a stale census (R43/R51).
|
||||
cj = REPO / ".run/P37/census/type_census.json"
|
||||
# P38 T10: the CURRENT phase's census — the newest .run/P<N>/census/type_census.json by numeric N (was: a P37 literal)
|
||||
cjs = sorted((int(m.group(1)), q) for q in REPO.glob(".run/P*/census/type_census.json")
|
||||
if (m := re.fullmatch(r"P(\d+)", q.parent.parent.name)))
|
||||
head = subprocess.run(["git", "rev-parse", "HEAD"], cwd=REPO, capture_output=True, text=True).stdout.strip()
|
||||
if not cj.exists():
|
||||
if not cjs:
|
||||
sys.exit("readability_progress: no type census — run `tools/type_census.py -j 16` first (its columns are part of the row)")
|
||||
cj = cjs[-1][1]
|
||||
print(f"readability_progress: census {cj.relative_to(REPO)}", file=sys.stderr)
|
||||
ts = json.loads(cj.read_text())["summary"]
|
||||
if not head.startswith(ts.get("head", "?")):
|
||||
sys.exit(f"readability_progress: the type census is STALE (census {ts.get('head')} vs HEAD {head[:9]}) — rerun tools/type_census.py")
|
||||
# fresh = taken at HEAD, or over the same src/ tree (lever_census.src_stamp: path|size|mtime of every .c/.h) — a docs-only commit
|
||||
# after the census does not stale it
|
||||
import lever_census
|
||||
if not head.startswith(ts.get("head", "?")) and ts.get("src_stamp") != lever_census.src_stamp():
|
||||
sys.exit(f"readability_progress: the type census is STALE (census {ts.get('head')} vs HEAD {head[:9]}, src stamp differs) — rerun tools/type_census.py")
|
||||
c, d, sm = ts["casts"], ts["definitions"], ts["struct_map"]
|
||||
out.update(deref_all=c["deref_total"], form_P=c["by_form"].get("P", 0), form_I=c["by_form"].get("I", 0), form_X=c["by_form"].get("X", 0),
|
||||
form_M=c["by_form"].get("M", 0), addr_form=c["addr_form"], typed_cast_member=c["typed_cast_member"],
|
||||
|
||||
Reference in New Issue
Block a user