solidcore

Units / geom

geom.context green

Layer
2
Upstream lines
355
Functions
30
Rust module
geom::context

Status history

Oct 12Nov 25
  1. todo 355 lines
  2. 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 functionDefined atLinesRust (from the file header)
SmContext::GetDoingBooleanSmContext.h:3311[Context::doing_boolean]
SmContext::GetDoingBooleanRefSmContext.h:3321[Context::doing_boolean_mut]
SmContext::GetUserNotifyCallbackSmContext.h:3331[Context::user_notify_callback]
SmContext::GetSysNotifyCallbackSmContext.h:3351[Context::sys_notify_callback]
SmContext::GetThisModelSizeEstimateSmContext.h:3474[Context::this_model_size_estimate]
SmContext::SetThisModelSizeEstimateSmContext.h:3555[Context::set_this_model_size_estimate]
SmContext::SetThisLargeSmallSizeRatioSmContext.h:3602[Context::set_this_large_small_size_ratio]
SmContext::SetDoingBooleanSmContext.h:3691[Context::set_doing_boolean]
SmContext::SetSysNotifyCallbackSmContext.h:3724[Context::set_sys_notify_callback]
SmNewMarkAndLock::SmNewMarkAndLockSmContext.h:48521Context::new_mark (private)
SmNewMarkAndLock::SmNewMarkAndLockSmContext.h:50923Context::new_mark (private)
SmNewMarkAndLock::SmNewMarkAndLockSmContext.h:5346Context::new_mark (private)
SmNewMarkAndLock::~SmNewMarkAndLockSmContext.h:54215[MarkLock::release]
SmNewMarkAndLock::GetMarkTypeSmContext.h:5591[MarkLock::mark_type], [MarkLock::mark_type1], [MarkLock::mark_type2]
SmNewMarkAndLock::GetMarkType1SmContext.h:5601[MarkLock::mark_type], [MarkLock::mark_type1], [MarkLock::mark_type2]
SmNewMarkAndLock::GetMarkType2SmContext.h:5611[MarkLock::mark_type], [MarkLock::mark_type1], [MarkLock::mark_type2]
SmNewMarkAndLock::GetContextSmContext.h:5631[MarkLock::context]
SmNewMarkAndLock::NewMarkSmContext.h:5688[MarkLock::new_mark]
SmNewMarkAndLock::SetContextSmContext.h:57821[MarkLock::set_context]
SmNewMarkAndLock::SetContextSmContext.h:60023[MarkLock::set_context]
SmMassPropertyBehavior::SmMassPropertyBehaviorSmTopoTypes.h:28013[MassPropertyBehavior]
SmContext::SmContextSmContext.cpp:16130[Context::new], [Context::default]
SmContext::GetCurrentMarkSmContext.cpp:30518[Context::current_mark]
SmContext::NewMarkSmContext.cpp:33130Context::new_mark (private)
SmContext::IsMarkLockedSmContext.cpp:36713[Context::is_mark_locked]
SmNewMarkAndLock::LockMarkSmContext.cpp:38734lock_mark, unlock_mark (private)
SmNewMarkAndLock::UnlockMarkSmContext.cpp:42832lock_mark, unlock_mark (private)
SmNewMarkAndLock::GetUnlockedMarkSmContext.cpp:49628unlocked_mark (private)
SmApiCreateContextSmApiGeneral.cpp:427[create_context]
SmApiGetOrCreateContextSmApiGeneral.cpp:569[get_or_create_context]
Module file-header table (41 rows)
RustUpstream
[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