Skip to content

PaperBench aggregate nodes can hide invalid child grades #144

Description

@sylvesterkaczmarek

Summary

Judge.grade() marks leaf/subtree failures with valid_score=False, but every internal node created after recursively grading children is hard-coded to valid_score=True.

A root grade can therefore report itself as valid even when one or more descendants failed to grade and were replaced with invalid zero-score nodes.

Current behavior

On a child grading exception:

return GradedTaskNode.from_task(
    task,
    score=0.0,
    valid_score=False,
    ...
)

After collecting children, the parent is constructed with:

valid_score=True

regardless of graded_sub_tasks.

Impact

Judge failures can be hidden by aggregate nodes, including the final root result. Consumers that use valid_score to distinguish legitimate low scores from grading errors can treat an error-tainted PaperBench grade as valid.

Proposed resolution

An aggregate node should be valid only when all of its graded children are valid:

valid_score = all(child.valid_score for child in graded_sub_tasks)

Add a regression with one successful child and one child raising during grading, verifying the failing child and every aggregate ancestor are marked invalid while the weighted score behavior remains unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions