Skip to content

Types

Types

Every class and enumeration the cmdlets write and take. A property’s type is the .NET type the module declares; where that is object, what it holds is said beside it. A proxy class keeps its value in Rust behind the object: each property read is one call into it, Dispose() frees it, and IsDisposed says whether it has been.

Classes

Trex.Atom

One declared atom, as Get-TrexAtom lists it.

Written by Get-TrexAtom, Import-TrexAtom, Register-TrexAtom.

PropertyTypeHolds
NamestringThe name a pattern reads the atom by, as \{name}.
FormTrex.AtomFormWhat the declaration declares.
DefinitionstringThe byte-pattern or pattern the declaration gives.
SourcestringWhere it was declared: session, library, the pattern file’s path, or shipped for the library trex carries.
DescriptionstringFor a shipped atom, what it matches.

Trex.AtomTest

The outcome of one test line: an atom’s expectations, run against what the set finally declares.

Written by Test-TrexAtom.

PropertyTypeHolds
NamestringThe atom the line tests.
PassedboolWhether every expectation on the line held.
Acceptsstring[]Texts the atom must match whole.
Rejectsstring[]Texts the atom must match nowhere.
Failuresstring[]What trex reported for each expectation that failed.
FilestringThe pattern file the line is in, or empty for one declared here.

Trex.Bpe

A byte-pair encoder: the merges training learned, in order. A proxy class.

Written by Import-TrexBpe, New-TrexBpe.

PropertyTypeHolds
MergeslongHow many merges the model holds.
ModelstringThe model as text, one merge a line with its two symbols separated by a tab, as Export-TrexBpe writes it.
IsDisposedboolWhether Dispose() has freed the value behind the object; a property read after that is $null.
MethodReturnsDoes
[Trex.Bpe]::new(string model)Trex.BpeReads a model from its text, one merge a line with its two symbols separated by a tab.
Encode(string text)string[]text split into the model’s subwords, word by word.

Trex.BuiltField

One field of a built pattern.

Inside another object, and as a string, it shows as {Name}.

Held in Trex.BuiltPattern.Fields.

PropertyTypeHolds
NamestringThe capture’s name.
AccessorobjectThe accessor a template writes after the capture where the field is part of one token, host of a URL; $null otherwise.
TypeNameobjectThe type a mark gave the field as the mark writes it, int for {[int]age:6}, which its values are cast to; $null where none.
StartsRecordboolWhether a mark writes the field {name*:text}, so a line holding it begins a record.
ListboolWhether a line marks the field more than once, so its value is every text it holds, in order, as an array.
RepeatsboolWhether the field stands in records a line repeats, so a row holds every value of it as an array and each record one.
ParentobjectThe name of the field whose mark holds this one’s, whose value then holds this field’s under its last name part; $null at the top.
TemplatestringHow a report template writes the field.
MethodReturnsDoes
ToString()stringThe object as text, {Name}, each braced name read from that property.

Trex.BuiltPattern

A pattern built for named fields, with the report on it. Its string form is the pattern.

Inside another object, and as a string, it shows as {Pattern}.

Written by ConvertTo-TrexPattern.

PropertyTypeHolds
PatternstringThe pattern, one branch per shape.
FormatstringA report template writing every field, tab-separated.
FilestringThe pattern as a file -PatternFile and trex lib read, its fields line keeping each field’s type, record start, accessor and order, so \{extract} read under it after Import-TrexAtom writes the objects this pattern writes.
Declarationsstring[]The shapes -MintShapes declared, each a line of File, shape kb = KB[0-9]{7}``; the pattern reads only under them, as ConvertFrom-TrexText reads it.
Suggestionsstring[]Each field every value of which a value class of the library holds, where no counter-example called for one, as field: \{class} ...; a -NotExample one of them refuses prints it in the pattern.
FieldsTrex.BuiltField[]The fields, in the order first marked or named.
ShapesTrex.BuiltShape[]The shapes, in the order their branches stand in the pattern.
Rowsobject[]Each line: its Line index, the index of its Shape ($null for a line with no token), its Text, and Values, each field’s value by name (an array of strings for a list field, a hashtable of Text and the fields inside for a field holding others), $null where the line does not hold it.
Recordsobject[]Each record: the indexes in Rows of its Lines, and Values, each field’s first value among them by name, and for a field holding the one that begins the record, as a mark spanning lines does, its text on each line joined with a newline. A line holding a field that begins a record begins one and the lines after it join it; with no such field, each line is one.
MethodReturnsDoes
ToString()stringThe object as text, {Pattern}, each braced name read from that property.

Trex.BuiltShape

One shape of the lines a built pattern reads: a branch of the pattern.

Inside another object, and as a string, it shows as {Pattern}.

Held in Trex.BuiltPattern.Shapes.

PropertyTypeHolds
PatternstringThe branch.
Lineslong[]The indexes in Rows of the lines of this shape.
ReachobjectHow the shape reaches each field, by name: marked, missing, or the index in Shapes of the shape whose literals place it here.
MethodReturnsDoes
ToString()stringThe object as text, {Pattern}, each braced name read from that property.

Trex.Capture

What one register bound.

Inside another object, and as a string, it shows as {Name}={Text}.

Held in Trex.Match.Groups.

PropertyTypeHolds
NamestringThe register’s name.
TextstringThe text it bound; for a register bound under a repetition, the last binding.
StartlongWhere the text starts in the input, in UTF-16 code units.
LengthlongHow many UTF-16 code units the text spans.
KindstringThe token kind the register binds, such as ip or timestamp, a declared shape or kind by the name its declaration gave it, or empty where it binds more than one kind.
ValueobjectThe text parsed as its kind: a number as long or decimal, a duration as TimeSpan, an instant as DateTimeOffset, an address or a version as its canonical text; $null where it has none.
Itemsstring[]Every binding of a register bound under a repetition, oldest first.
MethodReturnsDoes
ToString()stringThe object as text, {Name}={Text}, each braced name read from that property.

Trex.ClassifiedRegion

A region of an input classified by its texture and its token shapes.

Inside another object, and as a string, it shows as {Kind} at {Offset}, {Length} long.

Held in Trex.SpectralReport.Regions.

PropertyTypeHolds
OffsetlongWhere the region starts, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
KindTrex.RegionKindWhat the region is.
PeriodintA table’s period in tokens; 0 for every other kind.
MethodReturnsDoes
ToString()stringThe object as text, {Kind} at {Offset}, {Length} long, each braced name read from that property.

Trex.Clock

The clock typed predicates read.

Written by Get-TrexClock, Set-TrexClock.

PropertyTypeHolds
NowDateTimeOffsetThe instant now reads as.
FixedboolWhether now is fixed by Set-TrexClock rather than read from the system clock at each scan.
TimeZoneOffsetTimeSpanThe offset a timestamp written with no zone is read at.
DateOrderTrex.DateOrderWhich field of an all-numeric slash date is the day.

Trex.Echo

A key that recurs: a token’s text, or the structure of a run of tokens.

Inside another object, and as a string, it shows as {Key} ({Count}).

Held in Trex.EchoReport.Echoes, Trex.EchoReport.Structures.

PropertyTypeHolds
KeystringThe key: the text of its first occurrence, or a structure’s role and the kinds of its tokens.
CountlongHow many times it occurs.
PeriodobjectThe mean distance between occurrences in bytes, where the distances are regular; $null where they are not.
OffsetlongWhere its first occurrence starts, in UTF-16 code units.
MethodReturnsDoes
ToString()stringThe object as text, {Key} ({Count}), each braced name read from that property.

Trex.EchoFrame

One token’s echo reading.

Inside another object, and as a string, it shows as {Text} at {Offset}.

Held in Trex.EchoReport.Frames.

PropertyTypeHolds
OffsetlongWhere the token starts, in UTF-16 code units.
TextstringThe token’s text.
CountlongHow many times the token’s key occurs in the input.
NthlongWhich occurrence of its key this is, counting from 1.
PreviousobjectWhere the key’s previous occurrence starts, in UTF-16 code units; $null at its first.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, each braced name read from that property.

Trex.EchoReport

The echo axis over one input: which tokens recur, how often, and how regularly.

Written by Measure-TrexEcho.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
GroupstringThe group the keys were read under.
TokenslongHow many tokens the lexer read.
KeyedlongThe tokens that take part: words, numbers, quoted runs and typed literals.
DistinctlongHow many distinct keys they hold.
NovellongThe keyed tokens that are the first occurrence of their key.
EchoedlongThe keyed tokens whose key occurs more than once.
NoveltyfloatThe share of keyed tokens that are first occurrences, from 0 to 1.
EchoRatefloatThe share of keyed tokens whose key recurs, from 0 to 1.
EchoesTrex.Echo[]Every key that recurs, most occurrences first.
StructuresTrex.Echo[]The structures that recur among runs of tokens, most occurrences first, with -Structure.
FramesTrex.EchoFrame[]Every keyed token’s frame, with -Detail.

Trex.ExplainedToken

One token a match spans, as an explanation reads it.

Inside another object, and as a string, it shows as {Kind} {Text}.

Held in Trex.Explanation.Tokens.

PropertyTypeHolds
KindstringThe token’s kind.
TextstringThe token’s text.
MethodReturnsDoes
ToString()stringThe object as text, {Kind} {Text}, each braced name read from that property.

Trex.Explanation

What a match is made of: the kinds of the tokens it spans, the check each guarded kind passed, every axis the pattern read at them, and the route the scan took.

PropertyTypeHolds
TokensTrex.ExplainedToken[]The significant tokens the match spans, with their kinds.
Guardsstring[]The check each guarded token passed to be its kind, such as a card number’s Luhn check.
ReadingsTrex.Reading[]Each axis the pattern reads, at each token of the match.
RoutestringThe rung of the scan ladder that answered the scan of the match’s input, as the trex command’s --explain names it.

Trex.File

One file a walk found.

Written by Get-TrexFile.

PropertyTypeHolds
PathstringThe file’s path.
TextureobjectWhat the file’s text reads as mostly, where -Classify or a texture filter read it; $null where neither did, or where the text holds no region.
PeriodintA table’s period in tokens; 0 for every other texture.

Trex.FileType

One file type the type filters name.

Written by Get-TrexFileType.

PropertyTypeHolds
NamestringThe type’s name, as -FileType takes it.
Globsstring[]The globs a file of the type matches.

Trex.FilterCheck

How one filter kept its contract over a corpus.

Written by Test-TrexPrefilter.

PropertyTypeHolds
FilterTrex.FilterKindThe filter probed.
PresentProbeslongThe substrings of the corpus probed, each present by construction.
FalseNegativeslongThe present probes the filter reported absent, which its contract forbids.
AbsentProbeslongThe byte strings probed that an exact search finds nowhere in the corpus.
AbsentRejectedlongThe absent probes the filter rejected, each a scan it saves.

Trex.Finding

One finding of a rule.

Written by Invoke-TrexRule.

PropertyTypeHolds
RulestringThe rule’s name.
SeverityTrex.SeverityHow serious it is.
MessagestringWhat it says, rendered from the match.
PathstringThe file it is in, empty for a string.
RegionTrex.RegionWhere it starts and ends, by line and column.
StartlongWhere it starts in the input, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
TextstringIts text: the match, or the record for a rule that fires on records.
FixobjectWhat a fix puts in the match’s place; $null where the rule has no fix.
FixRegionobjectThe span a fix replaces, the match, a Trex.Region; $null where the rule has no fix.
CapturesobjectEach register the rule’s pattern bound, as a hashtable of its name to its text.
DefinitionobjectThe rule itself, a Trex.Rule.

Trex.FlowFrame

One token’s flow reading.

Inside another object, and as a string, it shows as {Text} at {Offset}, {Direction}.

Held in Trex.FlowReport.Frames, Trex.FlowReport.Reversals.

PropertyTypeHolds
OffsetlongWhere the token starts, in UTF-16 code units.
TextstringThe token’s text.
SlopefloatThe signal’s change per token, averaged over the four tokens ending at this one.
DirectionTrex.FlowDirectionWhich way the trend runs: Steady where the slope is within 0.05 of zero.
MomentumintHow many consecutive tokens have held the same direction, rising or falling.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, {Direction}, each braced name read from that property.

Trex.FlowReport

The flow axis over one input: the trend of a per-token signal, how long each run of it lasts, and where it turns.

Written by Measure-TrexFlow.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
TokenslongHow many tokens the axis read, whitespace left out.
SignalTrex.FlowSignalThe signal whose trend was read.
PeakMomentumobjectThe token where the longest run stands, a Trex.FlowFrame; $null for an input with no tokens.
ReversalsTrex.FlowFrame[]The tokens where the trend turns between rising and falling.
FramesTrex.FlowFrame[]Every token’s frame, with -Detail.

Trex.Grammar

A token grammar, compiled. A proxy class.

Written by New-TrexGrammar.

PropertyTypeHolds
StartstringThe rule a parse starts from.
Rulesstring[]Every rule’s name, in the order the grammar declares them.
IsDisposedboolWhether Dispose() has freed the value behind the object; a property read after that is $null.
MethodReturnsDoes
[Trex.Grammar]::new(string source)Trex.GrammarCompiles grammar source, one name := alternatives rule a line, starting from its first rule; New-TrexGrammar -Start names another.
Parse(string text)Trex.ParseNodeThe parse of text from the start rule, or $null where it does not parse in full.
Test(string text)boolWhether text parses in full under any derivation.
CountParses(string text)ulongHow many derivations of text the grammar has: 0 where it does not parse, more than 1 where the grammar is ambiguous for it.
BestProbability(string text)doubleThe probability of text’s most probable derivation under the grammar’s @p weights; 0 where it does not parse.
TotalProbability(string text)doubleThe probability of all of text’s derivations together.
CountSegmentations(string text, string[] dictionary)ulongHow many ways the run-together text tiles into the words of dictionary with the grammar accepting the words.
BestSegmentationProbability(string text, string[] dictionary)doubleThe probability of the most probable tiling of the run-together text into the words of dictionary that the grammar accepts.

Trex.IndexInfo

What a tree’s index holds.

Written by Get-TrexIndex, New-TrexIndex.

PropertyTypeHolds
RootstringThe tree the index covers.
PathstringThe index file, at the tree’s root.
FileslongHow many files it covers.

Trex.Info

What this build of trex is.

Written by Get-TrexInfo.

PropertyTypeHolds
VersionstringThe trex engine’s version.
DeviceAvailableboolWhether a CUDA device is present for the scans that can use one.

Trex.Library

A set of atoms held in an object rather than the session, passed to a cmdlet with -Library. A proxy class.

Written by New-TrexLibrary.

PropertyTypeHolds
Namesstring[]The names declared in this library, in declaration order.
Filesstring[]The pattern files imported into it.
IsDisposedboolWhether Dispose() has freed the value behind the object; a property read after that is $null.
MethodReturnsDoes
Declare(string line)voidDeclares one line as a pattern file writes it: shape name = \bytes`, kind name = pattern, let name = pattern, or a testline. A relative@file` in it is read from the location the library was made at.

Trex.Line

One line of an input.

Inside another object, and as a string, it shows as {LineNumber}:{Text}.

Written by Get-TrexLine.

PropertyTypeHolds
PathstringThe file the line is in, or empty for text.
LineNumberlongThe line’s number in the input, counting from 1.
TextstringThe line’s text, without its line ending.
MethodReturnsDoes
ToString()stringThe object as text, {LineNumber}:{Text}, each braced name read from that property.

Trex.LiteralTest

What a filter answers for one literal, beside what an exact search of the corpus finds.

Written by Test-TrexPrefilter.

PropertyTypeHolds
LiteralstringThe literal asked about.
FilterTrex.FilterKindThe filter that answered.
MightOccurboolWhether the filter says the literal might occur; false is exact.
OccursboolWhether an exact search finds the literal in the corpus. A literal the filter says might occur that does not is a false positive.

Trex.MagnitudeFrame

One token’s magnitude reading.

Inside another object, and as a string, it shows as {Text} at {Offset}.

Held in Trex.MagnitudeReport.Frames, Trex.MagnitudeReport.Jumps, Trex.MagnitudeReport.Outliers.

PropertyTypeHolds
OffsetlongWhere the token starts, in UTF-16 code units.
TextstringThe token’s text.
MagnitudefloatThe token’s order of magnitude: log10 of a number’s absolute value, log2 of any other token’s length in bytes.
GradientfloatThe change in magnitude from the token before.
EnergyfloatThe sum of squared magnitudes over the 16 tokens ending at this one.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, each braced name read from that property.

Trex.MagnitudeReport

The magnitude axis over one input: the order of magnitude each token carries, where it jumps, and the tokens far from the input’s mean.

Written by Measure-TrexMagnitude.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
TokenslongHow many tokens the axis read, whitespace left out.
TotalEnergyfloatThe sum of squared magnitudes over the whole input.
PeakobjectThe token of greatest magnitude, a Trex.MagnitudeFrame; $null for an input with no tokens.
JumpsTrex.MagnitudeFrame[]The tokens whose magnitude differs from the one before by more than three orders.
OutliersTrex.MagnitudeFrame[]The tokens whose magnitude lies more than two and a half standard deviations from the input’s mean.
FramesTrex.MagnitudeFrame[]Every token’s frame, with -Detail.

Trex.Match

One match.

Written by Select-TrexMatch.

Returned by Trex.Pattern.Find, Trex.Pattern.FindAll.

PropertyTypeHolds
PathstringThe file the match is in, or empty for text.
LineNumberlongThe line the match starts on, counting from 1.
ColumnlongThe character the match starts at within its line, counting from 1.
StartlongWhere the match starts in the input, in UTF-16 code units, so $input.Substring($m.Start, $m.Length) is the match.
LengthlongHow many UTF-16 code units the match spans.
TextstringThe matched text.
CapturesobjectA hashtable of each register’s name to the text it bound, so $m.Captures.name reads one.
GroupsTrex.Capture[]Each register the pattern bound, in the order the pattern writes them, with its span, its kind and its parsed value.
PatternstringThe pattern’s name within a pattern set, or empty.
PreContextstring[]The lines before the match’s line, with -Context.
PostContextstring[]The lines after the match’s line, with -Context.
ExplanationobjectWhat the match is made of, a Trex.Explanation, with -Explain; $null otherwise.

Trex.MatchCount

How many records of an input hold a match, or how many matches it holds.

Written by Invoke-TrexRule, Select-TrexMatch.

PropertyTypeHolds
PathstringThe file counted, empty for text.
CountlongThe records holding a match, or under -NotMatch holding none; under -CountMatches, the matches.

Trex.ObservationFrame

One byte’s observation reading: the entropy of the byte classes around it, seen from behind, from ahead and from both sides.

Inside another object, and as a string, it shows as at {Offset}, disagreement {Disagreement}.

Held in Trex.ObservationReport.Contested, Trex.ObservationReport.Frames.

PropertyTypeHolds
OffsetlongWhere the byte stands, in UTF-16 code units; each byte of a character written in several has a frame at the character’s offset.
CausalfloatThe byte-class entropy of the window before the byte, from 0 to 1.
AnticausalfloatThe byte-class entropy of the window after the byte, from 0 to 1.
CenteredfloatThe byte-class entropy of the window centered on the byte, from 0 to 1.
DisagreementfloatHow far the two sides differ: Causal less Anticausal, unsigned.
MethodReturnsDoes
ToString()stringThe object as text, at {Offset}, disagreement {Disagreement}, each braced name read from that property.

Trex.ObservationReport

The observation axis over one input: where the text behind a point and the text ahead of it read differently.

Written by Measure-TrexObservation.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
PeakobjectThe contested byte where the two sides differ most, a Trex.ObservationFrame; $null where none is contested.
ContestedTrex.ObservationFrame[]The bytes where the two sides differ most: local maxima of Disagreement above 0.2, at least 8 bytes apart.
FramesTrex.ObservationFrame[]Every byte’s frame, with -Detail.

Trex.OrbitClass

One orbit and the distinct texts that fold onto it.

Inside another object, and as a string, it shows as {Orbit}.

Held in Trex.OrbitReport.Classes.

PropertyTypeHolds
OrbitstringThe orbit’s representative.
Formsstring[]The distinct texts in the input that fold onto it, sorted.
MethodReturnsDoes
ToString()stringThe object as text, {Orbit}, each braced name read from that property.

Trex.OrbitReport

The orbit axis over one input: its tokens read under a symmetry, and the distinct texts each orbit folds together.

Written by Measure-TrexOrbit.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
GroupstringThe group the tokens were read under.
TokenslongHow many tokens were read, whitespace left out.
FormslongHow many distinct texts the tokens hold.
OrbitslongHow many distinct orbits they fold onto.
ClassesTrex.OrbitClass[]Every orbit with the texts that fold onto it, by representative.
MatchesTrex.OrbitToken[]The tokens in the same orbit as -SameAs, with -SameAs.
SegmentsTrex.Segment[]The runs of one kind of character, letters, digits, whitespace or the rest, with -Detail.
FramesTrex.OrbitToken[]Every token with its orbit, with -Detail.

Trex.OrbitToken

One token under a symmetry: its text and the orbit it belongs to.

Inside another object, and as a string, it shows as {Text} at {Offset}.

Held in Trex.OrbitReport.Frames, Trex.OrbitReport.Matches.

PropertyTypeHolds
OffsetlongWhere the token starts, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
TextstringThe token’s text.
OrbitstringThe orbit’s representative: the form every token of the orbit reads as under the group.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, each braced name read from that property.

Trex.ParseNode

One node of a parse tree: a rule with the nodes it matched, or a token.

Inside another object, and as a string, it shows as {Expression}.

Written by Invoke-TrexGrammar.

Returned by Trex.Grammar.Parse.

PropertyTypeHolds
PathstringThe file the text came from, on the root of a tree parsed from one; empty for a string and for every node under the root.
RulestringThe rule the node matched, empty for a token.
TextstringThe token’s text, or for a rule the texts of the tokens under it joined by single spaces.
Childrenobject[]The nodes the rule matched, in order, each a Trex.ParseNode; none for a token.
ExpressionstringThe tree under this node as an S-expression: a token as its text, a rule as (rule child ...), and a rule of one child as that child.
MethodReturnsDoes
ToString()stringThe object as text, {Expression}, each braced name read from that property.

Trex.Pattern

A compiled trex pattern and the atoms it was compiled against. A proxy class.

Written by New-TrexPattern.

PropertyTypeHolds
SourcestringThe pattern’s source text.
CaptureNamesstring[]The registers the pattern binds, in the order it writes them.
IsDisposedboolWhether Dispose() has freed the value behind the object; a property read after that is $null.
MethodReturnsDoes
[Trex.Pattern]::new(string source)Trex.PatternCompiles source with the atoms trex ships and none declared; New-TrexPattern compiles against the session’s or a library’s.
IsMatch(string input)boolWhether the pattern matches anywhere in input.
Find(string input)Trex.MatchThe first match in input, or $null.
FindAll(string input)Trex.Match[]Every match in input.
Replace(string input, string template)stringinput with each match replaced by template rendered at it: ${name} a register, ${0} the match, ${ip:octet1-2} a typed slice.
Split(string input)string[]The text between the matches in input.

Trex.Prefilter

A presence filter built over a corpus. A proxy class.

Written by New-TrexPrefilter.

PropertyTypeHolds
FilterTrex.FilterKindWhich filter it is.
ByteslongThe size of the corpus it was built over, in bytes as UTF-8.
IsDisposedboolWhether Dispose() has freed the value behind the object; a property read after that is $null.
MethodReturnsDoes
[Trex.Prefilter]::new(string corpus)Trex.PrefilterBuilds a Bloom filter over corpus; New-TrexPrefilter builds the others and reads files.
MightContain(string literal)boolWhether literal might occur in the corpus: false is exact, true can be a false positive.

Trex.Reading

One reading of an axis the pattern reads, at a token of the match.

Inside another object, and as a string, it shows as {Axis} {Text}: {Value}.

Held in Trex.Explanation.Readings.

PropertyTypeHolds
AxisstringThe axis read.
TextstringThe token’s text.
ValuestringThe value the pattern compared, as the axis states it.
PartsobjectThe values the reading states, by the name a report template reads each by after the dot in ${@axis.piece}; empty for an axis that states one value.
MethodReturnsDoes
ToString()stringThe object as text, {Axis} {Text}: {Value}, each braced name read from that property.

Trex.Record

One record of an input.

Written by Get-TrexRecord.

PropertyTypeHolds
TextstringThe record’s text.
StartlongWhere it starts in the input, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.

Trex.RecordHit

One record a query keeps.

Written by Find-TrexRecord.

PropertyTypeHolds
PathstringThe file the record is in, empty for a string.
LineNumberlongThe line the record starts on, counting from 1.
StartlongWhere the record starts in the input, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
TextstringThe record’s text.
Patternsstring[]The patterns it holds, as they were given.

Trex.RecordShape

One record shape: the records that share a sequence of token kinds, with the positions that vary written as their kind.

Written by Get-TrexRecordShape.

PropertyTypeHolds
CountlongHow many records have this shape.
ReadablestringThe shape with its varying positions written as <kind>.
PatternstringThe shape as a trex pattern that matches its records.
RareboolWhether the shape covers fewer records than the cut.
NovelobjectWith -Against, whether no template of the other input would accept these records; $null where nothing was compared.
Recordslong[]The records of this shape, counted from 0.

Trex.Region

Where a span stands: its first line and column and the line and column just past its end, each from 1.

Inside another object, and as a string, it shows as {Line}:{Column}.

Held in Trex.Finding.Region.

PropertyTypeHolds
LinelongThe line it starts on.
ColumnlongThe character it starts at within its line.
EndLinelongThe line just past its end is on.
EndColumnlongThe character just past its end.
MethodReturnsDoes
ToString()stringThe object as text, {Line}:{Column}, each braced name read from that property.

Trex.RelationChord

One reuse: a later occurrence of repeated content joined to the earlier.

Inside another object, and as a string, it shows as {From} to {To}.

Held in Trex.RelationReport.Chords.

PropertyTypeHolds
FromstringThe earlier occurrence’s text.
TostringThe later occurrence’s text.
ResidualintThe later occurrence’s depth less the earlier’s: positive where the reuse sits deeper.
FromOffsetlongWhere the earlier occurrence starts, in UTF-16 code units.
ToOffsetlongWhere the later occurrence starts, in UTF-16 code units.
MethodReturnsDoes
ToString()stringThe object as text, {From} to {To}, each braced name read from that property.

Trex.RelationEdge

One directed relation between two tokens.

Inside another object, and as a string, it shows as {From} {Kind} {To}.

Held in Trex.RelationReport.Edges.

PropertyTypeHolds
KindTrex.RelationKindThe relation the edge carries.
FromstringThe text of the token it runs from.
TostringThe text of the token it runs to.
FromOffsetlongWhere the token it runs from starts, in UTF-16 code units.
ToOffsetlongWhere the token it runs to starts, in UTF-16 code units.
MethodReturnsDoes
ToString()stringThe object as text, {From} {Kind} {To}, each braced name read from that property.

Trex.RelationFrame

One token’s place in the enclosure tree.

Inside another object, and as a string, it shows as {Text} at {Offset}, depth {Depth}.

Held in Trex.RelationReport.Frames.

PropertyTypeHolds
OffsetlongWhere the token starts, in UTF-16 code units.
TextstringThe token’s text.
DepthintHow many brackets enclose it.
Enclosurestring[]The heads of the bracket groups enclosing it, outermost first.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, depth {Depth}, each braced name read from that property.

Trex.RelationReport

The relation axis over one input: the graph its brackets, operators, adjacency and reuse make, read as a tree with loops.

Written by Measure-TrexRelation.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
TokenslongHow many tokens the lexer read, whitespace included.
MaxDepthintThe deepest nesting of brackets.
NestingLoadlongHow many tokens sit inside at least one bracket group.
EncloseslongThe edges from a bracket group’s head to the tokens inside it.
OperatorslongThe edges between the operands of a binding punctuation.
AdjacencieslongThe edges from each significant token to the next.
ReuseChordslongThe reuses: later occurrences of repeated content joined to the earlier.
ScopeCrossingChordslongThe reuses whose two occurrences sit at different depths.
HolonomylongThe reuses’ depth differences summed without sign: 0 for a tree, and positive once a reuse crosses a scope.
NetHolonomylongThe same sum with its sign: positive where reuse flows inward, negative outward, 0 where the two cancel.
BoundaryEventslongThe brackets the input holds, opens and closes, as the boundary reading counts them.
BulkNodeslongThe balanced bracket groups.
HolographicDefectlongWhat the brackets alone do not determine: the reuses.
BoundaryClosedboolWhether every bracket is balanced, so that the brackets alone determine the nesting.
RebuiltEdgeslongThe enclosure edges rebuilt from the brackets alone.
MinRicciintThe most negative edge curvature: the sharpest bottleneck, 0 for a graph with no edges.
MeanRiccifloatThe mean edge curvature.
BridgeslongThe edges of negative curvature: the bottlenecks.
NodeslongThe tokens that take part in at least one relation.
GraphEdgeslongThe relation graph’s undirected edges.
ComponentslongIts connected components.
CycleRanklongIts independent loops: edges less nodes plus components.
EulerlongIts Euler characteristic: nodes less edges.
MaxShortcutlongThe longest run of tokens a single reuse joins in one step; 0 where nothing is reused.
PeakEntanglementlongThe most relation edges crossing any boundary between two tokens.
MinimalCutobjectThe fewest relation edges crossing a boundary between two tokens; $null where the input has no boundary inside it.
MinimalCutOffsetobjectWhere that boundary falls, in UTF-16 code units: the start of the token after it; $null with MinimalCut.
CanonicalstringThe input’s alpha-equivalence form, with -Canonical: the first word inside each [ is a binder written #, a later use of it ^k for the binder k scopes out, a name bound nowhere is kept, and the tokens are joined by spaces.
EdgesTrex.RelationEdge[]Every relation edge, with -Detail.
ChordsTrex.RelationChord[]Every reuse, with -Detail.
FramesTrex.RelationFrame[]The frame of every token inside a bracket group, with -Detail.

Trex.Rule

One rule as its pattern file declares it.

Inside another object, and as a string, it shows as {Name}.

Written by Get-TrexRule.

PropertyTypeHolds
NamestringThe rule’s name, the id a finding is reported under.
SeverityTrex.SeverityHow serious a finding is.
MessagestringWhat a finding says: a report template rendered at each match.
PatternstringWhat the rule matches, as written.
FixstringThe template a fix renders in the match’s place, empty where the rule has none.
Filesstring[]The globs the inputs the rule reads are kept or dropped by; every input where there are none.
MetaobjectThe rule’s meta.KEY = VALUE lines, as a hashtable.
Tagsstring[]The values meta.tags lists.
FilestringThe pattern file the rule is in, empty for one declared here.
LinelongThe line the rule opens on, counting from 1.
MethodReturnsDoes
ToString()stringThe object as text, {Name}, each braced name read from that property.

Trex.ScanRoute

How many inputs one rung of the scan ladder answered, which -Stats reads from the trace trex keeps while the cmdlet runs.

Inside another object, and as a string, it shows as {Rung}: {Inputs}.

Held in Trex.ScanStats.Routes.

PropertyTypeHolds
RungstringThe rung, as the trex command’s --stats names it.
InputslongHow many inputs it answered.
MethodReturnsDoes
ToString()stringThe object as text, {Rung}: {Inputs}, each braced name read from that property.

Trex.ScanStats

What a scan read and found, which -Stats writes after the report.

Written by Select-TrexMatch.

PropertyTypeHolds
MatcheslongThe matches the report read.
MatchedLineslongThe lines those matches touch.
FilesWithMatcheslongThe inputs holding a match.
FilesSearchedlongThe inputs scanned; each string piped in is one.
BytesSearchedlongThe bytes scanned, counted as UTF-8.
SearchingTimeSpanThe time the scans took.
ElapsedTimeSpanThe time from the cmdlet’s start to its end.
TokensLexedlongThe tokens the scans’ lexes produced.
LexingTimeSpanThe time those lexes took, summed over the cores that ran them, which comes out of Searching rather than adding to it.
MatchingTimeSpanSearching less Lexing: the time left for matching.
DeviceByteslongThe bytes handed to the device.
RoutesTrex.ScanRoute[]How many inputs each rung of the scan ladder answered, in the order first seen.

Trex.SeamFrame

One byte’s seam reading: how uncertain the text is on either side of it.

Inside another object, and as a string, it shows as {Text} at {Offset}.

Held in Trex.SeamReport.Frames.

PropertyTypeHolds
OffsetlongWhere the byte stands, in UTF-16 code units.
TextstringThe character the byte begins, empty for a byte inside a character written in several.
ForwardfloatThe forward branching entropy at the byte: how uncertain what follows is, given what precedes.
BackwardfloatThe backward branching entropy at the byte: how uncertain what precedes is, given what follows.
BoundaryfloatThe seam strength of a cut before the byte, from both readings together.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, each braced name read from that property.

Trex.SeamReport

The seam axis over one input: the units it divides into where the text before stops predicting the text after.

Written by Measure-TrexSeam.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
OrderintThe longest context the entropy was read over, in bytes.
SegmentsTrex.Segment[]The units, in order.
FramesTrex.SeamFrame[]Every byte’s frame, with -Detail.

Trex.Segment

A run of an input: where it starts, how long it is, and its text.

Inside another object, and as a string, it shows as {Text}.

Held in Trex.OrbitReport.Segments, Trex.SeamReport.Segments.

PropertyTypeHolds
OffsetlongWhere the run starts, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
TextstringThe run’s text.
MethodReturnsDoes
ToString()stringThe object as text, {Text}, each braced name read from that property.

Trex.ShapeFrame

One token’s shape reading.

Inside another object, and as a string, it shows as {Text} at {Offset}.

Held in Trex.ShapeReport.Frames.

PropertyTypeHolds
OffsetlongWhere the token starts, in UTF-16 code units.
TextstringThe token’s text.
ClassuintThe token’s shape class: its kind and silhouette as one number, equal for tokens of one shape.
PeriodintThe period, in tokens, at which the shapes around the token repeat; 0 where they do not.
NoveltyfloatHow new the run of shapes ending here is, from 0 to 1, 1 for its first sighting.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, each braced name read from that property.

Trex.ShapeRegion

A run of tokens whose shapes repeat at one period: a table, a list of records, a template filled in again and again.

Inside another object, and as a string, it shows as at {Offset}, {Length} long, period {Period}.

Held in Trex.ShapeReport.Regions.

PropertyTypeHolds
OffsetlongWhere the run starts, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
PeriodintThe period its shapes repeat at, in tokens.
MethodReturnsDoes
ToString()stringThe object as text, at {Offset}, {Length} long, period {Period}, each braced name read from that property.

Trex.ShapeReport

The shape axis over one input: the template its tokens repeat, where that repetition holds, and where it breaks.

Written by Measure-TrexShape.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
GroupstringThe group the token shapes were read under, empty for the lexer’s own.
TokenslongHow many tokens the axis read, whitespace left out.
DominantPeriodintThe period of the strongest repetition, in tokens; 0 where nothing repeats.
DominantStrengthfloatHow strongly the dominant period repeats, from 0 to 1.
RegionsTrex.ShapeRegion[]The runs whose shapes repeat strongly enough to be a template.
ChangePointslong[]Where the silhouette breaks, in UTF-16 code units.
FramesTrex.ShapeFrame[]Every token’s frame, with -Detail.

Trex.SpectralFrame

One frame of the spectral reading: the byte statistics of a window.

Inside another object, and as a string, it shows as {Texture} at {Offset}.

Held in Trex.SpectralReport.Frames.

PropertyTypeHolds
OffsetlongThe last byte the frame reads, in UTF-16 code units.
TextureTrex.TextureThe window’s texture.
EntropyfloatThe window’s byte entropy, from 0 to 1.
PeriodintThe period its bytes repeat at, in bytes; 0 where none.
NoveltyfloatHow new its runs of bytes are, from 0 to 1, 1 for a first sighting.
Mixfloat[]The shares of digits, letters, whitespace, punctuation and bytes above ASCII among its recent bytes, in that order.
MethodReturnsDoes
ToString()stringThe object as text, {Texture} at {Offset}, each braced name read from that property.

Trex.SpectralPeriod

A byte period the spectral reading found, and how strongly it holds.

Inside another object, and as a string, it shows as {Period} ({Strength}).

Held in Trex.SpectralReport.Periods.

PropertyTypeHolds
PeriodintThe period, in bytes.
StrengthfloatIts strongest showing, from 0 to 1.
MethodReturnsDoes
ToString()stringThe object as text, {Period} ({Strength}), each braced name read from that property.

Trex.SpectralReport

The spectral axis over one input: its byte statistics along its length, where they change, and the texture of each stretch between.

Written by Measure-TrexSpectral.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
HoplongHow many bytes each frame advances.
ChangePointslong[]Where the byte statistics change, in UTF-16 code units.
EntropyMinimumobjectThe least byte entropy of any frame, from 0 to 1; $null for an input with no frames.
EntropyMeanobjectThe mean byte entropy over the frames; $null for an input with no frames.
EntropyMaximumobjectThe greatest byte entropy of any frame; $null for an input with no frames.
PeriodsTrex.SpectralPeriod[]The distinct byte periods the frames found, strongest first.
TimelineTrex.TextureRegion[]The input cut at its change points, each stretch with its texture.
RegionsTrex.ClassifiedRegion[]The input’s regions classified by texture and token shape, with -Classify.
FramesTrex.SpectralFrame[]Every frame, with -Detail.

Trex.StreamMatch

One match a stream scanner committed.

Returned by Trex.StreamScanner.Finish, Trex.StreamScanner.Push.

PropertyTypeHolds
StartlongWhere the match starts in the whole stream, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
TextstringThe matched text.
PatternstringThe pattern of a set that made the match, as it was given; empty for a scanner of one pattern.

Trex.StreamScanner

A scan fed a stream a chunk at a time. A proxy class.

Written by New-TrexStreamScanner.

PropertyTypeHolds
SourcestringThe patterns scanned, as given, one a line.
IsDisposedboolWhether Dispose() has freed the value behind the object; a property read after that is $null.
MethodReturnsDoes
[Trex.StreamScanner]::new(string pattern)Trex.StreamScannerA scanner of one pattern, compiled with the atoms trex ships; New-TrexStreamScanner takes several as a set.
Push(string chunk)Trex.StreamMatch[]Feeds the next chunk of the stream and gives back the matches no later chunk can change.
Finish()Trex.StreamMatch[]Ends the stream and gives back every match not given yet.

Trex.StressFrame

One token’s stress reading.

Inside another object, and as a string, it shows as {Text} at {Offset}, depth {Depth}.

Held in Trex.StressReport.Fractures, Trex.StressReport.Frames, Trex.StressReport.Peaks.

PropertyTypeHolds
OffsetlongWhere the token starts, in UTF-16 code units.
TextstringThe token’s text.
DepthintHow many paired brackets enclose the token.
StrainfloatHow many tokens the innermost open bracket has been held open.
LoadfloatHow many tokens every open bracket has been held open, summed.
MethodReturnsDoes
ToString()stringThe object as text, {Text} at {Offset}, depth {Depth}, each braced name read from that property.

Trex.StressReport

The stress axis over one input: how deeply the brackets nest at each token, the peaks of that nesting, and where it releases at once.

Written by Measure-TrexStress.

PropertyTypeHolds
PathstringThe file read, empty for a string.
LengthlongThe input’s length in UTF-16 code units.
TokenslongHow many tokens the axis read, whitespace left out.
MaxDepthintThe deepest nesting reached.
PeakLoadobjectThe token carrying the greatest load, a Trex.StressFrame; $null for an input with no tokens.
PeaksTrex.StressFrame[]The tokens at a local maximum of depth, at depth 2 or more.
FracturesTrex.StressFrame[]The tokens where the depth starts to fall from a level 2 or more deep: where a nested structure begins to close.
FramesTrex.StressFrame[]Every token’s frame, with -Detail.

Trex.TextureRegion

A stretch of an input between two change points, with its texture.

Inside another object, and as a string, it shows as {Texture} at {Offset}, {Length} long.

Held in Trex.SpectralReport.Timeline.

PropertyTypeHolds
OffsetlongWhere the stretch starts, in UTF-16 code units.
LengthlongHow many UTF-16 code units it spans.
TextureTrex.TextureIts texture.
EntropyfloatIts byte entropy, from 0 to 1.
PeriodintThe period its bytes repeat at, in bytes; 0 where none.
NoveltyfloatHow new its runs of bytes are, from 0 to 1.
MethodReturnsDoes
ToString()stringThe object as text, {Texture} at {Offset}, {Length} long, each braced name read from that property.

Trex.Token

One token as the lexer read it.

Written by Get-TrexToken.

PropertyTypeHolds
KindstringThe token’s kind: number, word, quoted, ip, email, timestamp and the rest, open and close for a bracket, or the name a declared shape or kind gave it.
TextstringThe token’s text.
StartlongWhere the token starts in the input, in UTF-16 code units.
LengthlongHow many UTF-16 code units the token spans.
ValueobjectThe text parsed as its kind, as a capture’s Value reads it; $null where the kind carries none.

Trex.Group

One group of the matches Group-TrexMatch read: a PSObject with this type name, whose aggregate properties are the ones asked for, in this order.

Written by Group-TrexMatch.

PropertyTypeHolds
KeystringThe key the group’s matches rendered.
CountlongHow many matches rendered it.
Sumthe kind’s typeWith -Sum, the sum of the register’s values: a long or decimal for numbers, a TimeSpan for durations.
Averagethe kind’s typeWith -Average, their mean, computed exactly: a decimal for numbers, a TimeSpan for durations.
Minimumthe kind’s typeWith -Minimum, the least value, in the .NET type of its kind.
Maximumthe kind’s typeWith -Maximum, the greatest value, in the .NET type of its kind.
P50, P95, ...the kind’s typeWith -Percentile, one property per percentile asked for, named P and the percentile.

Enumerations

Trex.AtomForm

What a declaration declares.

ValueMeans
ShapeA bounded byte-pattern the lexer tries before its built-in recognizers, so where it matches it wins.
ShapeAfterA bounded byte-pattern the lexer tries only where no built-in recognizer matched.
KindA pattern whose every match, after the lex, becomes one token of this kind.
PatternA pattern read in place wherever the name appears.
RuleA named pattern with a message and a severity, reported by a rule scan and read as a pattern elsewhere.

Trex.Backend

The engine a scan runs on.

ValueMeans
AutoChosen per input: the CPU engine, or for a pattern that reads only token kinds where a device is present, the input split between the cores and the device, by what this process has measured at the input’s size.
CpuThe CPU engine, never probing the device.
GpuThe device, falling back to the CPU where the pattern is outside what it runs, no device is present, or the build carries none.

Trex.ColorDepth

The depth -Color and -Passthru paint at, as the trex command’s --color names it.

ValueMeans
NoneNo color: the report’s text alone, as --color never prints it.
Ansi16The sixteen base colors, as --color 16 or --color ansi paints.
Ansi256The 256-color table, as --color 256 or --color ansi256 paints.
TrueColorAny 24-bit value, as --color truecolor paints.

Trex.DateOrder

Which field of an all-numeric slash date such as 05/09/2026 is the day.

ValueMeans
DayFirst05/09/2026 is the 5th of September.
MonthFirst05/09/2026 is the 9th of May.

Trex.DurationUnit

The unit -Json writes a duration’s value in, as the trex command’s --duration-unit names it.

ValueMeans
NanosecondsThe nanoseconds a duration is held and compared in.
MillisecondsMilliseconds, by an exact decimal shift.
SecondsSeconds, by an exact decimal shift: 1500ms is 1.5.

Trex.FilterKind

Which filter a prefilter is.

ValueMeans
BloomA Bloom filter: each n-gram sets bits chosen by several hashes, and an unset bit proves absence.
CuckooA cuckoo filter: each n-gram a one-byte fingerprint in one of two buckets.
XorAn xor filter: each n-gram’s fingerprint the xor of three slots, filled by peeling.

Trex.FlowDirection

Which way a flow’s trend runs at a token.

ValueMeans
SteadyNeither rising nor falling.
RisingRising.
FallingFalling.

Trex.FlowSignal

The per-token signal the flow axis reads the trend of.

ValueMeans
MagnitudeEach token’s order of magnitude, as the magnitude axis reads it.
StressEach token’s nesting depth, as the stress axis reads it.
LengthEach token’s length in bytes.

Trex.GroupOrder

The order groups are written in.

ValueMeans
CountMost matches first, and by key among equal counts.
KeyBy key.

Trex.PercentileMethod

How a percentile falling between two observed values is decided.

ValueMeans
NearestThe value at rank ceil(p * n), always one that occurred.
LinearInterpolated between the two neighbors; numeric kinds only.
LowerThe value at or below the rank.
HybridInterpolated where the kind allows it, the nearest value otherwise.

Trex.RegionKind

What a region of an input is, by its texture and by whether its token shapes repeat.

ValueMeans
TableToken shapes that repeat at a strong period: a table or a list of records, whatever its bytes look like.
BlobA high-entropy run: packed, encoded or encrypted bytes.
ProseProse.
NumericNumbers.
CodeCode whose shapes do not repeat strongly.
MixedNo texture dominates.

Trex.RelationKind

The relation an edge between two tokens carries.

ValueMeans
EnclosesFrom the word heading a bracket group to a token inside it.
OperatorFrom one operand of a binding punctuation to the other, in order.
AdjacentFrom a significant token to the next.

Trex.Severity

How serious a rule’s finding is.

ValueMeans
WarningWorth a look; what a rule is where it names no severity.
ErrorA fault; a scan with one fails in the trex command.
NoteFor information.

Trex.SortKey

What -Sort orders the files read by.

ValueMeans
PathThe path, as text.
ModifiedThe time the file was last written.
AccessedThe time the file was last read.
CreatedThe time the file was created.

Trex.Texture

The texture a stretch of bytes has, by the classes of its bytes.

ValueMeans
ProseLetters dominate and punctuation is low: prose.
CodePunctuation and symbols high beside identifiers: code.
MathSingle symbols and digits mixed: mathematics.
DataHigh entropy or many bytes above ASCII: compressed, packed or binary data.
MixedNo class dominates.

Trex.ValueSpelling

How -Json spells a typed register’s value, as the trex command’s --values names it.

ValueMeans
ExactA JSON number only where a double holds the value exactly; a string or a small object everywhere else.
NaturalA JSON number throughout, rounding where a double must.
Tagged{"kind": ..., "exact": ...} for every value.