51 Commits
Author SHA1 Message Date
Clifford Yapp aba9111ff6 Make generated output content-stable
Write generated files to sibling temporary files and replace a target
only when content differs.  Track owned paths in a versioned manifest
and remove obsolete generated files without touching unrelated files.
Strip generator source paths from output and add regression coverage.

Treat nonliteral aggregate bounds as expression records instead of
reading an inactive integer union member.  This also removes process
addresses that made packed AP242 output nondeterministic.

On AP242e4, an identical generation changes zero of ten generated
source/header timestamps and leaves the 390-byte manifest unchanged.
The following CMake build falls from 2.01 to 0.06 seconds and peak RSS
from 118,108 to 18,432 KiB.  Generation remains 0.40 seconds.

The NIST AP242e4 sample still creates and validates all 10,609
instances with no errors or warnings and writes the same 949,685-byte
semantic result.
2026-08-02 07:42:16 -04:00
Clifford Yapp 5b0085612f Add structural metadata profile for API v2
Keep full descriptor metadata as the default and add an opt-in
structural profile for conversion-oriented late-bound API v2 users.
Strip descriptive and constraint text while retaining the complete
runtime descriptor graph.  Pass the profile through CMake and correct
the scanner's compact late-bound file lists.

AP242e4 full-to-structural measurements:

Generated output falls from 54,839 lines and 3,304,007 bytes to
29,993 lines and 1,525,897 bytes.  The packed schema source shrinks
68.1%.  The schema DSO falls from 2,178,296 to 720,120 bytes, and peak
compile RSS drops 6.8%.  File count and 49 ELF relocations are
unchanged.

The NIST AP242e4 sample still creates and validates all 10,609
instances with no errors or warnings and writes the same 949,685-byte
semantic result.  Twenty read/write runs improve from 4.76 to 4.71
seconds and peak RSS falls from 82,276 to 78,900 KiB.
2026-08-02 07:27:08 -04:00
Clifford Yapp 0c81351efd Use generic late-bound values and bounded headers
Construct SELECT, enumeration, and aggregate values from descriptors so
compact output needs no generated type classes or factories.  Preserve
enumeration elements and renamed schema items in the packed image.

Make each public schema header independently includable through the small
SchemaModule interface.  Keep runtime and model declarations internal.

AP242e4 output falls from 865 to 10 files and clean compile/link time
falls from 18.71 to 1.21 seconds.  The schema DSO falls from 3,503,352
to 2,178,296 bytes, with ELF relocations falling from 9,620 to 49.
2026-08-02 07:16:26 -04:00
Clifford Yapp 87bfb7929d Pack the complete API v2 descriptor graph
Replace late-bound descriptor procedures with validated, offset-based
schema and complex metadata images.  Use an explicit per-load context
for reentrant module construction while retaining the version 1
compatibility path.

AP242e4 generated output falls from 9,060,249 to 4,865,657 bytes and
clean compile/link time falls from 41.49 to 18.71 seconds.  The schema
DSO falls from 7,470,304 to 3,503,352 bytes and ELF relocations fall
from 33,221 to 9,620.
2026-08-02 07:04:54 -04:00
Clifford Yapp 43a95a6cf4 Pack API v2 schema module images
Replace generated SchemaModuleSlot pointer arrays with a versioned,
16-byte SchemaModuleImage.  Shared initialization helpers capture
entity, type, and attribute descriptors in stable generated-ID order
and transfer them to SchemaModule without one relocated pointer per
descriptor.

Retain the slot-based initialization entry point for existing API v2
output, and leave API v1 generation unchanged.

For AP242e4, generated output falls from 123,552 to 117,046 lines
(-5.3%) and from 9,804,680 to 9,060,249 bytes (-7.6%).  The schema
module source falls from 808,907 to 64,367 bytes (-92.0%).

The schema DSO falls from 7,728,384 to 7,470,304 bytes (-3.3%), while
ELF relocations fall from 39,719 to 33,221 (-16.4%).  Comparable clean
compile times are unchanged, and paired read/write runs improve by 0.6%.

The real file still creates and validates 10,609 instances with zero
errors and warnings.  Its 949,685-byte rewrite differs only by its
timestamp.
2026-08-02 06:15:25 -04:00
Clifford Yapp 99855789c2 Precompute late-bound entity attribute layouts
Resolve each flattened inherited attribute layout once after schema
initialization.  Late-bound instance construction now follows descriptor
and index records directly instead of recursively traversing supertypes
and repeating derived and redefined attribute name searches.

Keep the cache outside EntityDescriptor so its object layout and API v1
ABI remain unchanged.  Invalidate cached subtype layouts when descriptor
graphs are edited, and retain lazy preparation for non-module callers.

For the AP242e4 sample's most common entity, constructing 1,531,000
DIRECTION instances improved from 0.84s to 0.63s (-25.0%); user time
improved from 0.82s to 0.61s (-25.6%).  Peak RSS increased by 0.9% and
libstepcore grew by 1.6%.  Twenty full read/write runs remained at 4.9s.

The real file still created and validated 10,609 instances with zero
errors and warnings.  Its 949,685-byte rewrite changed only by its
timestamp.
2026-08-02 06:15:25 -04:00
Clifford Yapp 05c6adb716 Complete compact schema modules for API v2
Add stable entity, type, and attribute IDs through SchemaModule.  Make
late-bound compatibility names opt-in, table-drive rules and complex
metadata, and emit entity metadata directly into bounded chunks.

AP242e4 late-bound output changed as follows:

* generated files: 5,719 to 905 (-84.2%)
* generated lines: 254,220 to 123,552 (-51.4%)
* generated bytes: 13,942,523 to 9,804,680 (-29.7%)
* generation wall time: 2.74s to 0.56s (-79.6%)
* compile/link wall time: 157.68s to 37.02s (-76.5%)
* compile/link peak RSS: 593,320 KiB to 199,156 KiB (-66.4%)
* shared library size: 9,956,640 to 7,716,096 bytes (-22.5%)
* read/write wall time: 0.26s to 0.25s

ELF relocations increased from 28,843 to 39,719 due to descriptor-slot
tables.  The packed schema image stage is intended to remove this cost.

The real AP242 sample created and validated 10,609 instances with zero
errors and warnings.  Rewritten output matched except for its timestamp.
2026-08-02 06:15:25 -04:00
Clifford Yapp 6705c0f62b Implemented API v2 table-driven initialization and opt-in late-bound mode
- API v2 table-driven schema, entity, type, attribute, and inheritance
  initialization via include/clstepcore/ schemaInit.h.

- --late-bound/-T, producing descriptor-backed entities without
  generated early-bound entity classes.

- CMake controls:
    - SC_EXP2CXX_API_VERSION=2
    - SC_EXP2CXX_LATE_BOUND=ON

- Runtime late-bound construction and owned attribute storage in
  src/clstepcore/entityDescriptor.cc and src/clstepcore/STEPattribute.cc.

- Documentation and regression coverage, including incompatible option
  handling.

AP242e4 generated-output results:

 Mode                      Lines       Bytes
━━━━━━━━━━━━━━━━━━━━  ━━━━━━━━━━━  ━━━━━━━━━━
 Default v1            1,210,640    57.57 MB
────────────────────  ───────────  ──────────
 API v2 early-bound      509,001    25.20 MB
────────────────────  ───────────  ──────────
 API v2 late-bound       254,123    13.94 MB

The late-bound AP242 library compiled under C++11 and successfully
processed the BRL-CAD NIST sample: 10,609 instances
created and validated, with zero errors and warnings.
2026-08-02 06:15:25 -04:00
Clifford Yapp 6e18e57380 Implemented the first major API v2 scalability feature
Opt in with either:

exp2cxx --api-version 2 schema.exp

or:

cmake -DSC_EXP2CXX_API_VERSION=2 ...

Version 1 remains the default, and the regression test verifies default
output is byte-identical to explicit v1
output.

API v2 now provides:

- Compact SELECT classes backed by shared descriptor-driven runtime code
  instead of repeated generated parsing, assignment, and serialization
  bodies.

- Generic Set* and typed getter APIs in
  include/clstepcore/sdaiSelect.h:109.
- Dependency-bounded entity headers and source-owned dependencies in
  src/exp2cxx/classes_entity.c:968.
- Out-of-line entity creators.
- Unity chunks that no longer include the all-entity header.
- C++11 output; C++17 did not offer enough additional benefit for this
  tranche.

The command-line handling is in src/exp2cxx/fedex_main.c:85, while
compact SELECT generation begins in src/exp2cxx/selects.c:702.

Measured using the BRL-CAD ap242e4.exp, Release builds, eight parallel
jobs, and 64:8 unity chunks:

 Metric                           API v1    Final API v2    Reduction
━━━━━━━━━━━━━━━━━━━━━━━━  ━━━━━━━━━━━━━━━  ━━━━━━━━━━━━━━  ━━━━━━━━━━━
 Generated C++ lines           1,210,640         522,445        56.8%
────────────────────────  ───────────────  ──────────────  ───────────
 Generated bytes              57,566,051      27,202,644        52.7%
────────────────────────  ───────────────  ──────────────  ───────────
 Schema build wall time         183.22 s         88.31 s        51.8%
────────────────────────  ───────────────  ──────────────  ───────────
 Compiler CPU time              641.53 s        378.49 s        41.0%
────────────────────────  ───────────────  ──────────────  ───────────
 Peak RSS                  1,035,112 KiB     916,412 KiB        11.5%
────────────────────────  ───────────────  ──────────────  ───────────
 Object-file bytes            70,472,952      40,031,088        43.2%
────────────────────────  ───────────────  ──────────────  ───────────
 Shared-library text          34,361,400      19,420,467        43.5%
────────────────────────  ───────────────  ──────────────  ───────────
 Generation wall time             1.52 s          0.69 s        54.6%
2026-08-02 06:15:25 -04:00
Copilotandstarseeker befb85f2f9 Add TREAT-based AP242 schema variant for standards compliance comparison (#15)
* Initial plan

* Add documentation and clarify TYPEis_aggregate as shallow check

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

* Add test for aggregate unwrapping with typedef chains

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

* Add TREAT-based corrected AP242 schema and comparison documentation

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

* Add AP242 schema README and update documentation with comparison references

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
2026-02-09 09:16:56 -05:00
luzpaz 0eb7aabbb3 Misc. typos
A few user-facing and the rest just code comments
2017-09-15 11:48:28 -04:00
Mark Pictor 619c927ecb update Doxyfile 2015-05-20 20:03:53 -04:00
Cliff Yapp 10fb7419b5 More whitespace and case tweaks 2014-03-01 11:53:30 -05:00
Cliff Yapp 44e02c957a whitespace changes 2014-03-01 11:53:30 -05:00
Cliff Yapp c0e74a9eef Add CMake footer comment to CMake files 2014-02-28 22:06:09 -05:00
Kesha a297f733dd Update CMakeLists.txt 2013-09-12 22:56:16 +05:30
Mark Pictor a11fda7da2 delete obsolete man pages 2013-09-01 17:03:44 -04:00
Cliff Yapp 95d245f22e Whoops - rename man page.
git-svn-id: svn://svn.code.sf.net/p/brlcad/code/brlcad/trunk@57349 2f96ce8b-6d43-0410-b8df-bffccc660ffb
2013-09-01 16:54:03 -04:00
Cliff Yapp 5126b48e3f Rename fedex_python and fedex_plus to exp2python and exp2cxx respectively. 2013-08-28 21:57:46 -04:00
Mark Pictor 5fa4b17513 replace all references to SCL with SC in CMake files and code 2013-04-14 14:49:53 -04:00
Cliff Yapp b196aac059 Remove some unnecessary and/or duplicate files 2013-03-05 21:39:08 -05:00
Cliff Yapp 784363bf5f Make a stab at merging master and brlcad. Not properly working yet, need to remove some files, etc. 2013-03-04 21:57:08 -05:00
Cliff Yapp ebc7f5876b Don't use absolte path for install directory. 2012-07-11 18:17:23 +00:00
Nicholas Reed 27e68e4a3c Update version strings in fedex, fedex_plus, generated code, and documentation. SCL git 6851b27, fa615a1, dc30ee2, d190a1e, a33cba8, 698b9e0. 2012-06-27 18:38:03 +00:00
Mark Pictor a33cba8cef renamed - change urls, strings 2012-05-25 22:05:12 -04:00
starseeker c446fc391b make man page install path flexible 2012-04-01 12:54:43 -04:00
Cliff Yapp f10c37964c let the toplevel build tell us where to put scl man pages 2012-04-01 04:47:38 +00:00
Cliff Yapp 8bdec9821f add newline 2012-04-01 04:46:20 +00:00
tpaviot 77ab82b571 Added pdf version of documentation files 2012-03-26 05:12:38 +02:00
Cliff Yapp ed20839ae9 Sync step doc dir to github, except convert postscript files to pdf and fix page ordering of Fed-X document 2012-03-22 16:05:11 +00:00
Nicholas Reed 196e21bda3 remove step autotools files 2012-03-20 22:49:44 +00:00
tpaviot 38d2a49967 Improvements in the cmake builder 2012-03-02 07:49:02 +01:00
Mark Pictor defd675944 add some files, and rename existing ones (substitute underscore for space) 2011-12-14 20:15:35 -05:00
Mark Pictor ec7e8ac2d1 add sclnotes, replace two other mangled ps docs with pdf 2011-10-25 20:18:08 -04:00
Mark Pictor f0cadc97d2 add two files for doxyassist 2011-10-02 11:44:57 -04:00
Craig Lanning 419f8f83ed Add Part 21 BNF files, courtesy Craig Lanning 2011-09-15 16:29:42 -04:00
Christopher Sean Morrison bf0b0a4d0b ws consistency removing trailing ws and much more (see sh/ws.sh) 2011-09-09 21:08:06 +00:00
Craig Lanning 44bbb8cc25 Add BNF files for Part 11, ed1&2. From Craig Lanning's expresso 2011-09-01 20:24:48 -04:00
Mark Pictor a2c83c8ca4 Add NIST documentation in .ps form
These docs were in old revisions but got removed when I switched to brl-cad's version of scl
2011-08-14 13:44:03 -04:00
Mark Pictor 166de34080 add Doxyfile (config file for doxygen source documentation tool) 2011-07-30 17:06:52 -04:00
Mark Pictor 7ee097af0c Remove autotools files 2011-07-10 11:41:35 -04:00
starseeker 9ca892bb48 Needs more testing, but simplify down the install dir variables.
git-svn-id: https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk/src/other/step@44753 2f96ce8b-6d43-0410-b8df-bffccc660ffb
2011-07-09 10:57:50 -04:00
erikgreenwald f941f8d968 Add CMakeLists.txt to EXTRA_DIST.
git-svn-id: https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk/src/other/step@44740 2f96ce8b-6d43-0410-b8df-bffccc660ffb
2011-07-09 10:57:50 -04:00
starseeker 256bf1e7b9 We should have a working autotools build with the step tweaks now - make trunk step directory match that from CMake. Since there is no previous CMake build for the step subdirectory, go ahead and put everything here.
git-svn-id: https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk/src/other/step@43254 2f96ce8b-6d43-0410-b8df-bffccc660ffb
2011-07-09 10:57:50 -04:00
starseeker 7a0a956138 Add some Makefile.am files to various directories
git-svn-id: https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk/src/other/step@33992 2f96ce8b-6d43-0410-b8df-bffccc660ffb
2011-07-09 10:57:44 -04:00
starseeker b2ed633945 More inching forward in STEP
git-svn-id: https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk/src/other/step@33989 2f96ce8b-6d43-0410-b8df-bffccc660ffb
2011-07-09 10:57:43 -04:00
Cliff Yapp 501b514c0c Needs more testing, but simplify down the install dir variables. 2011-06-06 20:48:22 +00:00
Erik Greenwald d8e7edccd9 Add CMakeLists.txt to EXTRA_DIST. 2011-06-06 18:40:56 +00:00
Cliff Yapp 2005bef165 We should have a working autotools build with the step tweaks now - make trunk step directory match that from CMake. Since there is no previous CMake build for the step subdirectory, go ahead and put everything here. 2011-02-12 00:35:17 +00:00
Cliff Yapp dd4a90b8e8 Add some Makefile.am files to various directories 2009-03-11 19:09:40 +00:00