feat: Implement intelligent sequence matching for frame offsets in test comparison#1080
Open
DYHARDx wants to merge 1 commit intoCCExtractor:masterfrom
Open
feat: Implement intelligent sequence matching for frame offsets in test comparison#1080DYHARDx wants to merge 1 commit intoCCExtractor:masterfrom
DYHARDx wants to merge 1 commit intoCCExtractor:masterfrom
Conversation
|
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.



Description
This PR addresses a core requirement mentioned in the "Sample Platform NG" GSoC brief: improving the regression test comparison algorithm to gracefully handle frame offsets.
Previously, mod_test/nicediff/diff.py evaluated the actual vs. expected test results strictly line-by-line (1-to-1 index matching). If a single subtitle frame was dropped or offset, it triggered a chain reaction where all subsequent frames were incorrectly labeled as a mismatch, causing the entire test to fail unnecessarily.
This PR refactors get_html_diff to leverage Python's built-in
difflib.SequenceMatcher.Changes Made
import difflibsm.get_opcodes().replace,insert,delete,equal) and parses the text into HTML blocks.diff-table-tdempty rows mapping), ensuring the rest of the output resyncs and reads accurately without a false-negative cascading failure!Related Issue
Fixes #1079
GSoC Context
I am submitting this PR as my qualification task for GSoC (Sample Platform NG project).
Checklist before review
pycodestyle ./ --config=./.pycodestylerc)