Skip to content

Update Duplicate Detection - #77

Open
Lightning11wins wants to merge 488 commits into
masterfrom
dups
Open

Lightning11wins wants to merge 488 commits into
masterfrom
dups

Conversation

@Lightning11wins

@Lightning11wins Lightning11wins commented Nov 14, 2025 •

Copy link
Copy Markdown
Contributor

The duplicate detection project is ready to review, although (best case), there are still a couple of things blocking it from being ready to merge.

I would appreciate a full review of all changes, as there's quite a lot here. That said, some areas may require additional special attention, so I've compiled a list of all 28 TODO: Greg comments below. (Note: Some of my todos assume the reader understands various pieces of nearby context / has generally read the indicated source code.)

  • 3 TODO: Gregs in objdrv_cluster.c
  • 1 TODO: Greg in mtsession.md.
  • 1 TODO: Greg in xarray.md.
  • 1 TODO: Greg in xstring.md.

Please let me know if you have any questions, comments, or concerns about my changes and design choices.

GitHub Relationships

@Lightning11wins

Copy link
Copy Markdown
Contributor Author

Kardia PR.

gbeeley
gbeeley previously requested changes Dec 4, 2025

@gbeeley gbeeley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass here, covering all of the documentation and other parts of this PR except the clusters.c and objdrv_cluster.c files. Thanks!

Comment thread centrallix-lib/include/clusters.h Outdated
Comment thread centrallix-lib/include/util.h Outdated
Comment thread centrallix-lib/src/xhash.c Outdated
Comment thread centrallix-lib/src/xhash.c Outdated
Comment thread centrallix/tests/test_levenshtein_00.to Outdated
Comment thread centrallix-sysdoc/OSDriver_Authoring.md Outdated
Comment thread centrallix-sysdoc/OSDriver_Authoring.md Outdated
Comment thread centrallix-sysdoc/OSDriver_Authoring.md Outdated
Comment thread centrallix-sysdoc/OSDriver_Authoring.md Outdated
Comment thread centrallix-sysdoc/OSDriver_Authoring.md Outdated
@gbeeley

gbeeley commented Dec 4, 2025 •

Copy link
Copy Markdown
Member

Ok, this is odd. Github crashed when I submitted this PR review. This initial review is for everything except the core of this PR (clusters.c and objdrv_cluster.c). So I'm not sure Github submitted this correctly.

@Lightning11wins

Copy link
Copy Markdown
Contributor Author

FYI: I just cleaned up my todos for you, but I also updated and reorganized the lists in each PR so that they only include todos in their respective branches.

@Lightning11wins

Lightning11wins commented Dec 12, 2025 •

Copy link
Copy Markdown
Contributor Author

FYI: I am aware that most of my functions are missing the required final return; statement. I'll get to that next time I'm on this branch.

Just pushed a commit to fix this.

@Lightning11wins Lightning11wins added the testing Includes testing, either new tests or updates to existing tests. label Jan 9, 2026
@nboard nboard self-assigned this Feb 2, 2026
@Lightning11wins

Lightning11wins commented Feb 21, 2026 •

Copy link
Copy Markdown
Contributor Author

@Lightning11wins Review this PR to look for usages of DateTime that assume the Value property represents "seconds since the Epoch". This assumption is false.

Resolved

@Lightning11wins

Copy link
Copy Markdown
Contributor Author

PR cleared for human review.

@nboard nboard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, excellent work! I can tell you put a lot of care into making sure the code was readable and well documented.

All of requested changes are open to discussion, so please reach out to me with any questions.

Comment thread centrallix-doc/Widgets/widgets.xml
Comment thread centrallix-lib/include/clusters.h Outdated
/* Centrallix Application Server System */
/* Centrallix Core */
/* */
/* Copyright (C) 1998-2012 LightSys Technology Services, Inc. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is meant to be through the year the file was last changed (though it seems we generally do a bad job of updating it). I would at least put it through the date it was created, though.
To avoid burying you in (even more) comments I'll just mention it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I think we later came to the conclusion that all licenses in modified files should be updated, but I forgot to apply that to this project.

I've applied this change to all modified files on this branch. Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like xarray and mtsession both had a decent number of changes but never had their copyright dates updated. Was there a reason you did not want to update the dates on those?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot, updated.

Comment thread centrallix-lib/include/clusters.h Outdated
Comment thread centrallix-lib/include/clusters.h Outdated
Comment thread centrallix-lib/include/clusters.h Outdated
Comment thread centrallix/osdrivers/objdrv_cluster.c Outdated
Comment thread centrallix/osdrivers/objdrv_cluster.c Outdated
Comment thread centrallix/osdrivers/objdrv_cluster.c Outdated
if (source_data->Strings == NULL) goto err_free;
data_xarray.nAlloc = 0;

/** Trim and store vectors. **/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the second or third call to ci_xaToTrimmedArray fails, then source_data has either keys or keys and strings which never get freed, and which get ignored by the calling function on failure, and thus would be leaked.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yup, I think I see that. It should be fixed now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is still a problem, since the only place the contents of the strings in the arrays are freed requires the xArrays to exist. That is, if an error occurs after one or more xArray is freed, then the list itself stored in source_data is freed, but not the strings stored by the list

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a proper cleanup goto so the memory leaks should be fixed now.

Comment thread centrallix/osdrivers/objdrv_cluster.c Outdated
Comment thread centrallix-lib/src/clusters.c Outdated
@Lightning11wins Lightning11wins added the ai-review Request AI review for PRs. label Mar 23, 2026
@Lightning11wins

Copy link
Copy Markdown
Contributor Author

@greptileai Review this PR please. :)

@greptile-apps

greptile-apps Bot commented Mar 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because no blocking failure remains from the prior review threads.

Summary

The PR introduces duplicate-detection support built around string similarity, clustering utilities, and a new cluster object driver, while also expanding tests and shared-library helpers.

  • Adds cosine, Levenshtein, metaphone, sparse-vector, search, and k-means functionality.
  • Adds cluster schema, configuration, object-driver integration, datasets, and regression coverage.
  • Updates shared memory, collection, string, parser, build, and test infrastructure used by the feature.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Input[Source object data] --> Driver[Cluster object driver]
    Driver --> Normalize[String/vector preparation]
    Normalize --> Similarity[Cosine or Levenshtein similarity]
    Similarity --> Search[Pair search]
    Similarity --> KMeans[K-means clustering]
    Search --> Results[Duplicate/query results]
    KMeans --> Results
Loading

Reviews (15) · Last reviewed commit: "Fix mistakes and typos."

Comment thread centrallix/osdrivers/objdrv_cluster.c
Comment thread centrallix/utility/double_metaphone.c Outdated
@Lightning11wins

Copy link
Copy Markdown
Contributor Author

@greptileai Please re-review.

Comment thread centrallix-lib/src/clusters.c Outdated
@Lightning11wins

Copy link
Copy Markdown
Contributor Author

@greptileai Please re-review.

Comment thread centrallix/osdrivers/objdrv_cluster.c
# Conflicts:
#	centrallix-lib/tests/test_utils.h
# Conflicts:
#	centrallix-lib/tests/test_strtcpy_13.c
Wow, how many more of these are there!?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request AI review for PRs. blocked No more work can be done until other work is completed. documentation Changes, improvements, or fixes to documentation files. size: large Definitely very hard to review, probably well over 5000 lines. testing Includes testing, either new tests or updates to existing tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants