Skip to content

Hardcoded floating-point answers should be verified more exactly #403

@mpsijm

Description

@mpsijm

For problem Fractal Area of the BAPC preliminaries 2024, the version used on the 21st of September showed sample answers that were slightly too inexact. Specifically, they differed in the last two digits. The reason here was that the input precision was reduced from 9 to 6 digits, and the sample answer that was hardcoded in generators.yaml was not updated. However, all jury submissions still passed, because the error was smaller than $10^{-7}$.

To prevent this, BAPCtools could perform a more exact match for the hardcoded answers. Specifically, the hardcoded answer should only be allowed to differ in the last digit, and only by one. For Fractal Area, the samples show 9 digits after the 0., so basically, the maximum allowed absolute error for the canonical jury solution on these hardcoded samples should be $10^{-9}$ rather than $10^{-6}$.

To avoid re-inventing the wheel (the wheel here being default_output_validator.cpp, perhaps we could modify the arguments passed to this validator when running the canonical jury solution on a hardcoded .ans file (or any .ans file, to simplify things). The question then becomes how to detect the value of the last significant digit in this answer (in the example above, this "value" is trivially $10^{-9}$ by counting digits, but we should also handle scientific notation correctly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions