Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluidUMAP: Crash if number input points < numNeighbours + 1 #187

Open
tremblap opened this issue Jul 10, 2022 · 3 comments
Open

FluidUMAP: Crash if number input points < numNeighbours + 1 #187

tremblap opened this issue Jul 10, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@tremblap
Copy link
Member

this patch with this soundfile crash max when at point 2.5 (umap) -there must be something in the points that triggers an exception. Both in Test home compile and in Release CI compile.
Archive.zip

@tremblap
Copy link
Member Author

bug report in Test mode:

Process: Max [1475]
Path: /Applications/Max.app/Contents/MacOS/Max
Identifier: com.cycling74.Max
Version: 8.2.1 [2f7eaf31afd] (8.2.1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Max [1475]
User ID: 501

Date/Time: 2022-07-10 14:20:03.533 +0200
OS Version: macOS 11.2.1 (20D74)
Report Version: 12
Anonymous UUID: 1CEE2877-ACA1-AF56-6B62-4814F29E546A

Time Awake Since Boot: 720 seconds

System Integrity Protection: enabled

Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
Assertion failed: (impl::checkBounds(mDesc, args...) && "Arguments out of bounds"), function operator(), file /Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/fluid_decomposition/include/clients/nrt/../common/../../data/FluidTensor.hpp, line 568.

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff2047a462 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff204a8610 pthread_kill + 263
2 libsystem_c.dylib 0x00007fff203fb720 abort + 120
3 libsystem_c.dylib 0x00007fff203fa9d6 __assert_rtn + 314
4 org.flucoma.fluid.libmanipulation 0x0000000134592c92 fluid::algorithm::UMAP::makeGraph(fluid::FluidDataSet<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, double, 1l> const&, long, Eigen::SparseMatrix<double, 0, int>&, Eigen::Ref<Eigen::Array<double, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> >, bool) const + 946
5 org.flucoma.fluid.libmanipulation 0x00000001345907bd fluid::algorithm::UMAP::train(fluid::FluidDataSet<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, double, 1l>&, long, long, double, long, double) + 1277
6 org.flucoma.fluid.libmanipulation 0x000000013458c58f fluid::client::umap::UMAPClient::fitTransform(fluid::client::SharedClientRef<fluid::client::dataset::DataSetClient const>, fluid::client::SharedClientReffluid::client::dataset::DataSetClient) + 1039

@weefuzzy
Copy link
Member

weefuzzy commented Jul 11, 2022

Think this is a duplicate of #104 Actually, no. Same basic problem (not enough points) but different code path.

@weefuzzy weefuzzy added duplicate This issue or pull request already exists bug Something isn't working and removed duplicate This issue or pull request already exists labels Jul 11, 2022
@weefuzzy weefuzzy changed the title umap crashes max with a specific sound FluidUMAP: Crash if number input points < numNeighbours + 1 Jul 11, 2022
@weefuzzy
Copy link
Member

In makeGraph we can see that the code assumes it can rely on there being at least numNeighbours + 1 data points if discardFirst is true.

@g-roma I'm assuming the thing to do here, as with #104, is to add a check into UMAPClient that we actually have enough data points to proceed, and maybe also an assertion here in makeGraph ?

void makeGraph(const DataSet& in, index k, SparseMatrixXd& graph,
Ref<ArrayXXd> dists, bool discardFirst) const
{
graph.reserve(in.size() * k);
auto data = in.getData();
for (index i = 0; i < in.size(); i++)
{
auto nearest = mTree.kNearest(data.row(i), discardFirst ? k + 1 : k);
auto nearestIds = nearest.getIds();
auto distances = nearest.getData().col(0);
for (index j = 0; j < k; j++)
{
index pos = discardFirst ? j + 1 : j;
index neighborIndex = stoi(nearestIds(pos));
dists(i, j) = distances(pos);
graph.insert(i, neighborIndex) = distances(pos);
}
}
}

fearn-e pushed a commit to fearn-e/flucoma-core that referenced this issue Aug 15, 2023
fearn-e pushed a commit to fearn-e/flucoma-core that referenced this issue Aug 15, 2023
* optional args: add to wrapper

* MaxWrapper: Add choices param (list of symbols <-> bitset)

* changing preset and interface for noveltyslice examples

* correct typos and misconnections in helpfiles (onsetslice and bufselectevery)

* Buf2List(2Buf): Correct atom type

Fixes MSVC debug builds

* kdtreehelp: now loads programatically, in order, from the stored labelset (flucoma#184)

* now loads programatically, in order, from the stored labelset

* corrected a view

* also, fluid.umap helpfile now uses the loader

* fix flucoma#185 

`ControlIn` objects
– properly adjust `ac` when adjusting `av` 
– ensure mListSize is always intialized to something 
– fix resize logic

* Enhance/max params (flucoma#182)

* CMake: Centralise C++ version and set to 17

* Wrapper: Handle new LongRuntimeMax parameter type

* POC for better buffer object chaining (flucoma#140)

* start of POC for buffer management stuff, needs fix to ParamDesc NumOf in core

* working POC for managing internal output buffers and process chaining 

relies on some pending updates to core

* Don't override box arguments with default buffers

* NRT: One outlet per output buffer, no progress outlet, draw progress on box

* Messages: Default instances for output container args

* updates to message default instances that don't break all other objects

* Add optional range arguments to buffer message in left inlet

* Stop MSVC being sad

* Wrapper: fix merge casuality

* [Fix] Broken patches due to new dataset/buffer interface interface (flucoma#195)

* update dataset

* fix broken cabling in datasetquery

* update kmeans

* make more max-like in style

* "maxify" the style

* fix connections and maxify style of labelset~

* fix connections in umap and maxify

* fix connections and mafixy fluid.grid~

* update kdtree~ help with fixed cables and max style

* fix connections and maxify style of normalize

* cosmetic upgrades

* update fluid.plotter cables

* fix bufstats due to tb

* [Fix] Missing OnsetSlice Files (flucoma#197)

* restore to previous state

* fix some style errors

* fix style issues

* Wrapper: Update for new `maxFFTSize`

* [Docs] BufCompose Help File (flucoma#155)

* griddify patch tab s

* update first tab

* second tab

* macros

* subsections tab

* small cosmetic changes

* update final tabs of help file

* make tab 2 playable

* clean tab 3

* cosmetic

* PAs addendums

* Wrapper: Fix reset for shared objects. fixes flucoma#43 

Will 'reset' to whatever was in the box that the message was called on, 
so potential for confusion...

* Wrapper: Fix managed object aliasing in message invocations. fixes flucoma#190

* List2Buf: Correct outlet type. fixes flucoma#196

* [Docs] BufSpectralShape Help File (flucoma#156)

* grid it out

* bufspectralshape help file

* add a layout of results tab

* add @select tab and final changes

* translate SC -> Max (flucoma#187)

* Wrapper: call params::set() properly for long array attrs 

To ensure that client objects  like attrui update properly in shared 
instances

* touch up ampslice example with Rod's audio

* prepare help file

* shell out the tabs

* ampslice updates

* Wrapper: Use raw value for maxFFT when refreshing attribute

* [Help] Pitch and BufPitch SC Translations (flucoma#200)

* layout

* cleanup and translate

* update bufpitch to match sc

* fix various errors in help files (flucoma#204)

* [Docs] NoveltySlice Help Files (flucoma#146)

* update noveltyslice

* shell out bufnovelty

* small cosmetic updates

* small layout issues

* update bufnoveltyslice to be similar to RT algo

* cosmetic

* tune parameters for second tab

* add a progression for tweaking parameters

* [Fix] Saner maximum sizes for modulatable examples (flucoma#205)

* add bigger maximums for noveltyslice for modulation fun

* set a bigger maximum kernelsize for realtime playing

* maximum parameter tweaks

* [Fix] Various Bug Fixes From PA (flucoma#210)

* fix bufcompose

* fix bufampslice playback

* change from groove to play

* corrected players of 2nd tabs fixing flucoma#202

* Wrapper: Trying once again to get maxParams logic correct

* neaten and provide an example (flucoma#216)

perfect thanks!

* [Docs] HPSS and BufHPSS translation (flucoma#219)

* prepare help files with grid/fonts

* cleanup help file layout

* cleanup help files

* update remaining tabs for hpss

* [Docs] MFCC and BufMFCC Translation (flucoma#217)

* update rt mfcc

* update bufmfcc to match translation better

* PAs review

* [Docs] MelBands + BufMelBands Translation (flucoma#214)

* translate rt version

* add ioscbank and size $1

* translate bufmelbands

* fix loadbang mistake

* [Docs] BufFlatten Translation (flucoma#218)

* update bufflatten

* normalise fonts and grid size

* cosmetic movements

* change language around buffer management

* [Docs] Update fluid.list2buf (flucoma#188)

* update list2buf help file

* change language in resize tab

* resize destination buffers downwards

* list2buf - list typo

* bufmelbands - corrected loadbang issue

* bufmfcc - typo

* Enhance/generate stubs (flucoma#231)

* CMake: Generate .cpp files

* CMake: Ensure MSVC compiles commonsyms.c

Enable C as a language for project...

* Remove all old handwritten CMake and stubs

* CMake: Tidy up Max SDK setup

* CMake: ensure correct MSVC runtime by default

* CMake: Correct hints for Max SDK libs

* CMake: Asking once again to compile happily on two platforms

* CMake: install prefix is a cache variable

* CMake: Move install prefix override

* CMake reinstate target for triggering docs in ALL

* CMake: Tidy up

* CMake: typo

* Wrapper: FFT max set properly after initialization

* CI: Update nightly workflow

* CI: use correct branches

* CI: remove reference to docs job

* CMake: belatedly add branch selection for flucoma deps upon which CI relies

* Reinstate package-json generation

* [Docs] NMFFilter Translation (flucoma#222)

* translate nmffilter

* make ezdac local

* [Docs] BufStats translation (flucoma#220)

* prepare bufstats help file

* in progress

* full translation

* add a derivative tab

* cosmetics

* remove debug print

* [Docs] NMFMatch Translation (flucoma#221)

* prepare and grid

* work on compressor example

* work in compressor parameters

* finish translation

* alter compressor example to be less idiosyncratic with vector sizes

* [Docs] MLPClassifier Translation (flucoma#226)

* wip

* mlpclassifier translation

* add caveat about predicting whole dataset

* layout

* [Docs] BufNMF Translation (flucoma#229)

* grid and format

* WIP

* translation of nmf sc

* remove nooiseplay vocoder

* cleanup small errors

* make channel offset permanent

* vocoder pfft patch

* add back vocoder example with tweaks

* mds translation (flucoma#235)

* [Docs] RobustScaler SC Translation (flucoma#234)

* translate standardisation

* grid out

* translation

* add scaler visualisation back

* scaler comparison re-usable tab

* update with visualisation and comparison together

* [Docs] Standardise SC Translation (flucoma#233)

* translate standardisation

* grid out

* translation

* add scaler visualisation back

* scaler comparison re-usable tab

* update with visualisation and comparison together

* commit patch

* update title

* add scaler comparison

* [Docs] MLPRegressor Translation (flucoma#228)

* prepare help file

* shell out tabs

* mlpregressor translation

* [Fix] Plotter internal state management (flucoma#242)

* refactor code to be handle state in a more legible manner

* only output position on mousedown (not mouseup)

* instantiate fluid.plotter with no border

* dont reset domain/range state with clear

* fix help file

* CMake: Pick up new Client tag to control tildes in external names better

* updated nmf examples with new interface

* change @SiZe to @history (flucoma#243)

* [Enhance] Manual Documentation for CCE Objects (flucoma#250)

* install the contents of manual_docs to release-packaging docs

* add manual docs

* rename manual_docs to local_docs

* update CMake to respect new path name

* use more robust path for local docs

* add default arguments and buffer messages

* en-quote

* add max list size as argument

* provide use case for spectrogram

* caveat about manual interaction with slices

* update descriptions and digest

* return destination -> source

* [Fix] Various patcher bugs (flucoma#253)

* fix bufselect~

* blank out bufstats values in messages

* fix feature patches with new interface

* cosmetic fix on kmeans

* add feature objects to landing page

* [Docs] Stats SC Translation (flucoma#245)

* grid it out

* update first tab

* mimic Ted's real use case tab

* normalize hehe the normalize help file with other scalers (flucoma#246)

* [Docs] PCA SC Translation (flucoma#247)

* add whitening tab

* add stackexchange link

* [Docs] BufNNDSVD SC Translation  (flucoma#251)

* update nndsvd help file to match sc

* fix numchans error

* translation (flucoma#255)

* [Docs] STFT SC Translation (flucoma#248)

* prepare help file

* rework first tab

* in progress

* cleanup first tab

* musical stft example

* mild cleanup

* finish musical example

* change sound file examples

* translate knnregressor (flucoma#256)

* [Docs] NMFMorph SC Translation  (flucoma#258)

* start editing

* wip

* translate nmfmorph

* [Docs] BufNMFCross SC Translation (flucoma#254)

* prepare help file

* translation

* delete superfluous tab

* typo in bufnmf help

* [Fix] Various load issues  (flucoma#261)

* fix maxsize argument for bufaudiotransport

* fix broken patch cables in bufchroma

* fix loading error

* fix broken dataset cables

* fix maxsize

* maxsize

* cosmetic

* broken cables

* stats maxsize

* typo

* cosmetic

* small cosmeti fixes

* cosmetic touch ups

* always load even if loadbang is disabled

* non local ezdac (flucoma#262)

* change of interface (flucoma#260)

* typo

* skmeans translation from SC (missing one tab also missing in kmeans) (flucoma#264)

* [CI] Update Release Workflow (flucoma#266)

* cleanup nightly release

* normalise naming extensions

* update release

* Revert "normalise naming extensions"

This reverts commit 23985181a41d9521e3a335a2d739a7bcbb9a8c3f.

* update extension

* remove workflow dispatch variables

* [Docs] Transients Family Translation  (flucoma#259)

* translate transientslice

* translate buftransientslice

* fluid.transients~ translation

* cosmetic

* translate buftransients

* make mc example dual mono

* add zoom on content

* [Docs] AmpGate SC Translation (flucoma#241)

* grid help file

* translate ampgate

* cosmetic

* silence removal example

* neaten patch

* finish off lookahead/lookback prettification

* fix onset/offset conceptual break

* defer loading of tab 3

* cosmetic

* MaxWrapper: Ensure box is properly released from `progress` upon cancel

* [Docs] (S)Kmeans Distances Tab (flucoma#267)

* add distance tab

* add argument for choosing default dataaset

* add distances tab

* add distances tab

* cleanup

* beta testing patches updated for beta7 (flucoma#268)

* typo

* typo

* typo

* fix release worflow

* fix bad path

* fix branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants