geom.context green
- Layer
- 2
- Upstream lines
- 355
- Functions
- 30
- Rust module
geom::context
Status history
- todo 355 lines
- green 355 lines
Source: crates/solidcore/src/geom/context.rs
Upstream: source/SMLib/inc/SmContext.h, source/SMLib/inc/SmTopoTypes.h, source/SMLib/src/SmContext.cpp, source/SM_API/src/SmApiGeneral.cpp
Port-plan notes
These notes preserve historical port measurements and limitations, not current CI results.
green: 2013 difftest cases (13 fixtures + 2000 generated scripts), 0 deferred, all bit-identical; wired UNPORTED(geom.context) in geom.tol (Option<&Context> overloads; geom.tol stays green). 30 fns; largest: SmNewMarkAndLock::LockMark, SmNewMarkAndLock::UnlockMark, SmContext::NewMark, SmContext::SmContext; entry points: SmApiCreateContext, SmApiGetOrCreateContext; unit-SCC #22 (220 units); 320 upstream test entry points reach this unit CO-PORTED in topology.brep_p3 (PR #204): Context::take_notify_callbacks (lends a context's callbacks to another, for the healer's tracked edits), Context::new_geometry_key and GEOMETRY_KEY_BASE (no upstream member: upstream notifies geometry objects by pointer; the context hands out their notification keys, from 0xffff << 48 up, unique for its lifetime, so the callbacks it holds never see two geometry objects under one key). Report unchanged. UPDATE (PR #204, Codex re-check of 98fec50f): new_geometry_key is replaced by Context::geometry_identity (GeometryIdentity: key plus the issuing context's domain token, an Arc<GeometryDomainToken> compared by Arc::ptr_eq only; a foreign identity is re-keyed in this context's domain) and is_reserved_key; GEOMETRY_KEY_BASE is now 0b11 << 62 (both top bits), a range caller keys must stay out of. UPDATE (PR #204, Codex re-check of d61f8d48): Context::geometry_identity, GeometryIdentity and take_notify_callbacks are replaced by kernel-issued identities: a per-object IdentitySlot (filled only by the crate, empty on Clone), Context::geometry_key / brep_serial / brep_serial_of (pub(crate)) issuing geometry keys (GEOMETRY_KEY_BASE) and B-rep serials (1..=MAX_BREP_SERIAL; topology keys at TOPOLOGY_KEY_BASE) from the context's identity domain, and NotifyLease (take_notify_lease / restore_notify_lease) lending the callbacks together with that domain; is_reserved_key covers both ranges (KERNEL_KEY_BASE). Report unchanged. UPDATE (PR #204, overseer ruling on the 9129d9f2 reviews): Context::brep_serial_of is removed (a source B-rep is named by the caller's source_key) and issued_brep_serial is pub(crate); Context::lend_notify (pub(crate)) lends the callbacks and domain for a crate edit and marks the context lent until restore_notify_lease, refusing (InvalidInput, geom::context::lend_notify) a nested lend before anything moves; a lent context issues no identity (geometry_key / brep_serial refuse). take_notify_lease / restore_notify_lease docs state the domain boundary (an unreturned lease leaves a new domain; restore drops the target's own callbacks). UPDATE (PR #204, Opus review of 255d52b7): take_notify_lease / restore_notify_lease return Result and refuse while a crate edit has lent the context (InvalidInput, before anything moves); crate lending helpers use pub(crate) take_lease / install_lease. with_notification_context (from #283's merge_p4) lends through lend_notify and returns Result. CO-PORTED in sweep.topology_sweep: NotificationScope restores notification leases on unwind; share_geometry_sequence allocates future geometry keys across store contexts without changing their identity domains.
Goldens
This is committed inventory, not a runtime result or a correctness proof. A golden records what solidcore produced when blessed. Current results require the canonical CI gate, not these counts.
- Golden records
- 2,013
- Stored error outcomes
- 0
- Stored deferrals
- 0
- Stored harness rejections
- 0
- Known-failure entries
- 0
Metadata counts describe fields in the stored records; they are not passes or live failures.
Source at f9704ee3b:
golden JSONL ·
known-failure list.
Dependencies
Depends on: none
Soft dependencies: geom.tol green
Dependents: blend.fillet_executive_p1 green blend.fillet_executive_p2 green blend.fillet_executive_p3 partial boolean.merge_p3 green boolean.merge_p4 green geom.object green heal.heal_data_p3 green heal.stitch_p1 green intersect.ray_tracer green offset.offset_executive_p2 partial primitive.primitive_creation_p1 green query.face_p4 green sweep.topology_sweep green topology.brep_p1 green topology.brep_p2 green topology.brep_p3 partial topology.brep_p4 green topology.brep_p6 green topology.brep_p9 green topology.topology green
Soft dependents: blend.fillet_geom_p1 green blend.fillet_geom_p6 green blend.hcr green boolean.api_brep partial boolean.topology_intersector_p1 green curve.crv_in_volume green curve.crv_on_surf green heal.heal_data_p1 green heal.stitch_p2 green intersect.curve_class_p9 green mass.integrator partial nurbs.b_spline_curve_p3 green primitive.api_curves green primitive.api_primitives green primitive.primitive_creation_p2 green primitive.primitive_creation_p3 green surface.surface_p1 green surface.unbend_volume green surface.volume_p1 green sweep.api_brep partial sweep.api_surfaces green topology.brep_p10 green topology.brep_p5 green topology.brep_p7 green topology.edge green topology.face_p1 green topology.face_p2 partial topology.face_p4 green topology.shell green topology.topology_traverser green topology.trimming_tools green topology.vertex green
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
SmContext::GetDoingBoolean | SmContext.h:331 | 1 | [Context::doing_boolean] |
SmContext::GetDoingBooleanRef | SmContext.h:332 | 1 | [Context::doing_boolean_mut] |
SmContext::GetUserNotifyCallback | SmContext.h:333 | 1 | [Context::user_notify_callback] |
SmContext::GetSysNotifyCallback | SmContext.h:335 | 1 | [Context::sys_notify_callback] |
SmContext::GetThisModelSizeEstimate | SmContext.h:347 | 4 | [Context::this_model_size_estimate] |
SmContext::SetThisModelSizeEstimate | SmContext.h:355 | 5 | [Context::set_this_model_size_estimate] |
SmContext::SetThisLargeSmallSizeRatio | SmContext.h:360 | 2 | [Context::set_this_large_small_size_ratio] |
SmContext::SetDoingBoolean | SmContext.h:369 | 1 | [Context::set_doing_boolean] |
SmContext::SetSysNotifyCallback | SmContext.h:372 | 4 | [Context::set_sys_notify_callback] |
SmNewMarkAndLock::SmNewMarkAndLock | SmContext.h:485 | 21 | Context::new_mark (private) |
SmNewMarkAndLock::SmNewMarkAndLock | SmContext.h:509 | 23 | Context::new_mark (private) |
SmNewMarkAndLock::SmNewMarkAndLock | SmContext.h:534 | 6 | Context::new_mark (private) |
SmNewMarkAndLock::~SmNewMarkAndLock | SmContext.h:542 | 15 | [MarkLock::release] |
SmNewMarkAndLock::GetMarkType | SmContext.h:559 | 1 | [MarkLock::mark_type], [MarkLock::mark_type1], [MarkLock::mark_type2] |
SmNewMarkAndLock::GetMarkType1 | SmContext.h:560 | 1 | [MarkLock::mark_type], [MarkLock::mark_type1], [MarkLock::mark_type2] |
SmNewMarkAndLock::GetMarkType2 | SmContext.h:561 | 1 | [MarkLock::mark_type], [MarkLock::mark_type1], [MarkLock::mark_type2] |
SmNewMarkAndLock::GetContext | SmContext.h:563 | 1 | [MarkLock::context] |
SmNewMarkAndLock::NewMark | SmContext.h:568 | 8 | [MarkLock::new_mark] |
SmNewMarkAndLock::SetContext | SmContext.h:578 | 21 | [MarkLock::set_context] |
SmNewMarkAndLock::SetContext | SmContext.h:600 | 23 | [MarkLock::set_context] |
SmMassPropertyBehavior::SmMassPropertyBehavior | SmTopoTypes.h:280 | 13 | [MassPropertyBehavior] |
SmContext::SmContext | SmContext.cpp:161 | 30 | [Context::new], [Context::default] |
SmContext::GetCurrentMark | SmContext.cpp:305 | 18 | [Context::current_mark] |
SmContext::NewMark | SmContext.cpp:331 | 30 | Context::new_mark (private) |
SmContext::IsMarkLocked | SmContext.cpp:367 | 13 | [Context::is_mark_locked] |
SmNewMarkAndLock::LockMark | SmContext.cpp:387 | 34 | lock_mark, unlock_mark (private) |
SmNewMarkAndLock::UnlockMark | SmContext.cpp:428 | 32 | lock_mark, unlock_mark (private) |
SmNewMarkAndLock::GetUnlockedMark | SmContext.cpp:496 | 28 | unlocked_mark (private) |
SmApiCreateContext | SmApiGeneral.cpp:42 | 7 | [create_context] |
SmApiGetOrCreateContext | SmApiGeneral.cpp:56 | 9 | [get_or_create_context] |
Module file-header table (41 rows)
| Rust | Upstream |
|---|---|
[Context] | SmContext |
[Context::new], [Context::default] | SmContext::SmContext(double, double) (no SM_USE_GLOBAL_CACHE) |
[Context::doing_boolean] | SmContext::GetDoingBoolean |
[IdentitySlot], [NotifyLease], [Context::take_notify_lease], [Context::restore_notify_lease], [KERNEL_KEY_BASE], [TOPOLOGY_KEY_BASE], [GEOMETRY_KEY_BASE], [MAX_BREP_SERIAL], [is_reserved_key] | (none: kernel-issued notification identities; CO-PORTED by topology.brep_p3) |
Context::share_geometry_sequence (crate) | store-owned allocation of geometry notification keys |
[Context::doing_boolean_mut] | SmContext::GetDoingBooleanRef |
[Context::set_doing_boolean] | SmContext::SetDoingBoolean |
[Context::user_notify_callback] | SmContext::GetUserNotifyCallback |
[Context::set_user_notify_callback] | SmContext::SetUserNotifyCallback (unused upstream) |
[Context::sys_notify_callback] | SmContext::GetSysNotifyCallback |
[Context::user_notify_callback_mut], [Context::sys_notify_callback_mut] | the same getters, for Execute |
[NotifyCallback], [NotifyCallback::execute] | SmNotifyCallback, SmNotifyCallback::Execute |
[NotifyCallback::owner_link] | (none: the GetOwner() / GetEdge() a callback reads) |
[Context::set_sys_notify_callback] | SmContext::SetSysNotifyCallback |
[Context::this_model_size_estimate] | SmContext::GetThisModelSizeEstimate |
[Context::set_this_model_size_estimate] | SmContext::SetThisModelSizeEstimate (inline, SM_USE_OLDTOL build) |
[Context::set_this_large_small_size_ratio] | SmContext::SetThisLargeSmallSizeRatio |
[Context::this_zone_tol_3d] | SmContext::m_sThisZoneTol3d (GetThisZoneTol3d, unused upstream) |
[Context::stored_model_size_estimate], [Context::stored_large_small_size_ratio] | the raw members m_dThisModelSizeEstimate, m_dThisLargeSmallSizeRatio |
[Context::current_mark] | SmContext::GetCurrentMark |
[Context::is_mark_locked] | SmContext::IsMarkLocked |
Context::new_mark (private) | SmContext::NewMark (private, friend SmNewMarkAndLock) |
[MarkType] | SmMarkType |
[MarkLock] | SmNewMarkAndLock |
[MarkLock::new] | SmNewMarkAndLock(const SmContext*, SmBitArray) |
[MarkLock::new_pair] | SmNewMarkAndLock(SmContext*, SmContext*) |
[MarkLock::unbound], [MarkLock::default] | SmNewMarkAndLock() |
[MarkLock::release] | SmNewMarkAndLock::~SmNewMarkAndLock |
[MarkLock::mark_type], [MarkLock::mark_type1], [MarkLock::mark_type2] | GetMarkType, GetMarkType1, GetMarkType2 |
[MarkLock::context] | SmNewMarkAndLock::GetContext |
[MarkLock::context2] | SmNewMarkAndLock::GetContext2 |
[MarkLock::new_mark] | SmNewMarkAndLock::NewMark |
[MarkLock::set_context] | SmNewMarkAndLock::SetContext(SmContext*, SmMarkType) |
[MarkLock::set_context_pair] | SmNewMarkAndLock::SetContext(SmContext*, SmContext*) |
lock_mark, unlock_mark (private) | SmNewMarkAndLock::LockMark, UnlockMark |
unlocked_mark (private) | SmNewMarkAndLock::GetUnlockedMark |
[with_mark_lock] | the scoped { SmNewMarkAndLock sMarkLock(pContext, mask); ... } idiom |
[Context::claim_mark], [SharedMarkLock] | the same idiom in a const query (SmNewMarkAndLock(const SmContext*, mask)) |
[MassPropertyBehavior] | SmMassPropertyBehavior (and its constructor) |
[create_context] | SmApiCreateContext |
[get_or_create_context] | SmApiGetOrCreateContext |
Upstream tests reaching this unit
prog_test:my_test_crv_projected_max, prog_test:my_test_extent3d, prog_test:my_test_vector2d, prog_test:my_test_surface_closest_point, prog_test:my_test_drop_point, prog_test:my_test_matrix