Skip to content

Select a sample's matching jobs by their sample id arguments - #49

Closed
r0ny123 wants to merge 2 commits into
familiary:mainfrom
r0ny123:job-selection-arguments
Closed

r0ny123 wants to merge 2 commits into
familiary:mainfrom
r0ny123:job-selection-arguments

Conversation

@r0ny123

@r0ny123 r0ny123 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #47.

McritInterface.queryJobs(sample_id) kept a job if job.parameters contained the sample id as (id), (id,, ,id, or ,id). Job.parameters joins the arguments with ", ", so the last two forms never matched. A sample that was not a job's first argument was missed: getMatchesForSampleVs(5, 12) showed up for sample 5 but not for sample 12.

Jobs are now matched on Job.sample_ids rather than on the text. That property is the same in core 1.15.0's LocalQueue.py, and it returns the arguments that are sample ids for each method.

  • Not every argument: I didn't match on all of job.arguments, since the thresholds are arguments too. getMatchesForSample(0, 50, 10, 1, 50, 1000) would otherwise be selected for sample 50.
  • Cross compares: Job.sample_ids does not know the getMatchesForSampleVsGroup jobs a cross compare starts. For those, the first argument is checked directly, as the text test did. The combined combineMatchesToCross job stays out, as before. Its result is the cross-compare matrix, not a matching report, so the chooser could not load it.
  • Odd job data: a job whose arguments do not have the shape of its method is skipped, instead of failing the whole query.
  • Unchanged: the server-side filter is the same as before.

Testing

  • tests/core/test_mcrit_interface.py builds real Job objects from a method and its arguments. It covers:
    • the queried sample second in a sample-vs-sample job;
    • a threshold equal to the sample id;
    • a cross compare, offering its per-sample job but not its combined result;
    • a job with arguments of another shape.
  • The sample-vs-sample test fails without the change. The jobs are built as the server stores them, with the knobs as named parameters.
  • Against a local MCRIT 1.15.0, with two samples, getMatchesForSampleVs(0, 1, …) and getMatchesForSample(0, 1, …) (minhash threshold 1):
    • sample 1 now finds the comparison and not the single-sample job;
    • sample 0 finds both.
  • ruff format --check, ruff check, the sync checks and python -m pytest tests (338 tests) pass.

queryJobs kept a job if its rendered parameters contained the sample id
as "(id)", "(id,", ",id," or ",id)". Job.parameters joins the arguments
with ", ", so the last two forms never matched, and a sample that was
not a job's first argument was missed: getMatchesForSampleVs(5, 12) was
found for sample 5 but not for sample 12.

Jobs are now matched on Job.sample_ids, the sample id arguments of each
method, as the server's sample_ids selector reads them. A threshold that
happens to equal the sample id does not count, which matching every
argument would have allowed. Job.sample_ids does not know the
getMatchesForSampleVsGroup jobs of a cross compare, so their first
argument is checked directly, as the text test did. A job whose
arguments do not have the shape of its method is skipped instead of
failing the whole query.
Selecting jobs by Job.sample_ids also found combineMatchesToCross jobs,
whose sample ids are the keys of their first argument; the text test
never matched them. Their result is the cross-compare matrix, not a
matching report, so MatchingResult.fromDict fails on it ("info" is
missing) and the chooser reported "Result query failed". After a cross
compare that job is also the newest finished one, which the chooser
preselects. Those jobs are skipped again; the per-sample
getMatchesForSampleVsGroup jobs of a cross compare stay selectable.

The tests now build jobs as the server stores them, with the knobs as
named parameters after the positional sample ids.
@r0ny123

r0ny123 commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #50, which also handles the group list of a cross compare's per-sample job.

@r0ny123 r0ny123 closed this Oct 15, 2026
@r0ny123
r0ny123 deleted the job-selection-arguments branch October 15, 2026 19:49
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.

Job selection misses a sample that is not the first argument of a matching job

1 participant