Readit News logoReadit News
yassim commented on Carbon footprint of homegrown food five times greater than conventional   telegraph.co.uk/news/2024... · Posted by u/fwungy
yassim · 2 years ago
If I was being paranoid, Id say this is ground softening/ giving cover for, the councils to sell off allotment land, to make up for shortfalls in their budgets.

Allotments are chunks of land set aside for housholds to grow their own fruit and veg. Its generally an older gen (plus some younger woke) that use them, so nobody who the telegraph readers will care about. The councils have had a very hard time of it from the party in power due to many factors, and some are on the verge of bankruptcy. [1]

So being able to sell land that is genrally in walking distance to other residental zones to devlopers would be a welcome shot of cash. With the thin justification of "Its better for the enviroment" to keep most the would be defenders busy arguing if it is, or isnt, untill the deals are done, and they are lost.

It almost funny when the UK also has a general, saying that "Britain must train citizen army" [2], and allotments were promoted so the UK could feed itself when being blockaded. [3]

[1] https://www.theguardian.com/society/2023/dec/06/english-town... [2] https://www.bbc.co.uk/news/uk-68086188 [3] https://www.telegraph.co.uk/news/earth/environment/9996180/H...

yassim commented on The case for memory-mapped GPU assets   facebook.com/permalink.ph... · Posted by u/ingve
exDM69 · 10 years ago
I did something along the lines of his suggestion using OpenGL sparse textures (D3D would call them tiled resources) and persistently/coherently mapped buffers with disk i/o being done with memory mapped files. It's a rather crude proof of concept for on-demand loading of large textures (I used a 16k x 8k satellite image). I didn't properly detect "page faults", but I had some of the mechanisms implemented (outputs yellow pixels instead of page faults).

To make it work fully end-to-end, it would look something like this:

    1. Shader samples from a sparse texture, and detects that the requested page is non-resident.
    1b. Fall back to lower mip map level.
    2. Shader uses atomic-or to write to a "page fault" bitmap (one bit per page)
    3. The bitmap is transferred to the CPU
    4. For each set bit, start async copy from disk to DMA buffer (ie. pixel buffer object in GL)
    5. When disk i/o is complete, start texture upload from buffer to a "page pool" texture
    6. When texture upload is complete, re-map the texture page from "page pool" to the actual texture
Now this approach works alright, but there are a number of issues that make it impractical for the time being. Off the top of my head:

    1. Sparse textures are only supported on Nvidia and AMD hardware. Not Intel, ARM or IMG.
    2. Requires Vulkan or D3D12 for step #6 (the demo doesn't do this, so there may be pipeline stalls)
    3. One or two frames of latency that can only be avoided if this was done in the kernel mode driver.
    4. Poor fit for existing KMD architecture (which has its own concept of residency)
    5. Detecting page faults is easy. Detecting which pages can be dropped is hard.
Here's the source code of my demo. It's not pretty because it was a one off demo project for very specific hardware (Android + OpenGL 4.5, which means Nvidia Shield hardware with Maxwell GPUs). The technique is portable, though.

https://github.com/rikusalminen/sparsedemo/blob/master/jni/g...

(In the code above, all the interesting bits are the functions named xfer_*)

Based on the experience from writing this demo, I have to agree with Carmack here. File-backed textures would make a lot of sense for a lot of use cases.

yassim · 10 years ago
Thanks for the example code.
yassim commented on SpaceX announces a mission to land on Mars by 2018   slate.com/blogs/bad_astro... · Posted by u/jonbaer
bisby · 10 years ago
my dad always used to joke that the key to flying is to throw yourself at the ground and miss. Which is surprisingly an accurate representation of how orbit works.

I find that the biggest thing that is often mistaught/misunderstood is orbital mechanics. You dont get to the moon by aiming directly at the moon. You dont get to mars by aiming directly at mars.

Watching lil einsteins with my kid the other day. and in episode one they say "we've left gravity!" as they travel to space. Which clearly is not how it works.

I think the falling past the edge of the world repeatedly really helps people get a grasp on how orbit works. and once you get that concept down, you can move the sphere of influence to the sun and get space travel down.

Might depend on what grade "elementary" is. Kindergarden might struggle, but I bet 5th grade could handle it.

yassim · 10 years ago
Thats also a Douglas Adams quote from HHGTTG.
yassim commented on Games with creative copy protection (2013)   gameological.com/2013/05/... · Posted by u/aaronbrethorst
yassim · 10 years ago
Spyro: Year of the Dragon also tried the game glitch copy protection route. http://www.gamasutra.com/view/feature/131439/keeping_the_pir...
yassim commented on Small Memory Software: Patterns for systems with limited memory   smallmemory.com/book.html... · Posted by u/ingve
viraptor · 10 years ago
Why is C++ not good? It doesn't grow memory usage on its own. If you can put C code on something, you can do C++ as well. We're talking about things up to 10 MB. It's perfectly fine on those. (actually the smaller your target, the less difference there is - you don't really have to care about APIs or calling conventions on an 8K chip)

Java has many different versions. For example the smallest one (JavaCard) can run on tiny chips in smartcards, so Java as a whole may be a bad generalisation, but it's definitely possible.

yassim · 10 years ago
I find C++ encourages more pointer use by default, which implies all things are in memory at all the time. C on the other hand has this less implicitly, so things such as handles, deferred messages vs straight method call, have less of a.. friction?

Now you can wrap them up in C++, but then making such things hidden I think defeats some of their usage.

A managed runtime should be handle this better, but I don't know of any Java or .NET runtime that is optimised for a small memory foot print, perhaps paging from a larger virtual space[1]. I'd be interested to hear of any really.

[1] I do know there have been versions of Smalltalk that did basically this, but nothing recently that I've heard of.

yassim commented on Joint Allocations in C++   turingtester.wordpress.co... · Posted by u/ingve
quicknir · 10 years ago
Post author here. Sorry you feel that way. I'm surprised you don't think that moving out the messy code into make_contiguous is a win. Isn't it good to factor out clearly reusable code into functions, so you can reuse it? Would you really prefer writing out code like that in a dozen places for a dozen classes that needed contiguous storage, to writing one function, testing it, and then calling it from all those other places?
yassim · 10 years ago
Hi, Another Game dev here. Firstly, neat article, thanks for writing it.

I'm curious as to the problem you're exploring/solving here?

"Concatenated struct's in single chunk" is a neat trick. The use case seems a bit broken[1], but I'm assuming that it's from the original video, and your c++-ifying it? Or at least trying to find a nicer way to write this style of code?

If you'r going this route, I'd be tempted not to use pointers at all, and just use offsets and accessors.[2]

  * Lack of pointers means you can load in 1 read. (endian needs to be watched, and assumes you can get the entire size elsewhere)
  * You can also shuffle it around in memory should you be doing something fancy. (defragging heaps might be useful if doing a sandbox)
  * Better encapsulation? maybe..
But the basic point I'd like to make is, there is no nice way to write this type of code, because c and c++ gives us no nice[3] way of expressing it.

[1] Verts and Indices are generally uploaded to a GPU then discarded, but this has the counts, which is needed CPU side for draw calls, in the same chunk so would need to be copied before freeing.

[2]

  struct Mesh 
  {
  	int32_t num_indices, 
  		num_verts;

  	// inline to this struct.. 
  	// assumes Vector3 is aligned 4 bytes.
  	// and that Mesh has been alloced to same alignment.
  	//
  	// Vector3 positions[num_verts];
  	// int32_t indices[num_indices];
  	// Vector2 uvs[num_verts];
  
	inline const Vector3* PositionsBegin() const { return reinterpret_cast<const Vector3*>(this + 1); }
  	inline const Vector3* PositionsEnd() const { return PositionsBegin() + num_verts; }
  	inline const int32_t* IndicesBegin() const { return reinterpret_cast<const int32_t*>(PositionsEnd()); }
  	inline const int32_t* IndicesEnd() const { return IndicesBegin() + num_indices; }
  	// etc
  };
[3] Maintainable, fast at runtime, low mental friction to people other than the author, etc

yassim commented on Hoverboard? Still in the Future   nytimes.com/2014/10/21/te... · Posted by u/declan
yassim · 11 years ago
Some interesting rewards in the Kickstarter. https://www.kickstarter.com/projects/142464853/hendo-hoverbo...

I do like the White box idea. I wonder though at the price where they start and if thats going to eat the profit generated. (I don't know, they could be very cheap to produce at scale.)

yassim commented on Frequency   xkcd.com/1331/... · Posted by u/jaimebuelta
foz · 12 years ago
I was lucky enough to see Randall Munroe speak at the OreDev conference last year. The video is online, highly recommended for XKCD fans:

http://oredev.org/2013/wed-fri-conference/art-and-code-with-...

yassim · 12 years ago
Thank you for the link. I wonder if Tinker Tots is now having a surge of traffic.
yassim commented on Compilers in OpenBSD   marc.info/?l=openbsd-misc... · Posted by u/hebz0rl
mjs · 12 years ago
"...but there is something I wish would happen first.

An LTS release of an open source compiler."

Surprising that this doesn't already exist--Apple and RedHat and Ubuntu, etc. must all maintain what is in effect a LTS version of the compilers they ship, in the same way that OpenBSD does.

yassim · 12 years ago
Forgive my ignorance, but what does 'LTS' stand for?
yassim commented on Go 1.1 performance improvements   dave.cheney.net/2013/05/2... · Posted by u/enneff
JulienSchmidt · 13 years ago
... and the good news is, that this wasn't all that can be squeezed out of Go.

Go 1.1 comes with some impressive performance optimizations, but there are more optimizations that can be done and there are already some great ideas discussed, like a Preemptive Scheduler.

Just see what performance related changes where already made since the Go 1.1 release last week:

• SSE-powered string/bytes compare: http://code.google.com/p/go/source/detail?r=b2f1f8cb2fcb7025...

• less allocations in the JSON package: http://code.google.com/p/go/source/detail?r=00d69aa6619e77d8...

• optimizations to malloc(): http://code.google.com/p/go/source/detail?r=0fe374e887455a57... and http://code.google.com/p/go/source/detail?r=931a7362e30c2139...

• optimized aeshash: http://code.google.com/p/go/source/detail?r=80c8a9f81e4816e0...

• faster x86 memmove: http://code.google.com/p/go/source/detail?r=4cb93e2900d0c748...

• less allocations in the buffered I/O package: http://code.google.com/p/go/source/detail?r=bce231eb0fdd4bbe...

• optimizations in the flate compression package: http://code.google.com/p/go/source/detail?r=bd653e485f1d9b5c...

• optimizations to the net/http package: http://code.google.com/p/go/source/detail?r=647f336edfe88a31... and http://code.google.com/p/go/source/detail?r=d1d76fc0ab6a33f1...

• integrated network poller for BSD: http://code.google.com/p/go/source/detail?r=9d60132d77847262...

yassim · 13 years ago
Wonderful links. Thankyou.

u/yassim

KarmaCake day49April 8, 2011View Original