<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Ryujinx/Ryujinx.HLE/HOS/Ipc, branch master</title>
<subtitle>A backup of the Ryujinx master git branch.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/'/>
<entry>
<title>Move solution and projects to src</title>
<updated>2023-04-27T21:51:14+00:00</updated>
<author>
<name>TSR Berry</name>
<email>20988865+TSRBerry@users.noreply.github.com</email>
</author>
<published>2023-04-07T23:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=cee712105850ac3385cd0091a923438167433f9f'/>
<id>cee712105850ac3385cd0091a923438167433f9f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reducing Memory Allocations 202303 (#4624)</title>
<updated>2023-04-24T02:06:23+00:00</updated>
<author>
<name>jhorv</name>
<email>38920027+jhorv@users.noreply.github.com</email>
</author>
<published>2023-04-24T02:06:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=666e05f5cb9aa9dc86874823c108586e7a5b38bd'/>
<id>666e05f5cb9aa9dc86874823c108586e7a5b38bd</id>
<content type='text'>
* use ArrayPool, avoid 6000-7000 allocs/sec of runtime

* use ArrayPool, avoid ~7k allocs/second during game execution

* use ArrayPool, avoid ~3000 allocs/sec during game execution

* use MemoryPool, reduce 0.5 MB/sec of new allocations during game execution

* avoid over-allocation by setting List&lt;&gt; Capacity when known

* remove LINQ in KTimeManager.UnscheduleFutureInvocation

* KTimeManager - avoid spinning one more time when the time has arrived

* KTimeManager - let SpinWait decide when to Thread.Yield(), and don't SpinOnce() immediately after Thread.Yield()

* use MemoryPool, reduce ~175k bytes/sec allocation during game execution

* IpcService - call commands via dynamic methods instead of reflection .Invoke(). Faster to call and with fewer allocations because parameters can be passed directly instead of as an array

* Make ButtonMappingEntry a record struct to avoid allocations. Set the List&lt;ButtonMappingEntry&gt; capacity according to use.

* add MemoryBuffer type for working with MemoryPool&lt;byte&gt;

* update changes to use MemoryBuffer

* make parameter ReadOnlySpan instead of Span

* whitespace fix

* Revert "IpcService - call commands via dynamic methods instead of reflection .Invoke(). Faster to call and with fewer allocations because parameters can be passed directly instead of as an array"

This reverts commit f2c698bdf65f049e8481c9f2ec7138d9b9a8261d.

* tweak KTimeManager spin behavior

* replace MemoryBuffer with ByteMemoryPool modeled after System.Buffers.ArrayMemoryPool&lt;T&gt;

* make ByteMemoryPoolBuffer responsible for renting memory</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* use ArrayPool, avoid 6000-7000 allocs/sec of runtime

* use ArrayPool, avoid ~7k allocs/second during game execution

* use ArrayPool, avoid ~3000 allocs/sec during game execution

* use MemoryPool, reduce 0.5 MB/sec of new allocations during game execution

* avoid over-allocation by setting List&lt;&gt; Capacity when known

* remove LINQ in KTimeManager.UnscheduleFutureInvocation

* KTimeManager - avoid spinning one more time when the time has arrived

* KTimeManager - let SpinWait decide when to Thread.Yield(), and don't SpinOnce() immediately after Thread.Yield()

* use MemoryPool, reduce ~175k bytes/sec allocation during game execution

* IpcService - call commands via dynamic methods instead of reflection .Invoke(). Faster to call and with fewer allocations because parameters can be passed directly instead of as an array

* Make ButtonMappingEntry a record struct to avoid allocations. Set the List&lt;ButtonMappingEntry&gt; capacity according to use.

* add MemoryBuffer type for working with MemoryPool&lt;byte&gt;

* update changes to use MemoryBuffer

* make parameter ReadOnlySpan instead of Span

* whitespace fix

* Revert "IpcService - call commands via dynamic methods instead of reflection .Invoke(). Faster to call and with fewer allocations because parameters can be passed directly instead of as an array"

This reverts commit f2c698bdf65f049e8481c9f2ec7138d9b9a8261d.

* tweak KTimeManager spin behavior

* replace MemoryBuffer with ByteMemoryPool modeled after System.Buffers.ArrayMemoryPool&lt;T&gt;

* make ByteMemoryPoolBuffer responsible for renting memory</pre>
</div>
</content>
</entry>
<entry>
<title>Rename Hipc to Cmif where appropriate (#3880)</title>
<updated>2023-04-14T23:00:34+00:00</updated>
<author>
<name>Alex Barney</name>
<email>thealexbarney@gmail.com</email>
</author>
<published>2023-04-14T23:00:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=11ecff2ff04633d261b9a43db792f6438df63f40'/>
<id>11ecff2ff04633d261b9a43db792f6438df63f40</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reducing memory allocations (#4537)</title>
<updated>2023-03-17T12:14:50+00:00</updated>
<author>
<name>jhorv</name>
<email>38920027+jhorv@users.noreply.github.com</email>
</author>
<published>2023-03-17T12:14:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=5131b71437b36f9b876046a2fddd5465652e0f10'/>
<id>5131b71437b36f9b876046a2fddd5465652e0f10</id>
<content type='text'>
* add RecyclableMemoryStream dependency and MemoryStreamManager

* organize BinaryReader/BinaryWriter extensions

* add StreamExtensions to reduce need for BinaryWriter

* simple replacments of MemoryStream with RecyclableMemoryStream

* add write ReadOnlySequence&lt;byte&gt; support to IVirtualMemoryManager

* avoid 0-length array creation

* rework IpcMessage and related types to greatly reduce memory allocation by using RecylableMemoryStream, keeping streams around longer, avoiding their creation when possible, and avoiding creation of BinaryReader and BinaryWriter when possible

* reduce LINQ-induced memory allocations with custom methods to query KPriorityQueue

* use RecyclableMemoryStream in StreamUtils, and use StreamUtils in EmbeddedResources

* add constants for nanosecond/millisecond conversions

* code formatting

* XML doc adjustments

* fix: StreamExtension.WriteByte not writing non-zero values for lengths &lt;= 16

* XML Doc improvements. Implement StreamExtensions.WriteByte() block writes for large-enough count values.

* add copyless path for StreamExtension.Write(ReadOnlySpan&lt;int&gt;)

* add default implementation of IVirtualMemoryManager.Write(ulong, ReadOnlySequence&lt;byte&gt;); remove previous explicit implementations

* code style fixes

* remove LINQ completely from KScheduler/KPriorityQueue by implementing a custom struct-based enumerator</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* add RecyclableMemoryStream dependency and MemoryStreamManager

* organize BinaryReader/BinaryWriter extensions

* add StreamExtensions to reduce need for BinaryWriter

* simple replacments of MemoryStream with RecyclableMemoryStream

* add write ReadOnlySequence&lt;byte&gt; support to IVirtualMemoryManager

* avoid 0-length array creation

* rework IpcMessage and related types to greatly reduce memory allocation by using RecylableMemoryStream, keeping streams around longer, avoiding their creation when possible, and avoiding creation of BinaryReader and BinaryWriter when possible

* reduce LINQ-induced memory allocations with custom methods to query KPriorityQueue

* use RecyclableMemoryStream in StreamUtils, and use StreamUtils in EmbeddedResources

* add constants for nanosecond/millisecond conversions

* code formatting

* XML doc adjustments

* fix: StreamExtension.WriteByte not writing non-zero values for lengths &lt;= 16

* XML Doc improvements. Implement StreamExtensions.WriteByte() block writes for large-enough count values.

* add copyless path for StreamExtension.Write(ReadOnlySpan&lt;int&gt;)

* add default implementation of IVirtualMemoryManager.Write(ulong, ReadOnlySequence&lt;byte&gt;); remove previous explicit implementations

* code style fixes

* remove LINQ completely from KScheduler/KPriorityQueue by implementing a custom struct-based enumerator</pre>
</div>
</content>
</entry>
<entry>
<title>Misc performance tweaks (#4509)</title>
<updated>2023-03-11T20:05:48+00:00</updated>
<author>
<name>jhorv</name>
<email>38920027+jhorv@users.noreply.github.com</email>
</author>
<published>2023-03-11T20:05:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=23c844b2aa84a65e573dcc023d19b8f5294a8baf'/>
<id>23c844b2aa84a65e573dcc023d19b8f5294a8baf</id>
<content type='text'>
* use Array.Empty() where instead of allocating new zero-length arrays

* structure for loops in a way that the JIT will elide array/Span bounds checking

* avoiding function calls in for loop condition tests

* avoid LINQ in a hot path

* conform with code style

* fix mistake in GetNextWaitingObject()

* fix GetNextWaitingObject() possibility of returning null if all list items have TimePoint == long.MaxValue

* make GetNextWaitingObject() behave FIFO behavior for multiple items with the same TimePoint</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* use Array.Empty() where instead of allocating new zero-length arrays

* structure for loops in a way that the JIT will elide array/Span bounds checking

* avoiding function calls in for loop condition tests

* avoid LINQ in a hot path

* conform with code style

* fix mistake in GetNextWaitingObject()

* fix GetNextWaitingObject() possibility of returning null if all list items have TimePoint == long.MaxValue

* make GetNextWaitingObject() behave FIFO behavior for multiple items with the same TimePoint</pre>
</div>
</content>
</entry>
<entry>
<title>misc: Make PID unsigned long instead of long (#3043)</title>
<updated>2022-02-09T20:18:07+00:00</updated>
<author>
<name>Mary</name>
<email>mary@mary.zone</email>
</author>
<published>2022-02-09T20:18:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=6dffe0fad4bc8dee0e25ce038639d890b29d56a0'/>
<id>6dffe0fad4bc8dee0e25ce038639d890b29d56a0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ipc: Remove size checks for buffer type 0x21/0x22 (#2387)</title>
<updated>2021-06-22T17:32:22+00:00</updated>
<author>
<name>Ac_K</name>
<email>Acoustik666@gmail.com</email>
</author>
<published>2021-06-22T17:32:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=50ba233ac628ffb9661ea2bda2cda216d18e81c1'/>
<id>50ba233ac628ffb9661ea2bda2cda216d18e81c1</id>
<content type='text'>
* ipc: Remove size checks for buffer type 0x21/0x22

Since original IPC implementation doesn't check the buffers size, there is no reason to check them so I've removed it. Checking the buffers addresses could prevent to unexpected behaviors.

That's fix a bsd service issue with some homebrew and some games like Knockout City (https://github.com/Ryujinx/Ryujinx-Games-List/issues/3622) which is now bootable:

* addresses gdkchan's review</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ipc: Remove size checks for buffer type 0x21/0x22

Since original IPC implementation doesn't check the buffers size, there is no reason to check them so I've removed it. Checking the buffers addresses could prevent to unexpected behaviors.

That's fix a bsd service issue with some homebrew and some games like Knockout City (https://github.com/Ryujinx/Ryujinx-Games-List/issues/3622) which is now bootable:

* addresses gdkchan's review</pre>
</div>
</content>
</entry>
<entry>
<title>SM instance &amp; TIPC fixes (#2241)</title>
<updated>2021-05-05T21:44:26+00:00</updated>
<author>
<name>Mary</name>
<email>me@thog.eu</email>
</author>
<published>2021-05-05T21:44:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=b94dc01d4357c608d60383e85f709312294fd833'/>
<id>b94dc01d4357c608d60383e85f709312294fd833</id>
<content type='text'>
This PR addresses the following issues:
- SM was previously instancied once and reused on all sessions. This
  could cause inconsistency on the service initialization.
- TIPC replies were not matching what is generated on hardware.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR addresses the following issues:
- SM was previously instancied once and reused on all sessions. This
  could cause inconsistency on the service initialization.
- TIPC replies were not matching what is generated on hardware.</pre>
</div>
</content>
</entry>
<entry>
<title>HLE: Fix integer sign inconcistency accross the codebase (#2222)</title>
<updated>2021-04-24T10:16:01+00:00</updated>
<author>
<name>Mary</name>
<email>me@thog.eu</email>
</author>
<published>2021-04-24T10:16:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=305f06eb71a7832e6b0081a67015b66ced8a23cd'/>
<id>305f06eb71a7832e6b0081a67015b66ced8a23cd</id>
<content type='text'>
* Make all title id instances unsigned

* Replace address and size with ulong instead of signed types

Long overdue change.
Also change some logics here and there to optimize with the new memory
manager.

* Address Ac_K's comments

* Remove uneeded cast all around

* Fixes some others misalignment</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Make all title id instances unsigned

* Replace address and size with ulong instead of signed types

Long overdue change.
Also change some logics here and there to optimize with the new memory
manager.

* Address Ac_K's comments

* Remove uneeded cast all around

* Fixes some others misalignment</pre>
</div>
</content>
</entry>
<entry>
<title>Initial support for the new 12.x IPC system (#2182)</title>
<updated>2021-04-13T22:01:24+00:00</updated>
<author>
<name>Mary</name>
<email>me@thog.eu</email>
</author>
<published>2021-04-13T22:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.benis.co.uk/Ryujinx/commit/?id=0746b83edf49d1fd668dd337264e942f361b675c'/>
<id>0746b83edf49d1fd668dd337264e942f361b675c</id>
<content type='text'>
* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes

* Implement inital support for TIPC and adds SM command ids

* *Ipc to *ipc

* Missed a ref in last commit...

* CommandAttributeTIpc to CommandAttributeTipc

* Addresses comment and fixes some bugs around

TIPC doesn't have any padding requirements as buffer C isn't a thing
Fix for RegisterService inverting two argument only on TIPC</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes

* Implement inital support for TIPC and adds SM command ids

* *Ipc to *ipc

* Missed a ref in last commit...

* CommandAttributeTIpc to CommandAttributeTipc

* Addresses comment and fixes some bugs around

TIPC doesn't have any padding requirements as buffer C isn't a thing
Fix for RegisterService inverting two argument only on TIPC</pre>
</div>
</content>
</entry>
</feed>
