14 Commits
Author SHA1 Message Date
Attila Prokai 18f7b43c99 lazy: refuse an instance whose data section failed to index
A data section indexes its instances from its own constructor, through
addLazyInstance(), under the section id it WILL be given - and
lazyFileReader::initP21() registers the section only afterwards, and only
if its scan succeeded. A section that fails part way therefore leaves
every instance it had already indexed naming a section that does not
exist.

typeFromFile() then indexes _dataSections with it unconditionally, and
loadInstance() does the same behind an assert() that Release compiles
out. On an empty vector that is an access violation. sourceRecord()
already makes exactly this test; the other two now make it too and answer
0 with a diagnostic, as they already do for an instance found in no
section.

The instances stay in the index - totalInstanceCount() still counts them
and getInstances() still lists them. What changes is that asking for one
of them fails the way every other unloadable instance fails.

Reachable from a thirteen-line file, added as test/lazy_broken_section.stp
and checked by the lazy_index test: a DATA section holding one instance
and then a line that is not one. Without the two changes below it, that
test dies with SIGSEGV inside typeFromFile().

Note that the new break in loadInstance() leaves `inst` null, and
isNilSTEPentity( 0 ) is false, so the null would be cached as a loaded
instance were it not for the guard added in "lazy: do not cache a null
instance as a loaded one" earlier in this branch. With the bounds test
alone the process survives the two calls and then dies on the way out.
2026-08-21 19:50:42 +02:00
Clifford Yapp 18e16bc6ed Fixes for Clang compilation
Some of the strings being generated with ap242 were bigger than
the compiler could guarantee to support, and there were a few other
minor adjustments.
2026-08-07 14:20:19 +00:00
Clifford Yapp d962ea0381 Bound lazy schema warnings per file
Materializing each instance repeated the same FILE_SCHEMA warning.
Keep a thread-safe claim flag on the lazy file reader so concurrent
loads and multiple DATA sections report the ambiguity once per input
file.
2026-08-03 12:47:01 -04:00
Clifford Yapp deefe3442d Expose lazy complex component types
Preserve the component keyword vector already parsed while indexing a
complex Part 21 instance, and expose it through a read-only lazy manager
API.  This lets clients interpret complex instances without reparsing raw
source text or materializing the SDAI graph.
2026-08-03 00:40:19 -04:00
Clifford Yapp 84fa417d0d Whoopes, missed header changes 2026-08-02 03:35:10 -04:00
Clifford Yapp 0e091f0de7 lazy: index Edition 1 SCOPE records
Handle nested SCOPE constructs and export lists while indexing Part 21
records, preserving scope-owned source records and their references.
Add scoped-record coverage.
2026-08-01 22:27:46 -04:00
Clifford Yapp 9005894a16 lazy: allow explicit materialization type aliases
Permit callers to map known, attribute-compatible source keywords
during object creation while preserving the original keyword in the
lazy index.
2026-08-01 22:27:46 -04:00
Clifford Yapp d69363b85e lazy: expose exact indexed source records
Retain record extents during indexing and provide stream-safe access
to an instance's original Part 21 record without materializing it.
2026-08-01 22:27:46 -04:00
Clifford Yapp 6d7e383ed2 lazy: account for resident source record bytes
Track indexed record bounds and expose the source-byte footprint of
materialized instances in cache statistics. Avoid promoting batch-owned
cache hits during reference resolution.
2026-08-01 22:27:46 -04:00
Clifford Yapp 66e696471c lazy: detect cyclic instance materialization
Track in-progress instance loads and report recursive references
instead of recursing indefinitely through a cyclic Part 21 graph.
2026-08-01 22:27:46 -04:00
Clifford Yapp 844a380d4c lazy: recognize Part 21 comments while scanning
Skip comments as opaque text during token searches so quoted text
and string-control sequences within a comment cannot affect indexing.
2026-08-01 22:27:46 -04:00
Clifford Yapp 9b233ac6ca lazy: add indexed Part 21 instance materialization
Add a lazy Part 21 reader and instance manager that index records
and resolve SDAI instances on demand. Include diagnostics, cache
management, reference indexes, and baseline coverage for lazy reads.
2026-08-01 22:27:46 -04:00
copilot-swe-agent[bot]andstarseeker 6bbd46007c Address build issues in judySArray and judyS2Array
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
2025-12-05 14:01:08 -05:00
Clifford Yapp d824fc0c4e Keep longer directory names
We want to be consistent with the previous layout, to avoid needlessly
breaking existing codes.  The header update means client codes are not
required to include all of the stepcode library includes explicitly -
i.e., stepcode itself does not force this requirement with its own
internal includes.  However, if client codes do not want to add the
library prefixes to their own includes as we have for stepcode, they
should still be able to add the various includes and work as before.
Adjust the include directory names accordingly.
2022-10-02 17:57:57 -04:00