BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Fantail · Find which settings layer supplied an invalid override

Resolve a layered setting and report where an invalid override came from.

Find which settings layer supplied an invalid override

Treating zero as an absent setting silently restores older values. Carry a presence flag and the identity of the winning layer. The second layer sets the value to 15 and the last layer has no value. The effective override is five above the limit.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-fantail.git
cd blyx-fantail
blyxc native-run project.blyx -- "2,15,0" "1,1,0" 5 0 10

API and return values

Returns [accepted, selected value, winning layer, distance outside bounds]. An invalid override remains visible for diagnosis. Invalid input returns an empty vector.

ArgumentAccepted input
valuesVector of: finite number
presentVector of: nonnegative exact integer
fallbackfinite number
minimumfinite number
maximumfinite number

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
0
15
1
5
Open in the full playground →

Practice

Change values = [3, 0], present = [1, 1]. Predict the result, then run the program.

Hint

Returns [accepted, selected value, winning layer, distance outside bounds]. An invalid override remains visible for diagnosis.

Worked solution

The result vector is [1, 0, 1, 0]. Compare its fields with the return layout in the API section.

Find

    let values = [2, 15, 0];

Replace with

    let values = [3, 0];

Find

    let present = [1, 1, 0];

Replace with

    let present = [1, 1];

Output after the change

1
0
1
0