MiniQuake

src/miniquake/compat_trace.ml

Package
miniquake.compat_trace
Reachable
Yes

Imports

Declarations

appendFile

function appendFile(path, text)

Add state for append file.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.
textdynamic—Text to parse or process.

View source

attemptShutdown

function attemptShutdown(session)

Update subsystem state for attempt shutdown.

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `attemptShutdown`.

View source

boolNumber

function boolNumber(value)

Return bool number derived from the active module state.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `boolNumber`.

View source

canonicalFrame

function canonicalFrame(session, frameIndex, accepted)

BP-001 originally expressed the complete frame as one deeply nested + tree. The Win64 backend has a bounded expression-temporary area, so keep every canonical field in the same order but append it in compiler-safe statements.

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `canonicalFrame`.
frameIndexdynamic—Zero-based index of the requested entry.
accepteddynamic—The accepted input consumed by `canonicalFrame`.

View source

clientEntitiesHash

function clientEntitiesHash(session)

cl.entities is intentionally sparse. SV_CreateBaseline omits non-model entities, while CL_EntityNum grows the array with void slots up to the next transmitted entity number. Hash both the slot topology and the populated records without dereferencing void.

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `clientEntitiesHash`.

View source

clientEntitiesJson

function clientEntitiesJson(session)

Implements the `clientEntitiesJson` operation for `miniquake.compat_trace` (client entities json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `clientEntitiesJson`.

View source

clientEntityJson

function clientEntityJson(item)

Implements the `clientEntityJson` operation for `miniquake.compat_trace` (client entity json).

ParameterTypeDefaultDescription
itemdynamic—The item input consumed by `clientEntityJson`.

View source

containsText

function containsText(text, needle)

Implements the `containsText` operation for `miniquake.compat_trace` (contains text).

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.
needledynamic—The needle input consumed by `containsText`.

View source

edictJson

function edictJson(session, index, item)

Implements the `edictJson` operation for `miniquake.compat_trace` (edict json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `edictJson`.
indexdynamic—Zero-based index of the requested entry.
itemdynamic—The item input consumed by `edictJson`.

View source

edictsJson

function edictsJson(session)

Implements the `edictsJson` operation for `miniquake.compat_trace` (edicts json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `edictsJson`.

View source

FNV_OFFSET

const FNV_OFFSET = 2166136261

Defines the fnv offset value used by `miniquake.compat_trace`.

View source

FNV_PRIME

const FNV_PRIME = 16777619

Defines the fnv prime value used by `miniquake.compat_trace`.

View source

globalsHash

function globalsHash(session)

Implements the `globalsHash` operation for `miniquake.compat_trace` (globals hash).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `globalsHash`.

View source

hashByte

inline function hashByte(state, value)

Returns whether `miniquake.compat_trace` has h byte.

ParameterTypeDefaultDescription
statedynamic—Mutable `miniquake.compat_trace` state used by `hashByte`.
valuedynamic—Value consumed by `hashByte`.

View source

hashFloat

function hashFloat(state, value)

Fold float into the deterministic rolling hash.

ParameterTypeDefaultDescription
statedynamic—Mutable `miniquake.compat_trace` state used by `hashFloat`.
valuedynamic—Value consumed by `hashFloat`.

View source

hashSizeBuffer

function hashSizeBuffer(state, buffer)

Fold size buffer into the deterministic rolling hash.

ParameterTypeDefaultDescription
statedynamic—Mutable `miniquake.compat_trace` state used by `hashSizeBuffer`.
bufferdynamic—The buffer input consumed by `hashSizeBuffer`.

View source

hashText

function hashText(text)

Fold text into the deterministic rolling hash.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

hashTextSeed

function hashTextSeed(state, text)

Fold text seed into the deterministic rolling hash.

ParameterTypeDefaultDescription
statedynamic—Mutable `miniquake.compat_trace` state used by `hashTextSeed`.
textdynamic—Text to parse or process.

View source

hashVec3

function hashVec3(state, value, label)

Hash a Vec3 without keeping a heap object only inside a nested call expression. This is deliberately allocation-free after the type check.

ParameterTypeDefaultDescription
statedynamic—Mutable `miniquake.compat_trace` state used by `hashVec3`.
valuedynamic—Value consumed by `hashVec3`.
labeldynamic—The label input consumed by `hashVec3`.

View source

hashWord

function hashWord(state, value)

Fold word into the deterministic rolling hash.

ParameterTypeDefaultDescription
statedynamic—Mutable `miniquake.compat_trace` state used by `hashWord`.
valuedynamic—Value consumed by `hashWord`.

View source

hashWordArray

function hashWordArray(words)

Fold word array into the deterministic rolling hash.

ParameterTypeDefaultDescription
wordsdynamic—The words input consumed by `hashWordArray`.

View source

inspect

function inspect(path)

Implements the `inspect` operation for `miniquake.compat_trace` (inspect).

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.

View source

lineCount

function lineCount(text)

Return line count derived from the active module state.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

makeResult

function makeResult(ok, requested, written, accepted, rollingHash, prefix, lastStage, errorText, cleanShutdown)

Create and initialize result.

ParameterTypeDefaultDescription
okdynamic—The ok input consumed by `makeResult`.
requesteddynamic—The requested input consumed by `makeResult`.
writtendynamic—The written input consumed by `makeResult`.
accepteddynamic—The accepted input consumed by `makeResult`.
rollingHashdynamic—The rolling hash input consumed by `makeResult`.
prefixdynamic—The prefix input consumed by `makeResult`.
lastStagedynamic—The last stage input consumed by `makeResult`.
errorTextdynamic—The error text input consumed by `makeResult`.
cleanShutdowndynamic—The clean shutdown input consumed by `makeResult`.

View source

printResult

function printResult(result)

Format and emit result.

ParameterTypeDefaultDescription
resultdynamic—Result value to report or translate into a status code.

View source

protocolHash

function protocolHash(session)

Implements the `protocolHash` operation for `miniquake.compat_trace` (protocol hash).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `protocolHash`.

View source

qcEdictsHash

function qcEdictsHash(session)

Implements the `qcEdictsHash` operation for `miniquake.compat_trace` (qc edicts hash).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `qcEdictsHash`.

View source

qcFunctionIndex

function qcFunctionIndex(session)

Return qc function index derived from the active module state.

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `qcFunctionIndex`.

View source

rawEdictHash

function rawEdictHash(session, index)

Implements the `rawEdictHash` operation for `miniquake.compat_trace` (raw edict hash).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `rawEdictHash`.
indexdynamic—Zero-based index of the requested entry.

View source

resourceJson

function resourceJson(session)

Implements the `resourceJson` operation for `miniquake.compat_trace` (resource json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `resourceJson`.

View source

run

function run(baseDirectory, gameDirectory, mapName, frameCount, outputPrefix)

No diagnostics-only failure may escape as an unclassified process exit. Convert unexpected propagation into a regular failed result and leave an emergency summary for the black-port feedback loop whenever possible.

ParameterTypeDefaultDescription
baseDirectorydynamic—Root directory containing the Quake installation.
gameDirectorydynamic—Selected Quake game-data directory.
mapNamedynamic—Name of the map to load or inspect.
frameCountdynamic—Number of entries or units to process.
outputPrefixdynamic—The output prefix input consumed by `run`.

View source

runInternal

function runInternal(baseDirectory, gameDirectory, mapName, frameCount, outputPrefix)

Execute internal.

ParameterTypeDefaultDescription
baseDirectorydynamic—Root directory containing the Quake installation.
gameDirectorydynamic—Selected Quake game-data directory.
mapNamedynamic—Name of the map to load or inspect.
frameCountdynamic—Number of entries or units to process.
outputPrefixdynamic—The output prefix input consumed by `runInternal`.

View source

safeText

function safeText(value)

Return a validated safe text value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `safeText`.

View source

serverEdictsHash

function serverEdictsHash(session)

Implements the `serverEdictsHash` operation for `miniquake.compat_trace` (server edicts hash).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `serverEdictsHash`.

View source

snapshotClientJson

function snapshotClientJson(session)

Implements the `snapshotClientJson` operation for `miniquake.compat_trace` (snapshot client json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `snapshotClientJson`.

View source

snapshotDigestsJson

function snapshotDigestsJson(session)

Implements the `snapshotDigestsJson` operation for `miniquake.compat_trace` (snapshot digests json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `snapshotDigestsJson`.

View source

snapshotHostJson

function snapshotHostJson(session)

Implements the `snapshotHostJson` operation for `miniquake.compat_trace` (snapshot host json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `snapshotHostJson`.

View source

snapshotJson

function snapshotJson(session, frameIndex, phase, errorText)

Implements the `snapshotJson` operation for `miniquake.compat_trace` (snapshot json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `snapshotJson`.
frameIndexdynamic—Zero-based index of the requested entry.
phasedynamic—The phase input consumed by `snapshotJson`.
errorTextdynamic—The error text input consumed by `snapshotJson`.

View source

snapshotPlayerJson

function snapshotPlayerJson(session)

Implements the `snapshotPlayerJson` operation for `miniquake.compat_trace` (snapshot player json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `snapshotPlayerJson`.

View source

snapshotQuakeCJson

function snapshotQuakeCJson(session)

Implements the `snapshotQuakeCJson` operation for `miniquake.compat_trace` (snapshot quake c json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `snapshotQuakeCJson`.

View source

snapshotServerJson

function snapshotServerJson(session)

Implements the `snapshotServerJson` operation for `miniquake.compat_trace` (snapshot server json).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `snapshotServerJson`.

View source

stagesHash

function stagesHash(session)

Implements the `stagesHash` operation for `miniquake.compat_trace` (stages hash).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `stagesHash`.

View source

summaryJson

function summaryJson(ok, requested, written, accepted, rollingHash, tracePath, snapshotPath, contextPath, lastStage, errorText, cleanShutdown, diagnosticWriteError)

Implements the `summaryJson` operation for `miniquake.compat_trace` (summary json).

ParameterTypeDefaultDescription
okdynamic—The ok input consumed by `summaryJson`.
requesteddynamic—The requested input consumed by `summaryJson`.
writtendynamic—The written input consumed by `summaryJson`.
accepteddynamic—The accepted input consumed by `summaryJson`.
rollingHashdynamic—The rolling hash input consumed by `summaryJson`.
tracePathdynamic—Filesystem path used by the operation.
snapshotPathdynamic—Filesystem path used by the operation.
contextPathdynamic—Filesystem path used by the operation.
lastStagedynamic—The last stage input consumed by `summaryJson`.
errorTextdynamic—The error text input consumed by `summaryJson`.
cleanShutdowndynamic—The clean shutdown input consumed by `summaryJson`.
diagnosticWriteErrordynamic—The diagnostic write error input consumed by `summaryJson`.

View source

TRACE_SCHEMA

const TRACE_SCHEMA = 1

Defines the trace schema value used by `miniquake.compat_trace`.

View source

traceErrorLine

function traceErrorLine(frameIndex, lastStage, message)

Trace error line through the collision world.

ParameterTypeDefaultDescription
frameIndexdynamic—Zero-based index of the requested entry.
lastStagedynamic—The last stage input consumed by `traceErrorLine`.
messagedynamic—Diagnostic message that explains a failure or event.

View source

traceLine

function traceLine(session, frameIndex, accepted)

Implements the `traceLine` operation for `miniquake.compat_trace` (trace line).

ParameterTypeDefaultDescription
sessiondynamic—The session input consumed by `traceLine`.
frameIndexdynamic—Zero-based index of the requested entry.
accepteddynamic—The accepted input consumed by `traceLine`.

View source

vec3Error

function vec3Error(label, value)

Implements the `vec3Error` operation for `miniquake.compat_trace` (vec3 error).

ParameterTypeDefaultDescription
labeldynamic—The label input consumed by `vec3Error`.
valuedynamic—Value consumed by `vec3Error`.

View source

vec3Hex

function vec3Hex(value, label)

Implements the `vec3Hex` operation for `miniquake.compat_trace` (vec3 hex).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `vec3Hex`.
labeldynamic—The label input consumed by `vec3Hex`.

View source

writeFile

function writeFile(path, text)

Encode and write file.

ParameterTypeDefaultDescription
pathdynamic—Filesystem path to process.
textdynamic—Text to parse or process.

View source