Repository navigation
Releases: Variably-Constant/trex
Releases · Variably-Constant/trex
Release list
TREX 0.3.0
Every surface
Breaking
- The unit above the token is called a supertoken everywhere: a template's
${@construct}is${@super}, an explanation readscall supertoken at depth 0, and the axes a refused template lists namesuper. - Bare
@seamand@seam:superdo not hold at the input's first unit, as
@seam:byteand every written cut do not; they held there before. - The pair field's bound of a cut is the mean
log2 gover the pairs of
units straddling it, in bits per pair, where it was their sum. A cut near
either end of the input, which fewer pairs straddle, reads on the scale
every other cut reads on, so@boundand--record bind:Qno longer
favor the input's ends; on a short log the weakest cuts are its odd lines
where they were its first and last tokens. A cut more than eight units
from both ends keeps its order, and a bound written in bits
(@bound<=-1b) reads per pair. - A run of more than 32 hex digits at a length no digest has lexes as one
hextoken; it lexed as a word, a number and a word, or base64.hexis
a built-in atom name, so a declaration namedhexis refused. A declared
kind's code is 34 and up, and an index an earlier trex wrote reads as
absent untiltrex indexwrites it again.
Added
- A
hextoken kind,\{hex}: a run of more than 32 hex digits holding a
hex letter at a length no digest has, as a key, a dump or a digest of
another size is written; 32, 40 and 64 digits stay\{hash}. It is
painted red and underlined with the other alarm kinds, a scan for
\{hex}over an input with no such run answers without lexing, and the
GPU matches it as the CPU does. - A written cut on
@seamand@ambiguous:@seam>k,@seam:byte>=kand
@seam:super>kkeep the cuts whose strength is more thank
standard deviations above the input's mean, or at leastk;
@ambiguous>kand@ambiguous:token>=kthe points whose disagreement
passesk, from 0 to 1. An explanation repeats the cut as written (on at a token cut >0.5) and holds it in acutpiece,${@seam.cut}and
${@ambiguous.cut}. TREX_REQUIRE_CUDA=1fails a build for Windows or Linux whose CUDA kernel
did not compile, naming why; without it such a build warns and runs on the
CPU. trex's own release builds set it.
Changed
- A number written with an exponent (
6.02e23,2.5e-4), a0x,0b
or0oprefix (0x3e8), or_before each further group of three
digits (1_000_000,0xFFFF_FFFF) lexes as one number token on every
surface and the device; it lexed as a number and the word after it.
Magnitude reads it at its value's scale, so6.02e23reads 23.78 where
it read 0.78, and\Npredicates, typed values, aggregates, the
numericorbit group and a tree index read its value. A comma still
separates, so1,000is three tokens, and a form with a letter, digit
or underscore right after it (1e3a,2024_01_02) lexes as before.
Readings of any input holding these forms change. - A number's exact value is held as its digits and a power of ten, so a
huge one costs a comparison, a sort or a key what its written digits
cost, and prints in that form where writing it out would put more than
21 zeros past its digits:1e999999prints as1e999999in a--json
value, an aggregate and an orbit or echo key, as does a number written
out with 22 or more trailing zeros. - A declaration takes every line a pattern file holds,
fieldsand a
rule'sfix,meta,files,unless,record,record-startand
record-spanamong them, and removing an atom takes the lines declared
that add to it. Atestline declared on its own is no longer listed as
an atom. - SARIF output declares its columns as
"columnKind": "unicodeCodePoints",
which SARIF 2.1.0 requires of a run holding results. - Of two contested points closer than the observation's minimum gap, the
stronger is kept, a tie keeping the earlier; the first was kept before.
The strongest point is always kept, and a higher threshold removes only
points below it. - A shape template region ends at its last token whose kind matches the
kind one period before. - Region classification (
trex spectral --classify,scan --files --textureand the--texturefilter,Measure-TrexSpectral -Classify
andtrex.axes.spectral(classify=True)): a region is a blob where base64,
hash and hex tokens and high-entropy runs cover more than half of it, and
otherwise a table only where template runs holding a kind other than a
word cover more than half of it. A run repeating every one or two tokens
counts toward a table only where its lines hold about as many tokens as
each other, so a column of numbers one to a line is a table and a
paragraph of clauses and commas is not. A paragraph whose words repeat
reads as prose, and base64 of English text as a blob, on one line or
wrapped. - The shape axis reads a word's case and length from its characters, so
Επειδήis Pascal asWhereasis and a Korean word of two syllables is
short, and a punctuation token's glyph is its whole character, so、and
。are two classes and echo's structural-rhyme keys print them; it read
ASCII case, length in bytes and the glyph's first byte. Shape classes,
periods, templates and change points, the context axis and echo's keys
change on text outside ASCII; ASCII text reads as it did. - A spectral change point also marks where a span's texture gives way to
the texture before it, so a line of code in the middle of a sentence has
one at each edge (trex spectral --segment,\F{onset}, the regions of
--classify,Measure-TrexSpectralandtrex.axes.spectral). The exit
is at the first of twelve bytes in a row on which the recent reading
stays close to the texture the span interrupted; before, a span shorter
than the reader's slow clock had an entry and no exit, and the regions
after it read as one with the span. - The spectral change-point threshold's running mean and deviation take
each byte's departure only up to three deviations, so a divergence that
rises over many bytes, as code inside Chinese, Japanese or Korean prose
does, no longer lifts the threshold ahead of itself; such a span was
often given no change point at all. Change points move on most inputs,
and plain text holds a few more of them. - The CUDA kernel compiles with an
nvccof CUDA 12.0 or later; with an
older one the build warns, as it does with none, and runs on the CPU.
trex's releases are built with CUDA 12.0, and their kernel loads on an
NVIDIA driver of the 525 series or later. - Release builds of the
trexbinary and the Python extension use no
link-time optimization, and the PowerShell module uses thin link-time
optimization. Measured against fat link-time optimization under Windows
on an AMD Ryzen 9 7900X, the binary is 3% smaller and scans in the same
time, and a scan takes 11% less time in the extension and 6% less in the
module. - Error messages, help text and
--explainreadings use plain wording.
Messages a script may match read: a~kgroup's count "must be less than
the number of atoms"; "an orbit scope cannot be nested inside another"; in
atestline, "ingoes between the span ... and the text it is read
from"; an empty mark "holds no text, so nothing places the field"; a
template field "is one value and takes no .PIECE after it" or "is not a
reading AXIS gives; it gives ..."; and@orderon the first timestamp
"the first timestamp, with nothing to compare with".
Fixed
- The pair field's first unit, with nothing before it, reads no strain and
no bound:@strainand@boundhold nowhere there at any grain,
--explainsays there is nothing before it to strain against, a
percentile is taken over the units that have a reading, and--record bind:Qcuts at the weakest Q% of those. Both read zero there before, so
@bound<10held at the first token of most code files. - A byte-pattern refuses a backslash before a letter other than
d,D,
w,W,s,S,pandP,(?at the start of a group and a
backslash inside a class, each a parse error naming it, in a shape and
between backticks. They parsed as other characters before:\x00was the
charactersx00,(?s:.)the characters?s:then one more, and
[\x00-\xff]a class of punctuation, digits and capitals. - Prose in a script written outside ASCII reads as prose: the spectral
texture readings (--classify, the--texturefilters,-Classify,
classify=and\F{texture:...}), observation's byte grain and
resonator::over_bytesread their bytes as UTF-8. A letter outside ASCII
is a letter on each of its bytes, any other character outside ASCII
counts once by its class, so’weighs what'does, and only a byte
that is not part of a well-formed character is read apart. They read
Cyrillic, Greek, Chinese and Japanese prose as a blob before, and the
accents inside Latin words as foreign bytes. The texture readings'
entropy gates rise with the share of bytes inside multi-byte characters,
whose bytes carry more entropy than the text they spell. Readings of any
text outside ASCII change; ASCII text reads as it did. - The lexer's blob gate takes the same share into account, so a Chinese or
Japanese sentence lexes as words and punctuation; a sentence of a real
Chinese document collapsed into one opaqueothertoken, and no scan
could find a word inside it. - The region classification reads Arabic, Chinese, Greek, Japanese, Korean
and Thai prose as prose; it read the Universal Declaration of Human Rights
in each as a table, since their words were in one or two shape classes
that repeat at any period. Base64 wrapped at 76 columns, digests one to a
line and PEM certificate bundles read as a blob; they read as a table, one
token kind repeating line after line. - The Windows...
trex 0.2.0
Added
- The
trexbinary for Windows x64, Linux x64, FreeBSD x64 and macOS arm64
on the GitHub release. - A
fieldsline in pattern files, which the filetrex infersaves
carries: a saved build read again keeps its casts, record starts, nested
fields and accessors on every surface.scan --fieldsprints its records
table, and Python'sPattern.fieldsandPattern.records(text)read it. - Python:
trex.files()lists the files a scan of some paths reads,
trex.read()gives a file's text decoded as a scan decodes it,
trex.texture()names what a text reads as mostly, andPattern.diff()
andPattern.rewrite_file()diff a rewrite of a file or write it in the
file's own encoding. - PowerShell:
Get-TrexFile -Binary.
Changed
- An explanation names the token of a declared shape or kind by its
declaration (ticket), as a token listing does. - The shape axis reads a region as a table only where template runs cover
more than half of its bytes. trex seam --recover FILEleaves the word count out of its header.Select-TrexMatch,Edit-TrexTextandProtect-TrexTextwrite a warning
naming a file given by-Pathor-LiteralPaththat holds a NUL byte.
Fixed
trex scan --filesandGet-TrexFilelisted files holding a NUL byte that
a scan leaves unread; they leave them out unless--binaryor-Binary
asks for them.rewrite,redactandscan --rules --fixpassed over one named file
holding a NUL byte without a word under--dry-run,--in-placeand
--interactive; they refuse it and exit with failure, as they do when
writing to the standard output.- Python
Match.explainreports the rung of the scan ladder that answered,
asscan --explaindoes. - The PowerShell module reads a pattern's relative
@filepaths against
PowerShell's current location.
Removed
- Python
Match.explaintakes noroute=.