[TEST] Reproduce the source id collision with a real colliding pair - #536
Closed
noel-improv wants to merge 1 commit into
Closed
noel-improv wants to merge 1 commit into
noel-improv wants to merge 1 commit into
Conversation
Two documents whose md5 digests agree on their first eight hex characters, found by hashing sequentially numbered documents until a pair collided, which took 30,059 of them. At the default width both produce the source id aws::a4439cdb:d41d, so they share an S3 prefix, share a __Source__ node, and share every derived id. Three groups. The first pins the arithmetic at width 8, so it holds whatever a run is configured to use. The second characterises the cost: one prefix reads back as a single SourceDocument carrying both documents' chunks, and nothing reports it. The third is the assertion a fix has to satisfy, marked xfail(strict=True) so it records red without breaking CI and fails the run once it starts passing. The download helper and the chunk node factory move to conftest, which removes the copy already in test_s3_based_docs.py rather than adding a second one.
Collaborator
Author
|
Closing in favour of #541, which carries these two commits plus the fix, so the reproducer and the change that turns it green land together as one PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
The fix is now up as #541, and it carries these two commits, so the reproducer can land either way. Review this PR for the tests on their own, or review #541 for the tests and the fix together. Merging #541 merges these commits and closes this PR with them.
Nothing here has changed since it was opened. One thing does change in #541: the fix removes the
xfail(strict=True)marker below and pins the graph characterisation tests to the legacy width, since a graph written before the fix still merges the colliding pair.Description
A test that reproduces the source id collision described in #533, so the fix has something to turn green.
create_source_idtruncates the text digest to 8 hex characters, andIdRewriterpasses an empty string for the metadata component when a node carries no metadata, so a corpus loaded without metadata discriminates on 32 bits.The pair below was found by hashing sequentially numbered documents until two shared a digest. It took 30,059 of them:
No production code changes.
Changes
Three groups of tests, each doing a different job.
TestCollidingPairpins the arithmetic at width 8. These are facts about md5 rather than statements about configuration, so they hold whatever a run is set to. One covers the metadata component, which discriminates only when metadata actually differs between documents.TestCollisionConsequencesrecords what the collision costs. One prefix reads back as a single SourceDocument holding both documents' chunks, and nothing logs or raises, so a merged document cannot be told apart from a correct one.TestSourceIdUniquenessis the assertion a fix has to satisfy, markedxfail(strict=True). It reads the configured width rather than a pinned one, so it asserts that the default is wide enough rather than anything about a particular width.The download helper and the chunk node factory move into
tests/unit/conftest.py.test_s3_based_docs.pyalready had a copy of both, so this removes one rather than adding a second.Why xfail(strict=True) rather than a failing test
A plain failing test cannot be committed.
xfail(strict=True)records the red result while leaving CI green, and fails the run once the assertions start passing, so the marker cannot outlive the defect.Testing
pytest)2141 pass, 2 xfailed across
tests/unit. One pre-existing failure is unrelated and reproduces on a clean tree:test_integ_dependency_compatibility.pyerrors withNo module named pipin this venv.Checklist
Related issue: #533.