Document Chronicle-Core architecture, requirements and internal helpers#837
Open
peter-lawrey wants to merge 21 commits intodevelopfrom
Open
Document Chronicle-Core architecture, requirements and internal helpers#837peter-lawrey wants to merge 21 commits intodevelopfrom
peter-lawrey wants to merge 21 commits intodevelopfrom
Conversation
…alStateException; include package-info documentation for java.lang and java.nio packages
…erties overview and improve formatting for clarity
…documentation comments
…or improved readability
|
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.



This change set is a documentation and developer-experience sweep across Chronicle-Core. It aligns the module with the DOCS_PLAYBOOK (Nine-Box taxonomy, requirements/ADRs, runbooks), clarifies AI-agent guidance, and adds missing Javadoc/package-info coverage for many internal packages. There are no intentional runtime behaviour changes.
Functional changes
Benchmarks:
package benchmarks;declaration toMapBenchMainand a matching rootpackage-info.javaso the standalone benchmark launcher sits in a real package and can be imported/run consistently.AsDoubleImplementationPerfJLBH,Interrupted,TimeProviders, etc.) to clarify intent and usage; benchmark logic is unchanged.Assertions & checked-exceptions modules:
package-info.javafornet.openhft.chronicle.assertions(assertions enabled/disabled variants) and for the checked-exceptions overlays (java.lang,java.nio) to document how profiles select “assertions on/off” and “checked exception” variants.AssertUtilexamples and spacing so that SKIP_ASSERTIONS-guarded code continues to compile down to no-ops in theassertions-disabledprofile.Time & init hooks:
ChronicleInitRunnableandTimeProvider/LongTime, documenting when init hooks run and pointing readers toUniqueMicroTimeProviderfor monotonic microsecond timestamps (behaviour unchanged).Minor structural clean-ups:
Jvm.MaxMemoryHolder,OS.*Holder) so constants are defined before private constructors; no code paths or values change.assert false;” test statements with explicitthrow new AssertionError()in test-only code to avoid depending on JVM-eafor correctness.Overall, no public API signatures or runtime semantics are changed; functional impact is limited to benchmark packaging and test robustness.
Non-functional changes
1. AI agent & contributor guidance
AGENTS.md(Chronicle-Core flavour):Clarify that repository-level
AGENTS.mdprovides base rules, with this file documenting Chronicle-Core specifics and pointing atsrc/main/docs/README.adocas the durable doc landing page.Tighten language/character-set guidance:
iconvand IDE inspections).Extend Javadoc guidance with an inline-comment “BAD vs GOOD” example to discourage noise comments.
Add a “When to open a PR” section: require
mvn -q clean verifyto pass, link to issue/decision IDs, and encourage focused, single-concern PRs.Add guidance for AsciiDoc section numbering (
:sectnums:) and discourage manually numbered headings; show a minimal header template.New AI-assistant guides:
CLAUDE.md: in-depth Claude Code guide describing Chronicle-Core’s role, architecture, build commands (tests, benchmarks, assertions profile), resource management patterns, and documentation standards (Nine-Box tags, requirements/ADRs, security review).GEMINI.md: equivalent guidance for Gemini, including project overview, key features, build/test/benchmark commands, doc-first expectations, Javadoc rules, and commit-message etiquette.2. Documentation structure and content
README & top-level docs
README.adoc::toc:,:sectnums:,:lang: en-GB,:source-highlighter: rouge.opts=novalidateon code fences to avoid validation noise.[#system-properties-from-file],[#os-calls], etc.) and correct the system-properties link tosrc/main/docs/system-properties.adoc.src/main/docs/runbooks/, each linked back toCORE-*requirements.New / restructured AsciiDoc set under
src/main/docs/New files:
architecture-overview.adoc: Chronicle-Core capability map, component diagram (PlantUML), interactions with downstream modules (Queue, Bytes, Threads, Wire), external dependencies (JNA, SLF4J, Posix), and evolution guard-rails tied to Nine-Box tags.performance-targets.adoc: qualitative performance expectations (zero/near-zero allocations on hot paths, bounded overhead for tracing andBackgroundResourceReleaser), and how to validate them (benchmarks, decision records).testing-strategy.adoc: testing layers, traceability toCORE-FN/CORE-OPS/CORE-NF-*, recent CI snapshot (Java 8 & 21 runs), and a backlog of planned tests (especially forCORE-NF-P-*andCORE-RISK-003).system-properties.adoc: replaces the deleteddocs/systemProperties.adocwith a Chronicle-Core–scoped AsciiDoc table of system properties, defaults, and backing static fields.Major existing doc updates:
functional-requirements.adocandproject-requirements.adoc:CORE-NF-P-001..003, 006) and security (CORE-NF-S-001..003) requirements, aligning with the new performance and security docs.decision-log.adoc:Add new decisions:
CORE-NF-P-006documentingUniqueMicroTimeProvider’s monotonic microsecond semantics and CAS loop behaviour.CORE-DOC-007consolidating CI evidence and runbook documentation into AsciiDoc, deprecating scattered Markdown sidecars.Tighten Nine-Box wording and use emphasised text instead of bold for identifiers.
deterministic-resource-management.adoc,memory-management-guide.adoc,object-pooling-and-caching.adoc,common-pitfalls-and-debugging.adoc,thread-safety-guarantees.adoc,jvm-and-os-utilities.adoc,exception-overview.adoc,advanced-maths-functions.adoc:Enable
:sectnums:where missing and standardise headings, anchors and description lists.Rework lists into AsciiDoc description lists for clarity (e.g. “Failing to
release()” → explanation/example/debugging steps).Clarify subtle points like:
BackgroundResourceReleaserflags and whenreleasePendingResources()is required;UniqueMicroTimeProviderin tests withSetTimeProvider;OS.pageAlign/OS.mapAlign.Operational / runbook updates:
operational-requirements.adoc: add a CI data-collection checklist (build/test artefacts, coverage, security scans, docs snapshot, environment metadata).ops-scenarios.adoc: standardise layout and wording, maintain quarterly review reminder.Runbooks (
native-affinity.adoc,releaser-drain.adoc,resource-tracing.adoc,system-properties.adoc):system.propertiesvs-Dflags).Traceability
src/main/docs/requirement-test-map.csvmapping requirements (CORE-FN,CORE-NF-P,CORE-OPS,CORE-RISK) to concrete tests or CI jobs, with astatuscolumn (coveredvsplanned) and short notes on what each test asserts.system-architecture.adocextended with a “Documentation audit snapshot” summarising the current AsciiDoc set, runbooks, traceability map, and CI expectations.3. Javadoc and package-info coverage
Add or expand
package-info.javaacross many packages to improve Javadoc coverage and IDE hover docs:net.openhft.chronicle.core,core.io,core.util,core.values,core.time,core.threads,core.pool,core.scoped,core.shutdown,core.onoes,core.pom.core.internal,core.internal.analytics,core.internal.announcer,core.internal.cleaner,core.internal.pom,core.internal.util,core.internal.invariant.ints,core.internal.invariant.longs,core.domestic,core.analytics,core.announcer,core.cleaner,core.cleaner.spi,core.cooler.Add focused Javadoc to internal helpers to explain intent without altering behaviour, for example:
CpuClass,DirectBufferUtil,MapUtil,RangeUtil,ThreadConfinementLifecycle,VanillaThreadConfinementAsserter,NopThreadConfinementAsserter.MuteAnalytics,MuteBuilder,ReflectiveAnalytics,ReflectiveBuilder,ReflectionUtil,StandardMaps.Jdk9ByteBufferCleanerService,ReflectionBasedByteBufferCleanerService.IntCondition,LongCondition,SimpleCleaner,WeakIdentityHashMap.TracingReferenceCounted,VanillaReferenceCounted,ValidatableUtil,IOTools,Wget,ThreadConfinementAsserter.VanillaEventHandler,CleaningThreadLocal,ScopedThreadLocal(including explanation of the “discard newest when full” policy),StrongReferenceScopedResource,WeakReferenceScopedResource.LongTime,TimeProvider,Value interface guide, with updated package-level documentation.Clean up and standardise imports, comments and test code formatting across test sources (JUnit 4/5 mix), without changing assertions’ intent.