Keyboard shortcuts

Press ? to show this help

Press Esc to hide this help

Problem Options Reference

This page is generated from Hull’s problem Nix module options during the documentation build.

checker

The checker program, which compares a solution’s output with the correct answer.

Type: submodule

checker.language

The programming language of the source file. It is automatically detected from the file extension.

Type: non-empty string (read only)

Default:

hull.language.matchBaseName (baseNameOf config.src) problem.languages

checker.participantVisibility

Controls the visibility of this program to participants.

  • no: Not visible.
  • src: Source code is visible.
  • wasm: Compiled WASM is visible.

Type: string matching the pattern no|src|wasm

Default:

"no"

checker.src

Path to the source file of the program.

Type: path in the Nix store

checker.testResults

The result of tests.

Type: attribute set of (submodule) (read only)

Default:

"Loaded from runtime analysis data."

checker.testResults.<name>.evaluatorTraceStacks

Internal evaluator trace information from the checker.

Type: list of (attribute set)

Default:

[ ]

checker.testResults.<name>.message

A message from the checker.

Type: string

checker.testResults.<name>.readerTraceStacks

Internal reader trace information from the checker.

Type: list of (attribute set)

Default:

[ ]

checker.testResults.<name>.score

The score of the check, where the full score is 1.0.

Type: integer or floating point number between 0 and 1 (both inclusive)

checker.testResults.<name>.status

The status of the check.

Type: string matching the pattern internal_error|accepted|wrong_answer|partially_correct

checker.tests

An attribute set of tests for the checker itself.

Type: attribute set of (submodule)

Default:

{ }

checker.tests.<name>.arguments

A list of string arguments to pass to the generator program.

Type: null or (list of string)

Default:

null

checker.tests.<name>.generator

The name of the generator to use for creating the input file.

Type: null or non-empty string

Default:

null

checker.tests.<name>.inputFile

A store path to a manually provided input file.

Type: null or path in the Nix store

Default:

null

checker.tests.<name>.inputPath

The fully resolved input file used by this checker test.

Type: path in the Nix store (read only)

Default:

"Loaded from runtime analysis data."

checker.tests.<name>.name

The name of the test, derived from its attribute name in the tests set.

Type: string matching the pattern [a-zA-Z_][a-zA-Z0-9_\-]* (read only)

Default:

"‹name›"

checker.tests.<name>.outputFile

A store path to a manually provided output file.

Type: null or path in the Nix store

Default:

null

checker.tests.<name>.outputName

The name of output file, used to select the output name when solution returns multiple outputs.

Type: string

Default:

"output"

checker.tests.<name>.outputPath

The fully resolved output file when this checker test uses a static output file.

Type: null or path in the Nix store (read only)

Default:

null

checker.tests.<name>.outputSolution

The solution name used to generate the output file when outputFile is not provided.

Type: null or non-empty string (read only)

Default:

null

checker.tests.<name>.prediction

A function that takes the check report and returns true if the test passes.

Type: function that evaluates to a(n) boolean

checker.tests.<name>.predictionHolds

Whether the prediction holds for this test case.

Type: boolean (read only)

Default:

"Whether the prediction holds for this test case."

checker.tests.<name>.result

The result of this test.

Type: submodule (read only)

Default:

"Loaded from runtime analysis data."

checker.tests.<name>.result.evaluatorTraceStacks

Internal evaluator trace information from the checker.

Type: list of (attribute set)

Default:

[ ]

checker.tests.<name>.result.message

A message from the checker.

Type: string

checker.tests.<name>.result.readerTraceStacks

Internal reader trace information from the checker.

Type: list of (attribute set)

Default:

[ ]

checker.tests.<name>.result.score

The score of the check, where the full score is 1.0.

Type: integer or floating point number between 0 and 1 (both inclusive)

checker.tests.<name>.result.status

The status of the check.

Type: string matching the pattern internal_error|accepted|wrong_answer|partially_correct

checker.tests.<name>.solution

The name of a solution (from problem.solutions) to run to get the output file.

Type: null or non-empty string

Default:

null

checker.wasm

The compiled WASM artifact of the program.

Type: package (read only)

Default:

(problem.languages.${config.language}).compile.executable.drv { ... }

displayName

Display problem title for each language.

Type: attribute set of string

Default:

{ }

Example:

{
  en = "example problem";
  zh = "示例题目";
}

documents

An attribute set of documents for the problem.

Type: attribute set of (submodule)

Default:

{ }

documents.<name>.displayLanguage

The display language of this document.

Type: string

Example:

"en"

documents.<name>.participantVisibility

The visibility of this document to participants.

Type: boolean

Default:

false

documents.<name>.path

The path of this document.

Type: path in the Nix store

extraSpecialArgs

Extra special arguments passed in when evalProblem.

Type: raw value (read only)

fullScore

Full score of this problem

Type: nonnegative integer or floating point number, meaning >=0 (read only)

Default:

"The sum of the full score of all subtasks."

generators

An attribute set of generator programs used to create test case inputs.

Type: attribute set of (submodule)

Default:

{ }

generators.<name>.language

The programming language of the source file. It is automatically detected from the file extension.

Type: non-empty string (read only)

Default:

hull.language.matchBaseName (baseNameOf config.src) problem.languages

generators.<name>.participantVisibility

Controls the visibility of this program to participants.

  • no: Not visible.
  • src: Source code is visible.
  • wasm: Compiled WASM is visible.

Type: string matching the pattern no|src|wasm

Default:

"no"

generators.<name>.src

Path to the source file of the program.

Type: path in the Nix store

generators.<name>.wasm

The compiled WASM artifact of the program.

Type: package (read only)

Default:

(problem.languages.${config.language}).compile.executable.drv { ... }

includes

A list of paths to be added as include directories for compilation.

Type: list of path in the Nix store

Default:

[ ]

judger

The judger implementation to use for evaluating solutions.

Type: hullJudger

Default:

hull.judger.batch config { }

languages

The attribute set of available programming languages and their compilation logic.

Type: attribute set of (submodule)

Default:

hull.language.commons

languages.<name>.compile

Compile functions.

Type: submodule

languages.<name>.compile.executable

The executable compilation interface.

Type: submodule

languages.<name>.compile.executable.drv

The function used to link a source file and object files into an executable derivation.

Type: function that evaluates to a(n) path in the Nix store

languages.<name>.compile.executable.script

The function used to produce a shell script fragment that links a source file and object files into an executable.

Type: function that evaluates to a(n) strings concatenated with “\n”

languages.<name>.compile.object

The object compilation interface.

Type: submodule

languages.<name>.compile.object.drv

The function used to compile a source file into a linkable object file derivation.

Type: function that evaluates to a(n) path in the Nix store

languages.<name>.compile.object.script

The function used to produce a shell script fragment that compiles a source file into a linkable object file.

Type: function that evaluates to a(n) strings concatenated with “\n”

mainCorrectSolution

The single solution marked with mainCorrectSolution = true. This is used to generate the official answer files for test cases.

Type: attribute set (read only)

Default:

"The solution in `config.solutions` for which `mainCorrectSolution` is set to `true`."

memoryLimit

The default memory limit in bytes for solutions. Can be overridden per test case.

Type: unsigned integer, meaning >=0

Default:

null

name

The unique name of the problem, used in derivations and outputs.

Type: string matching the pattern [a-zA-Z_][a-zA-Z0-9_\-]*

Example:

"exampleProblem"

problemAttrs

User problem configuration passed in when evalProblem.

Type: raw value (read only)

runtimeData

Aggregated runtime analysis data injected before packaging and reporting.

Type: attribute set

Default:

"Runtime analysis data loaded by the Hull CLI."

samples

A list of test cases with sample or sampleLarge group.

Type: list of (attribute set) (read only)

Default:

"A filtered list of `problem.testCases` with `sample` or `sampleLarge` group."

solutions

An attribute set of solutions for the problem, including correct and incorrect ones.

Type: attribute set of (submodule)

Default:

{ }

solutions.<name>.mainCorrectSolution

Whether this solution is the main correct one, used to generate answer files. Exactly one solution must have this set to true.

Type: boolean

Default:

false

solutions.<name>.name

The name of the solution, derived from its attribute name in the solutions set.

Type: string matching the pattern [a-zA-Z_][a-zA-Z0-9_\-]* (read only)

Default:

"‹name›"

solutions.<name>.participantVisibility

The visibility of this solution to participants.

Type: boolean

Default:

false

solutions.<name>.score

This final score of the entire problem for this solution.

Type: floating point number (read only)

Default:

"Loaded from runtime analysis data."

solutions.<name>.src

Path to the source file or directory of the solution.

Type: absolute path

solutions.<name>.subtaskPredictions

A prediction for each subtask, expressed as a function that takes an attributes set of raw score (0.0-1.0) and statuses, and then returns true if the prediction is met.

Type: attribute set of function that evaluates to a(n) boolean

Default:

{ }

Example:

{
  "0" = { score, ... }: score >= 0.5;
  "1" = { statuses, ... }: builtins.all (s: s == "accepted" || s == "time_limit_exceeded") statuses;
}

solutions.<name>.subtaskResults

The collected results of this solution against all subtasks.

Type: list of (submodule) (read only)

Default:

"Loaded from runtime analysis data."

solutions.<name>.subtaskResults.*.rawScore

The lowest score of all test cases in this subtask, with a maximum score of 1.

Type: integer or floating point number between 0 and 1 (both inclusive)

solutions.<name>.subtaskResults.*.scaledScore

The lowest score of all test cases in this subtask, with a maximum score of fullScore defined in subtask options.

Type: floating point number

solutions.<name>.subtaskResults.*.statuses

The result status of all test cases in this subtask. Already sorted and deduplicated.

Type: list of string matching the pattern internal_error|accepted|wrong_answer|partially_correct|runtime_error|time_limit_exceeded|memory_limit_exceeded

Default:

[ ]

solutions.<name>.subtaskResults.*.testCases

The results of test cases in this subtask.

Type: attribute set of (submodule)

solutions.<name>.subtaskResults.*.testCases.<name>.memory

The memory in bytes of judgement.

Type: unsigned integer, meaning >=0

solutions.<name>.subtaskResults.*.testCases.<name>.message

The message of judgement.

Type: string

solutions.<name>.subtaskResults.*.testCases.<name>.outputs

A nix store path. Each file in this directory is an output data file.

Type: path in the Nix store

solutions.<name>.subtaskResults.*.testCases.<name>.score

The score of judgement, with a maximum score of 1.

Type: integer or floating point number between 0 and 1 (both inclusive)

solutions.<name>.subtaskResults.*.testCases.<name>.status

The status of judgement.

Type: string matching the pattern internal_error|accepted|wrong_answer|partially_correct|runtime_error|time_limit_exceeded|memory_limit_exceeded

solutions.<name>.subtaskResults.*.testCases.<name>.tick

The WASM tick of judgement.

Type: unsigned integer, meaning >=0

solutions.<name>.testCaseResults

The collected results of running and checking this solution against all test cases.

Type: attribute set of (submodule) (read only)

Default:

"Loaded from runtime analysis data."

solutions.<name>.testCaseResults.<name>.memory

The memory in bytes of judgement.

Type: unsigned integer, meaning >=0

solutions.<name>.testCaseResults.<name>.message

The message of judgement.

Type: string

solutions.<name>.testCaseResults.<name>.outputs

A nix store path. Each file in this directory is an output data file.

Type: path in the Nix store

solutions.<name>.testCaseResults.<name>.score

The score of judgement, with a maximum score of 1.

Type: integer or floating point number between 0 and 1 (both inclusive)

solutions.<name>.testCaseResults.<name>.status

The status of judgement.

Type: string matching the pattern internal_error|accepted|wrong_answer|partially_correct|runtime_error|time_limit_exceeded|memory_limit_exceeded

solutions.<name>.testCaseResults.<name>.tick

The WASM tick of judgement.

Type: unsigned integer, meaning >=0

subtasks

A list of subtasks, where each subtask is defined by a set of required traits.

Type: list of (submodule)

Default:

[
  {
    fullScore = 1.0;
  }
]

subtasks.*.fullScore

The full score of this subtask.

Type: floating point number

subtasks.*.scoringMethod

Scoring method for this subtask.

Type: string matching the pattern min|sum

Default:

"min"

subtasks.*.testCases

A list of test cases that match the traits defined for this subtask.

Type: list of (attribute set) (read only)

Default:

"A filtered list of `problem.testCases` matching the subtask's traits."

subtasks.*.traits

An attribute set of traits that a test case must have to belong to this subtask.

Type: attribute set of boolean

Default:

{ }

targetOutputs

The final derivation outputs for each defined target.

Type: attribute set of package (read only)

Default:

builtins.mapAttrs (targetName: target: target config) config.targets

targets

An attribute set of build targets for the problem, defining final package structures.

Type: attribute set of hullProblemTarget

Default:

{ }

testCases

An attribute set defining all test cases for the problem.

Type: attribute set of (submodule)

Default:

{ }

testCases.<name>.arguments

A list of string arguments to pass to the generator program.

Type: null or (list of string)

Default:

null

testCases.<name>.data

Read-only container for the test case’s input and output data paths.

Type: submodule (read only)

Default:

{ }

testCases.<name>.data.input

The store path to the input data file. It’s either taken from inputFile or generated by generator.

Type: path in the Nix store (read only)

Default:

"Loaded from runtime analysis data."

testCases.<name>.data.outputs

A nix store path generated by running mainCorrectSolution. Each file in this directory is a correct output data file.

Type: path in the Nix store (read only)

Default:

"Loaded from runtime analysis data."

testCases.<name>.descriptions

The description of this test case for each display language, usually used for samples.

Type: attribute set of string

Default:

{ }

testCases.<name>.generator

The name of the generator (from the top-level generators set) to use for creating the input file. If set, inputFile should be null.

Type: null or non-empty string

Default:

null

testCases.<name>.groups

The groups to which this test case belongs.

Type: list of string matching the pattern [a-zA-Z_][a-zA-Z0-9_\-]*

Default:

[ ]

Example:

[
  "sample"
  "pretest"
]

testCases.<name>.inputFile

A store path to a manually provided input file. If set, generator should be null.

Type: null or path in the Nix store

Default:

null

testCases.<name>.inputValidation

The result of running the validator on the test case’s input data.

Type: submodule (read only)

Default:

"Loaded from runtime analysis data."

testCases.<name>.inputValidation.message

A message from the validator.

Type: string

testCases.<name>.inputValidation.readerTraceStacks

Internal trace information from the validator’s input readers.

Type: list of (attribute set)

Default:

[ ]

testCases.<name>.inputValidation.readerTraceTree

Internal trace tree from the validator.

Type: attribute set

Default:

{ }

testCases.<name>.inputValidation.status

The status of the validation: valid or invalid.

Type: string matching the pattern internal_error|valid|invalid

testCases.<name>.inputValidation.traits

The set of traits automatically detected by the validator from the input data.

Type: attribute set of boolean

Default:

{ }

testCases.<name>.memoryLimit

Memory limit in bytes for this specific test case.

Type: unsigned integer, meaning >=0

Default:

problem.memoryLimit

testCases.<name>.name

The name of the test case, derived from its attribute name in the testCases set.

Type: string matching the pattern [a-zA-Z_][a-zA-Z0-9_\-]* (read only)

Default:

"‹name›"

testCases.<name>.tickLimit

Execution time limit in ticks for this specific test case.

Type: unsigned integer, meaning >=0

Default:

problem.tickLimit

testCases.<name>.traitHints

An attribute set of declared trait hints for this test case.

In normal workflows this is only a hint or a subset of the traits that will actually be observed by the validator at runtime. Unless a feature explicitly documents otherwise, scoring, subtask membership, and any other evaluation logic must use runtime validator traits instead of trusting this metadata field.

Type: attribute set of boolean

Default:

{ }

tickLimit

The default execution time limit in ticks for solutions. Can be overridden per test case.

Type: unsigned integer, meaning >=0

Default:

null

traits

An attribute set of all possible traits that can be used to categorize test cases and define subtasks.

Type: attribute set of (submodule)

Default:

{ }

traits.<name>.descriptions

The description of this trait for each display language.

Type: attribute set of string

Default:

{ }

Example:

{
  en = "$a$ is a positive integer.";
  zh = "$a$ 为正整数";
}

validator

The validator program, which verifies if a test case’s input data is valid.

Type: submodule

validator.language

The programming language of the source file. It is automatically detected from the file extension.

Type: non-empty string (read only)

Default:

hull.language.matchBaseName (baseNameOf config.src) problem.languages

validator.participantVisibility

Controls the visibility of this program to participants.

  • no: Not visible.
  • src: Source code is visible.
  • wasm: Compiled WASM is visible.

Type: string matching the pattern no|src|wasm

Default:

"no"

validator.src

Path to the source file of the program.

Type: path in the Nix store

validator.testResults

The result of tests.

Type: attribute set of (submodule) (read only)

Default:

"Loaded from runtime analysis data."

validator.testResults.<name>.message

A message from the validator.

Type: string

validator.testResults.<name>.readerTraceStacks

Internal trace information from the validator’s input readers.

Type: list of (attribute set)

Default:

[ ]

validator.testResults.<name>.readerTraceTree

Internal trace tree from the validator.

Type: attribute set

Default:

{ }

validator.testResults.<name>.status

The status of the validation: valid or invalid.

Type: string matching the pattern internal_error|valid|invalid

validator.testResults.<name>.traits

The set of traits automatically detected by the validator from the input data.

Type: attribute set of boolean

Default:

{ }

validator.tests

An attribute set of tests for the validator itself.

Type: attribute set of (submodule)

Default:

{ }

validator.tests.<name>.arguments

A list of string arguments to pass to the generator program.

Type: null or (list of string)

Default:

null

validator.tests.<name>.generator

The name of the generator to use for creating the input file.

Type: null or non-empty string

Default:

null

validator.tests.<name>.inputFile

A store path to a manually provided input file.

Type: null or path in the Nix store

Default:

null

validator.tests.<name>.inputPath

The fully resolved input file used by this validator test.

Type: path in the Nix store (read only)

Default:

"Loaded from runtime analysis data."

validator.tests.<name>.name

The name of the test, derived from its attribute name in the tests set.

Type: string matching the pattern [a-zA-Z_][a-zA-Z0-9_\-]* (read only)

Default:

"‹name›"

validator.tests.<name>.prediction

A function that takes the validation report and returns true if the test passes.

Type: function that evaluates to a(n) boolean

validator.tests.<name>.predictionHolds

Whether the prediction holds for this test case.

Type: boolean (read only)

Default:

"Whether the prediction holds for this test case."

validator.tests.<name>.result

The result of this test.

Type: submodule (read only)

Default:

"Loaded from runtime analysis data."

validator.tests.<name>.result.message

A message from the validator.

Type: string

validator.tests.<name>.result.readerTraceStacks

Internal trace information from the validator’s input readers.

Type: list of (attribute set)

Default:

[ ]

validator.tests.<name>.result.readerTraceTree

Internal trace tree from the validator.

Type: attribute set

Default:

{ }

validator.tests.<name>.result.status

The status of the validation: valid or invalid.

Type: string matching the pattern internal_error|valid|invalid

validator.tests.<name>.result.traits

The set of traits automatically detected by the validator from the input data.

Type: attribute set of boolean

Default:

{ }

validator.wasm

The compiled WASM artifact of the program.

Type: package (read only)

Default:

(problem.languages.${config.language}).compile.executable.drv { ... }