Repository navigation
Add STC - #10
Merged
Merged
Add STC#10
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
Add C's astRemoveRegions as a package-private removeRegions() on Mapping (mapping.c: the Mapping itself), overridden in Region (a copy of the current Frame), Frame (narrowed return type), CmpMap, TranMap, RateMap, SwitchMap, CmpFrame and FrameSet, each following its C file's RemoveRegions, with unchanged components shared as C's clones are. Convert the remove_regions oracle (9 of 11 cases; the NormMap cases are skipped) and add remove_regions_extra_probe.c for the nesting it does not cover; translate remove_regions_from_frameset, remove_regions_unit_passthrough and check_remove_regions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
Port jniast's SelectorMap from selectormap.c, with Rust selectormap.rs as the guide: copies of the Regions, C's Transform (each Region negated and its Closed reversed in place, both put back and so left set), Equal (Invert not compared), MapMerge (a simplified Region found by identity; the neighbour inverted, compared with Equal and inverted back), Copy, Dump (later Regions written without their Frame) and the loader (later Regions given the first Region's FrameSet), with C's constructor messages. selectormap_probe.c pins the indices for overlapping, negated, unbounded and open Regions, the dump after a transformation, simplification, the pairs in series (two equal 1-D SelectorMaps both forward merge into a UnitMap in C), the loads and the constructor's errors. Translate test_selectormap.rs, the SelectorMap tests of test_switchmap.rs (testswitchmap.c section 3 included), the SelectorMap cases of the equal, rate and object ID oracles, a_selectormap_needs_regions_in_one_frame, jniast's AstTest.testSwitchMap and the two SelectorMap cases of remove_regions_extra_probe.c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
Remove from the deferred lists the entries whose only missing class was SelectorMap: 10 each of full-dumps, read-warnings and serialisation, 8 each of simplify and simplify-cases, and the 25 Rust tests now translated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
region.c's Dump writes Negate, Fill, MeshSz, Closed and Adapt from the Region class's own fields where they are set, through its static Test and Get functions, and asks the class's accessor only for an unset value. Region.dump now does the same, so a PointList with Closed set writes the value set rather than the opposite of Negated, and a class that reads these attributes from elsewhere writes its own settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
Port stc.c and stcresourceprofile.c with Rust's stc.rs as the guide: an abstract Stc that encapsulates a copy of a Region (or, given an Stc, its encapsulated Region mapped into the Frame it represents), forwards its geometry, Negated, Closed, MeshSize and FillFactor to it, holds copies of its AstroCoords KeyMaps mapped into its Frame, and dumps, loads, copies, compares and simplifies as C's does; jniast's plain AstroCoords class and its package-private converters; and StcResourceProfile. As C's Transform and GetBounded do, an Stc sets its encapsulated Region's Negated to the value it has around the call, leaving it set. A dump without the Region or a Coord<n> item, where C stores a null and crashes later, and a "Begin Stc" of the abstract class, which C reads, are AST__LDERR. The region_stc oracle runs its StcResourceProfile cases; the fitted Error Ellipse's axis ends are left out of the comparison and its half-lengths compared instead. stc_probe.c pins the rest against C. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
Remove from the deferred lists the entries whose only missing class was StcResourceProfile: cap_timemap_02 from full-dumps, read-warnings, serialisation and simplify (2 each) and simplify-cases (1); and the three Rust tests of test_region_stc_oracle.rs now translated in full. stc_matches_c, whose StcResourceProfile cases now run, stays listed for the other Stc classes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
StcSearchLocation, StcCatalogEntryLocation and StcObsDataLocation, with StcObsDataLocation's observatory position (written as ObsLoc only when present, copied in a copy, shared by the package-private setObs, not compared). Region.cast copies a Region into the class of any Region it is an instance of. RegionStcOracleTest runs every oracle case, the Full = 1 dumps and C's dumps read back; stc_probe gains checkStcObsDump, the observatory position and Stcs of different classes; jniast's StcTest.testConstructors is translated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
docs/c-library-bugs.md lists the bugs found while porting that are still present at the pinned C (3d3f255f) and at the tip of PR #104 (1d0714fb), each with its C location at both, what happens, the consequence for a caller, what Java does and a reproducer in docs/c-library-bugs/, which build.sh compiles with ASan and UBSan against a C build. rust-c-differences.md now says which PR #104 commits fix the PermMap and CmpMap simplification bugs, the phase 7 and 8 reports point at the new file, and CLAUDE.md says where a C library bug goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DidLSPfwbAELCxqtcAbPhR
timj
force-pushed
the
u/timj/phase8-stc
branch
from
December 3, 2026 17:26
8ae43ff to
aaccb32
Compare
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.
No description provided.