Skip to content

[FIX] Keep execution-distinct seeds when deduplicating - #3773

Open
Chen Yufeiyang (feiiiiii5) wants to merge 1 commit into
microsoft:mainfrom
feiiiiii5:fix/seed-dedup-identity
Open

Chen Yufeiyang (feiiiiii5) wants to merge 1 commit into
microsoft:mainfrom
feiiiiii5:fix/seed-dedup-identity

Conversation

@feiiiiii5

Copy link
Copy Markdown
Contributor

Fixes #3738.

Description

Seed deduplication used the coarse behavioral key for standalone seeds and for singleton groups, so seeds that differed only by seed type, data type, or response JSON schema were silently skipped: for example a prompt and an objective with the same value, or two singleton groups whose only difference is the response schema. Both execute differently, so only one of them was stored.

The standalone identity now covers the seed type, data type, response schema, and behavioral inputs, and singleton groups (and groups whose complete membership is already stored) are compared by the full member identity already used by multi-seed groups. Exact duplicates are still skipped and the multi-seed group path is unchanged.

Tests and Documentation

New file tests/unit/memory/memory_interface/test_interface_seed_dedup_identity.py with 5 cases:

  • same value, different seed types: both stored and retrievable by objective filter;
  • same value, different data types (text vs url): both stored;
  • two singleton groups that differ only by response_json_schema: both stored;
  • exact singleton duplicate: still skipped;
  • exact standalone duplicate: still skipped.

Evidence:

# parent revision: 3 failed, 2 passed (exit 1)
# this branch:      5 passed (exit 0)
pytest tests/unit/memory (full)          1927 passed, 1 skipped
related seed/memory unit tests           1311 passed
ruff check / ruff format --check / ty    clean

No documentation or JupyText change: this is an internal dedup semantic fix, and the docstring of add_seeds_to_memory_async is updated to state the identity it now uses.

Not run: the full test suite and CI (no Azure SQL instance; the identity key is computed in Python, but that backend was not exercised locally).

Standalone seeds and singleton groups were deduplicated by the behavioral key alone, so seeds that differed only by seed type, data type, or response_json_schema were silently skipped even though they execute differently. Standalone identity now includes those fields, and singleton/already-stored groups use the full member identity that multi-seed groups already use. Exact duplicates stay skipped; multi-seed group behavior is unchanged.

Fixes microsoft#3738

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seed deduplication silently drops distinct seed types and singleton response schemas

1 participant