(refactor): rename internals to match evolved architecture#18
Merged
(refactor): rename internals to match evolved architecture#18
Conversation
…d named constants Tier 1 renames to match evolved architecture after Phase 3/5 optimizations: - _mark_untracked! → _record_type_touch! (records per-type bitmask, not a boolean) - _untracked_fixed_masks → _touched_type_masks (struct field) - _untracked_has_others → _touched_has_others (struct field) Add named constants replacing magic hex literals: - _LAZY_MODE_BIT (0x8000), _TYPED_LAZY_BIT (0x4000) - _MODE_BITS_MASK (0xC000), _TYPE_BITS_MASK (0x00FF)
Tier 2 renames for checkpoint/rewind mode functions: - _depth_only_checkpoint! → _lazy_checkpoint! - _dynamic_selective_rewind! → _lazy_rewind! - _typed_checkpoint_with_lazy! → _typed_lazy_checkpoint! - _typed_selective_rewind! → _typed_lazy_rewind! - _generate_dynamic_selective_*_call → _generate_lazy_*_call Replace magic hex (0x8000, 0x4000, 0xC000, 0x00FF) with named constants.
Apply Tier 1 + Tier 2 renames to CUDA extension: - Struct fields, function overrides, imports, and magic numbers - Float16 special handling preserved (bit 7 reassignment)
- Update imports, function calls, field refs, and string assertions in tests - Update architecture docs with new function names and diagrams - Add naming_refactor_proposal.md as design record
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18 +/- ##
=======================================
Coverage 96.46% 96.46%
=======================================
Files 9 9
Lines 1273 1273
=======================================
Hits 1228 1228
Misses 45 45
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors internal naming around the pool state machine to match the current “lazy first-touch + selective rewind” architecture, and replaces hard-coded mode/type bit literals with named constants across CPU and CUDA implementations.
Changes:
- Renames the internal “untracked” terminology to “type touch” throughout state tracking, acquire wrappers, macros, and tests.
- Renames dynamic-selective / typed-fallback mode helpers to the new “lazy” naming scheme and updates macro codegen accordingly.
- Introduces
_LAZY_MODE_BIT,_TYPED_LAZY_BIT,_MODE_BITS_MASK, and_TYPE_BITS_MASKand wires them through CPU + CUDA paths.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/types.jl |
Adds named mode/type bit constants; renames pool fields to _touched_*. |
src/state.jl |
Renames lazy/typed-lazy helpers; updates rewind/checkpoint internals to use new fields/constants. |
src/acquire.jl |
Renames _mark_untracked! → _record_type_touch! and updates recording + lazy first-touch logic. |
src/convenience.jl |
Updates convenience APIs to call _record_type_touch!. |
src/macros.jl |
Updates macro codegen to emit _lazy_checkpoint!/_lazy_rewind! and typed-lazy fallback names. |
ext/AdaptiveArrayPoolsCUDAExt/types.jl |
Mirrors CPU field renames in CUDA pool type. |
ext/AdaptiveArrayPoolsCUDAExt/state.jl |
Mirrors CPU rename/constants in CUDA checkpoint/rewind and lazy helpers. |
ext/AdaptiveArrayPoolsCUDAExt/acquire.jl |
Updates CUDA type-touch recording override and mode-bit checks. |
test/test_state.jl |
Updates state tests for new field/function names and mode-bit expectations. |
test/test_macro_internals.jl |
Updates macro internal/runtime-correctness tests to new helper names. |
test/test_macro_expansion.jl |
Updates expansion-string assertions to new helper names. |
test/test_backend_macro_expansion.jl |
Updates backend expansion tests to new helper names. |
docs/src/architecture/macro-internals.md |
Updates architecture docs terminology and examples to new names. |
docs/design/naming_refactor_proposal.md |
Adds RFC/proposal doc (currently contains pre-rename “current” names). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mgyoo86
referenced
this pull request
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames internal functions, struct fields, and magic numbers to accurately reflect their current behavior after the Phase 3 (dynamic-selective) and Phase 5 (typed-fallback) optimizations.
Before these optimizations,
_mark_untracked!simply flagged that an acquire happened outside@with_poolvisibility. Now it precisely records which type was touched (via per-type bitmask), enabling selective rewind of only the affected pools. The old names were misleading; this PR aligns naming with actual semantics.Rename Map
Tier 1: Core Renames
_mark_untracked!_record_type_touch!_untracked_fixed_masks_touched_type_masks_untracked_has_others_touched_has_othersTier 2: Mode Functions
_depth_only_checkpoint!_lazy_checkpoint!_dynamic_selective_rewind!_lazy_rewind!_typed_checkpoint_with_lazy!_typed_lazy_checkpoint!_typed_selective_rewind!_typed_lazy_rewind!_generate_dynamic_selective_*_call_generate_lazy_*_callTier 2: Named Constants (replacing magic hex literals)
Scope