Hi Chip, maybe this has already been discussed before but I am wondering if you are considering supporting dead code removal in Spin2, so the final binary image size can be reduced whenever some included object methods are not called? Is this something that you think might be feasible at some (later) time or does the current object implementation preclude it for a particular reason?
Having this capability would be very useful as would allow us to write larger library objects in Spin2 that could be shared, and when only a subset of its methods are required the user's image doesn't need to bloat by the total size of the entire library.
For example we could have an extensive graphics library with lots of drawing functions in lots of colour depths/modes, or a string manipulation library, or a maths/floating point library etc. People could then include these without worrying that it will bring in every single method and grow their image too much especially when they might only actually need a small handful of its methods. I know you could try to cut/paste just what you need from the library's source if you have it if the code is simple to follow, but for more complex code it could get harder to first decipher the library and understand all its data dependencies etc to see what other VAR/DAT sections might be required in order to use it. Some people may not want to go to those lengths. They just want to use something that is already coded and works for them.
So it would be great if the Spin2 build tools did this uncalled method removal automatically. Today FastSpin can do this but I don't think PNut can, or at least it didn't shrink my image when I tested it recently with PNut34s when including uncalled methods, so it doesn't appear to support it (yet). What are your thoughts on this?
Hi Chip, maybe this has already been discussed before but I am wondering if you are considering supporting dead code removal in Spin2, so the final binary image size can be reduced whenever some included object methods are not called? Is this something that you think might be feasible at some (later) time or does the current object implementation preclude it for a particular reason?
Having this capability would be very useful as would allow us to write larger library objects in Spin2 that could be shared, and when only a subset of its methods are required the user's image doesn't need to bloat by the total size of the entire library.
For example we could have an extensive graphics library with lots of drawing functions in lots of colour depths/modes, or a string manipulation library, or a maths/floating point library etc. People could then include these without worrying that it will bring in every single method and grow their image too much especially when they might only actually need a small handful of its methods. I know you could try to cut/paste just what you need from the library's source if you have it if the code is simple to follow, but for more complex code it could get harder to first decipher the library and understand all its data dependencies etc to see what other VAR/DAT sections might be required in order to use it. Some people may not want to go to those lengths. They just want to use something that is already coded and works for them.
So it would be great if the Spin2 build tools did this uncalled method removal automatically. Today FastSpin can do this but I don't think PNut can, or at least it didn't shrink my image when I tested it recently with PNut34s when including uncalled methods, so it doesn't appear to support it (yet). What are your thoughts on this?
Cheers,
Roger.
Yes, I need to make it work this way. I've thought about this, but not so far, yet, that I know how to achieve it, exactly.
I think I could set a bit flag in each method index when a method is referenced, and then OR all those flags together for each method when redundant objects are removed. As a very last compilaton step, I could remove the dead code, but not the index data because it would throw everything off. I need to think about it more.
Right now, I"m working on graphical debugging displays.
Ok sounds good Chip, thanks. It will be much better for reducing sizes when Spin2 is capable of unreferenced method removal.
Graphical debugging sounds handy. Is it Windows only for now, or is it something that is also going to be done on the P2 target?
It is host-based. You name and configure various scope windows and then feed them update data by name. It uses the current DEBUG commands. It is for Windows now.
I tend to use Propeller Tool but decided to open PNut today to check on something.
-- it was removed from my system (I don't know when)
-- attempting to download... "Failed - Virus Detected"
I still had the ZIP (u) from a couple weeks ago, so I copied PNut from it to my working directory. Within about 10 seconds is disappears. Windows Defender is on a search-and-destroy mission.
I tend to use Propeller Tool but decided to open PNut today to check on something.
-- it was removed from my system (I don't know when)
-- attempting to download... "Failed - Virus Detected"
I still had the ZIP (u) from a couple weeks ago, so I copied PNut from it to my working directory. Within about 10 seconds is disappears. Windows Defender is on a search-and-destroy mission.
Can't you just add the file to the Windows Defender exclusion list? I can't test it right now since I'm on my Linux machine, and I don't have my Windows 10 computer with me. I googled "how to stop windows defender from deleting files", and one of the links said to add the file to the exclusion list. I searched through this thread, and didn't find the term "exclusion", so no one has suggested this yet?
There where workarounds but they don't work for me anymore. Chip needs to fix this quickly. Many new members will never come back to the P2 if this is not fixed.
For Windows 10, "Settings"->"Update and Security"->Windows Security->"Virus and threat protection" (even if it says "No actions needed."). Then under the "Quick Scan" button, click "Protection history".
A faster way is to click on the "Start" task bar icon, then type "Virus and threat protection" to go straight to the "Current threats" settings.
There where workarounds but they don't work for me anymore. Chip needs to fix this quickly. Many new members will never come back to the P2 if this is not fixed.
I'm kind of worried that my code will continue to set off their alarms. I can't change it enough to stop their recognition, probably.
Here is my working version. I renamed it P2Tool.exe. See if this works:
Sort of the same for me... But, after "Run Anyway", a black box showed up in lower right corner of screen telling me that a virus check was required and may take up to 10 seconds to complete.
But, after that it ran.
Sort of the same for me... But, after "Run Anyway", a black box showed up in lower right corner of screen telling me that a virus check was required and may take up to 10 seconds to complete.
But, after that it ran.
So, much improved!
I didn't do anything. That's just my current working version. I have Delphi debugging enabled, so the file is larger than normal. If files are sufficiently porcine, they pass the health check.
I just downloaded and ran the .exe and I had to click "More Info" to allow it, and then "Run Anyway" in a later menu. After that, it ran.
kg1 30th July
I have installed and used all of the PNut versions listed in the attachment. Note my version of windows in the next attachment. Note how my Windows Defender is setup in the next attachment. Once with each of the two most current versions of PNut I have asked Sophos to recover the archived PNut files which their system did. I have never been unable to run and use PNut.
@Cluso99 I do not think Windows Defender has a personality. Microsoft staff have a "narrow" view of what is good user behavior. Perhaps they track user behavior under windows os license number + Microsoft logon.
I just downloaded and ran the .exe and I had to click "More Info" to allow it, and then "Run Anyway" in a later menu. After that, it ran.
This has worked for me on all of the files listed in my attachment. There are so many variables over so many members of this thread e.g. machine, version & type of os, maintenance, where Pnut is installed or run from and user behavior etc that @cgracey would be unwise to make a policy decision based on the incomplete reports made on this thread.
My computer was acting funny, so I rebooted and Microsoft installed Edge. There was no way out of it.
I went to download the last file I posted and, sure enough, it said it was a virus. I clicked my way through a few things to get it off my back, then I unzipped it. After about a second, it deleted the .exe file and said that it had removed a threat. I found my way through some other non-intuitive menus and got the program back. This is really lousy. You can't write Windows programs, anymore, without their agreement, it seems.
My computer was acting funny, so I rebooted and Microsoft installed Edge. There was no way out of it.
Win10 is renowned for becoming flaky when there is a large backlog of updates cued to be installed. It showed up badly a few years back when "shutdown" was hibernating by default. Updates just kept cueing up until something fell over.
A self hosting development board, kind of the super prop plug is a solution.
All the basics are there and we just need a Spin2 Compiler running on the P2. Chip started something, but seem to got stuck until he has some new thought.
Maybe fastspin via RISCV emulation, GCC should do that, but I think without Hyper ram support we will fall flat on the face again.
@mpark's Spinx did work very well on P1, but some of it is a binary blob so I never was able to really understand how it worked, but it basically run different programs chained to each other passing some parameters.
Very impressive and just stumbles at programs to big to fit together with the compiler.
Porting that to the P2 would help a lot. Right @mpark?
@cgracey Looking into the future, business relationships are important. Future sales may depend on those relationships. If you have a customer that is a significant user of MS, you may not wish a few thoughts express on a public forum to effect such future business. Bing has web crawlers. Also there is the problem of gossip and the wrong interpretation of feelings you might express. Perhaps no one in MS has ever looked at your executable and what has happened is all machine driven. I am not suggesting that your company should ask MS for advice rather to ask why are they doing what they are doing.
@cgracey Looking into the future, business relationships are important. Future sales may depend on those relationships. If you have a customer that is a significant user of MS, you may not wish a few thoughts express on a public forum to effect such future business. Bing has web crawlers. Also there is the problem of gossip and the wrong interpretation of feelings you might express. Perhaps no one in MS has ever looked at your executable and what has happened is all machine driven. I am not suggesting that your company should ask MS for advice rather to ask why are they doing what they are doing.
I understand what you are saying, kg1, but it's a fact that all the big tech companies are becoming more and more controlling. I would feel a lot better being outside of their systems.
A self hosting development board, kind of the super prop plug is a solution.
All the basics are there and we just need a Spin2 Compiler running on the P2. Chip started something, but seem to got stuck until he has some new thought.
Maybe fastspin via RISCV emulation, GCC should do that, but I think without Hyper ram support we will fall flat on the face again.
@mpark's Spinx did work very well on P1, but some of it is a binary blob so I never was able to really understand how it worked, but it basically run different programs chained to each other passing some parameters.
Very impressive and just stumbles at programs to big to fit together with the compiler.
Porting that to the P2 would help a lot. Right @mpark?
Anyways, I can't run Pnut either.
Mike
There is the full source for the Sphinx compiler. I converted it to run under my OS and use Kye’s FAT driver, and that source is also available, but I am not confident it’s fully debugged.
But the underlying spin2 is very different to spin1. IMHO Chip really needs to be the one to write a P2 self-hosted compiler.
Comments
Hi Chip, maybe this has already been discussed before but I am wondering if you are considering supporting dead code removal in Spin2, so the final binary image size can be reduced whenever some included object methods are not called? Is this something that you think might be feasible at some (later) time or does the current object implementation preclude it for a particular reason?
Having this capability would be very useful as would allow us to write larger library objects in Spin2 that could be shared, and when only a subset of its methods are required the user's image doesn't need to bloat by the total size of the entire library.
For example we could have an extensive graphics library with lots of drawing functions in lots of colour depths/modes, or a string manipulation library, or a maths/floating point library etc. People could then include these without worrying that it will bring in every single method and grow their image too much especially when they might only actually need a small handful of its methods. I know you could try to cut/paste just what you need from the library's source if you have it if the code is simple to follow, but for more complex code it could get harder to first decipher the library and understand all its data dependencies etc to see what other VAR/DAT sections might be required in order to use it. Some people may not want to go to those lengths. They just want to use something that is already coded and works for them.
So it would be great if the Spin2 build tools did this uncalled method removal automatically. Today FastSpin can do this but I don't think PNut can, or at least it didn't shrink my image when I tested it recently with PNut34s when including uncalled methods, so it doesn't appear to support it (yet). What are your thoughts on this?
Cheers,
Roger.
Yes, I need to make it work this way. I've thought about this, but not so far, yet, that I know how to achieve it, exactly.
I think I could set a bit flag in each method index when a method is referenced, and then OR all those flags together for each method when redundant objects are removed. As a very last compilaton step, I could remove the dead code, but not the index data because it would throw everything off. I need to think about it more.
Right now, I"m working on graphical debugging displays.
Graphical debugging sounds handy. Is it Windows only for now, or is it something that is also going to be done on the P2 target?
It is host-based. You name and configure various scope windows and then feed them update data by name. It uses the current DEBUG commands. It is for Windows now.
-- it was removed from my system (I don't know when)
-- attempting to download... "Failed - Virus Detected"
I still had the ZIP (u) from a couple weeks ago, so I copied PNut from it to my working directory. Within about 10 seconds is disappears. Windows Defender is on a search-and-destroy mission.
This in inconvenient....
Using Windows? WIN10? WIN7?
Now PNUT32ua is missing on my system.
A faster way is to click on the "Start" task bar icon, then type "Virus and threat protection" to go straight to the "Current threats" settings.
From there you should be able to find the quarantined threat and restore (allow) it.
Edit: and don't be surprised if you have to do it again after the next scan 😒.
Edit2: Here's a link to add an exclusion: https://support.microsoft.com/en-us/help/4028485/windows-10-add-an-exclusion-to-windows-security
Edit3: The above link got me nowhere. No "Add an Exclusion" option shows up...
I'm kind of worried that my code will continue to set off their alarms. I can't change it enough to stop their recognition, probably.
Here is my working version. I renamed it P2Tool.exe. See if this works:
But, after that it ran.
So, much improved!
If it was your Spin2 compiler code in particular, PropTool alphas would be detected aswell, yet they apparently aren't
I didn't do anything. That's just my current working version. I have Delphi debugging enabled, so the file is larger than normal. If files are sufficiently porcine, they pass the health check.
I can visit this again until Wednesday, I'll be on the road.
The only time I didn't have to do this was the signed V34ua version.
I went to download the last file I posted and, sure enough, it said it was a virus. I clicked my way through a few things to get it off my back, then I unzipped it. After about a second, it deleted the .exe file and said that it had removed a threat. I found my way through some other non-intuitive menus and got the program back. This is really lousy. You can't write Windows programs, anymore, without their agreement, it seems.
Yes, I've not liked where Microsoft has been heading for 30 years. It's getting really unfriendly.
All the basics are there and we just need a Spin2 Compiler running on the P2. Chip started something, but seem to got stuck until he has some new thought.
Maybe fastspin via RISCV emulation, GCC should do that, but I think without Hyper ram support we will fall flat on the face again.
@mpark's Spinx did work very well on P1, but some of it is a binary blob so I never was able to really understand how it worked, but it basically run different programs chained to each other passing some parameters.
Very impressive and just stumbles at programs to big to fit together with the compiler.
Porting that to the P2 would help a lot. Right @mpark?
Anyways, I can't run Pnut either.
Mike
I understand what you are saying, kg1, but it's a fact that all the big tech companies are becoming more and more controlling. I would feel a lot better being outside of their systems.
But the underlying spin2 is very different to spin1. IMHO Chip really needs to be the one to write a P2 self-hosted compiler.