Repository navigation
Preserve Module subclass identity in included_modules - #326
Conversation
…ils1-included-module-identity
284km
left a comment
There was a problem hiding this comment.
Reviewed exact head c6875b61bdb42cac86e15a988313b9e3d916473b against main 8e7572369f099d78b818f98f9791107786a7c57f, including the clean prospective integration tree b2fee3b614e71599cc3ef7bdb2d4292212423606. No new actionable finding.
Using the existing backing-module-to-instance mapping keeps included_modules consistent with ancestor and method-owner reflection. Corpus 955 usefully covers overridden equality and duplicate-validator avoidance, alongside ordinary and nested module controls. The inherited dispatch changes are the already-reviewed #317 dependency; its current head remains unmerged.
Independent validation:
- Fresh ordinary O2 builds of the exact head, current main, and prospective integration, with pinned Mere
9dec2ff687a08433247dbdb7729bc19c8522e538and mgz661a01d8bb68f5acd68e3192bd47f081d179c436. No runtime binary reuse. The exact head's generated C SHA-256 also matches the attached runtime record. - Corpus 942–944 and 955, eleven existing Module/reflection/native-super/sender cases, and an additional identity probe: head 64/64 and integration 64/64 comparisons match clean Ruby 4.0.10 (revision
a704b7cd95a42cc0cf5f307137bf3aac0285b915, Prism 1.8.2), checking stdout, stderr and exit status across evaluator/VM and hash index ON/OFF with tight GC. Main passes all 44 existing-case comparisons and reproduces the differences in the four new files and identity probe. The probe also covers inherited inclusion, extension, class/module dup and clone, returned-array mutation, and identity after GC. - All eight source gates pass on head and integration; generated-C bracket depth is 155/1024 on both. Explicit hygiene for the four added records and diff whitespace checks pass.
- Audited the attached Rails record's equal before/after file inventories and source hashes, per-case results, and six bounded RSS replays. These remain author-provided measurements; I did not rerun Rails, the full corpus/unit suite, or platform/resource acceptance.
Hosted CI is not all passing: unittest-harness and both runtime-load-path jobs fail because their corpus fixtures do not supply the new sh_cls_var statistics. The same failure is present in main's hosted load-path run and independently reproduces on current main and this prospective integration (two failures in each load-path run and both harness subcases). The exact PR head passes those focused harness controls and all six local load-path tests. The relevant fixture/check code has no net integration delta, so these failures are retained as baseline evidence rather than attributed to this diff.
Linux build is still executing; macOS build/reference and other coverage remain queued or incomplete. Current main CI 45775704307 is pending and its jobs endpoint returns an empty inventory. The recorded hold_all_merges / new_failure_review_required remains active for already-reviewed PRs as well. No merge or queue exception is taken; #317 must also land first. COMMENT because this is the authenticated user's own PR.
|
The separate CI fixture follow-up #334 is now merged on main as Three alternating pairs pass after the fixture fix: harness 21/0 and load-path 8/0; unchanged main reproduces 21/2 and 6/2. Extra controls verify that missing or oversized statistics rows stop before reference corpus execution. Real corpus --both is 973/973; VM 973 / 0 fallback / 0 differences; all nine current source gates, bracket check and explicit record hygiene pass. Code and records were pushed together once. The follow-up review found no issue. The #317 prerequisite and the recorded merge hold remain separate; this comment does not request a merge exception. |
|
Checked the later completed corpus job at reviewed head The preceding stages pass: corpus 977/977 with hash index ON/OFF; VM 977 / 0 fallback / 0 failures; vm_check 246/246; snippet comparison 460/0. Whole-file ISeq comparison reports 976 same / 1 different / 0 errors, with that one known metadata difference. This hosted merge-cohort count is separate from the exact-head local 970-program acceptance in the description. Both review bodies and inline comments have been checked again; no actionable review finding remains. This PR is already Ready for review. The #317 dependency and the owner’s recorded merge hold remain in effect. |
…ils1-included-module-identity
|
Updated head: Merged main ActiveModel acceptance validation improves 9 MATCH / 1 RED → 10 MATCH / 0 RED on evaluator and VM; the complete TimeWithZone file stays 174 MATCH / 0 RED. All files COMPLETE, no bounds events. Three fixed-seed RSS pairs for both files and their variation are recorded. The initial four-worker VM run stalled in the reference Ruby FIFO case498. Only that owned reference process was terminated, and its failed replay is retained separately. The isolated reference/evaluator/VM program matches; the fresh complete VM replay passes with Measured runtime |
284km
left a comment
There was a problem hiding this comment.
Re-reviewed updated head 4f3ad87 against freshly fetched main b9ca06d, including the previous review, follow-ups, inherited #317 changes and new records. No new actionable finding. The original-instance mapping still provides the intended identity/equality behavior, and the no-backing hook fast path sets its flag at both backing creation and copying.
Independent Darwin arm64 validation:
- Corpus 942–944/955 and 11 neighboring Module/reflection/sender/native-super files: 60/60 comparisons match clean Ruby 4.0.10 in stdout/stderr/status across evaluator/strict VM and hash index ON/OFF with tight GC.
- An additional probe using module_eval to define methods matches in all 4 configurations: included-hook receiver identity, inherited inclusion, returned-array mutation, Module-subclass dup/clone, extension, GC lifetime and ordinary hooks before/after backing creation. The initial probe instead defined the method inside the Module-subclass new block and failed. A separate minimal control reproduces that existing constructor-block method-definition gap on current main and head, both engines; the initial failure is retained and excluded from passing totals, not attributed to this PR.
- Unchanged upstream test_module selection (module_subclass_initialize, included_modules_with_prepend, ancestors, included_modules): reference, main evaluator/VM and head evaluator/VM each pass 4 tests / 13 assertions, no skips or lost passing case. This is selected-case acceptance, not whole-file acceptance.
- The earlier fixture failure is addressed: harness 21/21 and load-path 8/8 pass locally. Hosted unittest-harness now also passes. Nine source gates, fresh generated-C bracket depth 155/1024 and diff whitespace pass.
- Reused the recorded O2 binary 0f51e0123391f18e2a9cd3b3148d49fec425c910a0b953b989ba1a26dc9a0ba6 after comparing 685 tracked runtime/build inputs against the clean build checkout and verifying imported pinned mgz inputs. The measured runtime 17f4f95 differs from this head only in four Markdown/JSON records. Fresh emission using clean pinned Mere 9dec2ff6 reproduces the recorded C digest. Current-main control inputs were independently compared against all 687 corresponding runtime/build files. No fresh runtime compilation is claimed.
Audited the refreshed Rails records: matching before/after file and case inventories, COMPLETE results, original 600-second/2-GiB family bounds, and explicitly separate native-install provenance. The initial FIFO VM replay failure is retained separately from its successful serial replay. These full-sweep/Rails/RSS results remain author-provided evidence; I did not rerun full suites or resource/platform acceptance.
The prospective merge is source-clean (tree 4fd04e9c4003078a952adaca21d755fdf9aff9f2); no integration binary was tested. No merge: prerequisite #317 remains open, build-linux is executing the C API comparison, macOS build/reference jobs are unassigned with zero steps, and downstream coverage is incomplete. Main CI 45916943242 is pending with an empty job inventory. The recorded all-merge/new-failure-review hold also applies to already-reviewed candidates and remains active; these conditions are not covered by the queue exception. COMMENT because the authenticated account owns this PR.
284km
left a comment
There was a problem hiding this comment.
Review of 4f3ad87f. No Critical/Major/Minor findings. mod_vclasses now returns the Module-subclass instance itself (mod_inst_self) instead of its internal backing class, so included_modules shows the identity ActiveModel compares against. The fresh current-main corpus (1012/1012, VM 0 fallback) is posted, and #317, which this sits on, is merged first. The review bot reviewed this head with no findings, and the test merge with current main is clean.
Module#included_modules returned an internal backing module for a Module-subclass instance. Return the original instance so ActiveModel recognizes its existing validator module and avoids adding another copy. Corpus955 covers identity, ordinary modules and nested/prepend controls.
Merged current main29016cb8 and the #317 prerequisite with its no-hook optimization. Measured runtime
17f4f9586b93745c6a56daf41d18cd21a34906fd; comparison runtimed0336e573a7040a3768ab5816925b83c09a13fb9already includes #317, so the identity change is isolated. Ordinary O2, Mere9dec2ff6 / mgz661a01d8. Clean Ruby4.0.10 viatools/ref_ruby.sh, revision a704b7cd95a42cc0cf5f307137bf3aac0285b915, Prism1.8.2, no extra gems.-j 1fresh full replay): 1012 VM / 0 fallback / 0 differences.Related test_module selection, all modes COMPLETE with no lost passing case; no whole-file acceptance is claimed:
Targeted Rails files, all sides COMPLETE without bounds events:
Max RSS, KiB, three alternating full-file evaluator pairs, seed12345, 600s / 2GiB per family, jobs2, MT_CPU=0:
The initial four-worker VM replay stalled in reference Ruby on the FIFO in corpus498. Its owner terminated only that reference process; the initial 1011 VM / 0 fallback / 1 FAIL result remains in the record. The isolated reference/evaluator/VM program matches, and a fresh complete VM replay with -j 1 passes. The successful corpus --both and Rails measurements use the same unchanged runtime.
RSS varies; no stable memory improvement is claimed. Native extensions explicitly reused from runtime63213030 / binary c7800ad2; measured and installing binary digests are separate in the record. These are targeted files, not a new full-component run.
Evidence:
railstest/framework/records/activemodel-included-module-identity.jsonandloop/2026-11-27-codex-rails1-included-module-identity.md. Historical acceptance remains pinned to its original record commit. #317 must land first.Final head
4f3ad87f6af485c641665a10268bc70e3e48e2c9incorporates #317 head095b6b1fafter acceptance. The diff from the measured runtime contains only the four Markdown/JSON records; all runtime/build inputs and the measured binary remain unchanged.