mathnet / mathnet-numerics-native

Native Providers for Math.NET Numerics (obsolete, now included in mainline repo)
11 stars 12 forks source link

Native Provider Source? #4

Closed tibel closed 11 years ago

tibel commented 11 years ago

The source of the native provider is currently in mathnet-numerics. Wouldn't it make sense to move the provider source over here.

Then mathnet-numerics will only contain the provider interface and managed implementation. The native provider source would be in this repo.

I think this would make it easier for others to add/change native providers (e.g. codeplex issue Algorithms.LinearAlgebra.Acml disappeared).

What do you think?

cuda commented 11 years ago

I originally tried that, but ran into a problem with the unit tests. The wrapper unit tests use the source code from the UnitTests project in mathnet-numerics. This requires mathnet/mathnet-numerics to be a subproject of mathnet-numerics-native. Now when I changed the unit tests from mathnet-numerics-native, the changes are in the mainline of mathnet/mathnet-numerics, not my fork of mathnet-numerics-native. How would I commit them since I don't have access mathnet/mathnet-numerics? This could just be my ignorance of git. If you know of a way to handle the unit tests across the the two projects, it would be great to move the wrapper code to mathnet-numerics-native.

tibel commented 11 years ago

As I understand the tests: There is a UseLinearAlgebraProvider attribute that sets Control.LinearAlgebraProvider before the tests run.

It should be possible to create a custom test runner (or a NUnit Addins), that:

Then there is no source dependency, but the same tests are executed with the selected native provider. Also it would be possible to execute the tests with different native providers, that isn't possible with the attribute now.

cuda commented 11 years ago

That is a cleaner approach than having a test project per provider. However, I don't think it solves the problem. Wouldn't the native project still need to have mathnet-numerics as a sub-project in order to build the test project and custom test runner/add-in? If I wanted to modify the tests to cover a newly discovered bug in the native provider, how would I do so? Other than updating my mathnet-numerics fork, submitting a pull request, wait for it to be merged, and then update the sub-project in mathnet-numerics-native.

Could you explain how you would set things up? --thanks Marcus

tibel commented 11 years ago

I thought on using the test dll from mathnet-numerics project (not rebuilding it) and run it with the native provider. For this mathnet-numerics would have to release the test dll.

When adding a new test it depends:

This should minimize the need to push every new test to mathnet-numerics, but for some tests it might make sense. Hope this is not to weird to follow.

cuda commented 11 years ago

OK I see. I'm not sure I agree with that approach, but its Chris' call.

A note on the tests though. There should only be one set of tests, since we should be testing everything through the provider interface. A provider should pass all tests even if a test was added to test a quirk in one of the other providers.

cdrnet commented 11 years ago

I've just made mathnet-numerics/master available in the Numerics subdirectory. It is bi-directional, meaning that we can bring any changes made here back to mainline and also the other way round. It will even work with forks and github pull requests, although somewhat indirectional via the other fork of mathnet-numerics itself where the pull request then must be made. I can explain how it works step by step (actually not that complicated, it even works fine if commit cover changes both in out out of the Numerics subdirectory).

Note that I'm using neither submodules nor subtrees, but just the subtree merge strategy.

Let me know whether that works for you.

tibel commented 11 years ago

@cdrnet Didn't know that git supports this.

tibel commented 11 years ago

At the moment they are not in sync. last commit on mathnet-numerics/master is 6 days old last commit on mathnet-numerics-native is 4 days old

Or I'm missing something?

tibel commented 11 years ago

@cdrnet It seems that changes on native providers from @cuda are not pushed to mathnet-numerics/master. They are only part of mathnet-numerics-native/master, what makes it a fork?

cdrnet commented 11 years ago

Ah, sorry for the confusion. The subtree is not meant to be synchronized automatically in either way, by design. But we can merge all changes on either side over to the other, squashed, in a reliable way with only one or two git commands (I really need to do that blog post explaining how it works).