Skip to content
This repository has been archived by the owner on May 21, 2018. It is now read-only.

Native Provider Source? #4

Closed
tibel opened this issue Feb 1, 2013 · 10 comments
Closed

Native Provider Source? #4

tibel opened this issue Feb 1, 2013 · 10 comments

Comments

@tibel
Copy link

tibel commented Feb 1, 2013

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
Copy link
Contributor

cuda commented Feb 1, 2013

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
Copy link
Author

tibel commented Feb 1, 2013

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:

  • sets Control.LinearAlgebraProvider before the tests run
  • runs the tests in the MathNet.Numerics.UnitTests.dll

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
Copy link
Contributor

cuda commented Feb 1, 2013

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
Copy link
Author

tibel commented Feb 1, 2013

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:

  • is it a generic test that also make sense for the managed provider: push it to mathnet-numerics
  • is it a native only test: use a local matnet-numerics-native test project

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
Copy link
Contributor

cuda commented Feb 1, 2013

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
Copy link
Member

cdrnet commented Feb 1, 2013

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
Copy link
Author

tibel commented Feb 1, 2013

@cdrnet Didn't know that git supports this.

@tibel
Copy link
Author

tibel commented Feb 10, 2013

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 tibel reopened this Feb 10, 2013
@tibel
Copy link
Author

tibel commented Feb 14, 2013

@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
Copy link
Member

cdrnet commented Feb 14, 2013

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).

@cdrnet cdrnet closed this as completed Apr 20, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants